+ my $sth = $dbh->prepare("insert into paragraph values(?,?,?)");
+ $sth->execute($self->{para}, $self->{date}, "$self->{year}-$self->{id}");
+ my $lastrow = $dbh->func('last_insert_rowid');
+ $sth->finish;
+
+
+# my @w = split /[.,;:\s"'\$\%!£^&\*\(\)\[\]\{\}\#\<\>+=]+/, $self->{para};
+ my @w = split m|[\b\s]+|, $self->{para};
+# print join(' ', @w), "\n";
+ $sth = $dbh->prepare("insert into refer values(?,?,?,?)");
+
+ my $i = 0;
+ for (@w) {
+
+ # starts with a capital letter that isn't Q
+ if (/^[A-PR-Z]/ || m|\d+[A-Z][-/A-Z0-9]*$|) {
+ # not all digits
+ next if /^\d+$/;
+
+ # isn't a stop word
+ my $w = uc;
+ $w =~ s/\W+$//;
+ unless ($stop{$w}) {
+ # add it into the word list
+ $sth->execute($w, $lastrow, $self->{date}, $i);
+# print " $w";
+ }
+ }
+ $i++;
+ }
+ $sth->finish;
+}
+
+sub query
+{
+ my $self = shift;
+ my %args = @_;
+ my @out;