#!/usr/local/bin/perl -w use strict; use CGI; my $query = new CGI; my $dbroot = "/var/www/html/lextypedb/db"; my $cssdir = "/lextypedb"; my $cgidir = "/cgi-bin/lextypedb_tools"; my $charset = "utf-8"; my $version = "???"; if(-e "params"){ open(PARAM, "params"); while(){ chomp; (my $para, my $val) = split /=/;#/ if($para eq "dbroot"){ $dbroot = $val; }elsif($para eq "charset"){ $charset = $val; }elsif($para eq "cssdir"){ $cssdir = $val; }elsif($para eq "cgidir"){ $cgidir = $val; }elsif($para eq "version"){ $version = $val; } } close(PARAM); } #Receive the confusing param. my $confusing = $query->param("confusing"); #Retrieve all lexical types that contain the confusing word as an instance. use DBI; my @lextypes; my $lexicon_table = "lex_and_freq_tbl"; my $dbname = $dbroot."/"."lt.db"; my $dbh = DBI->connect("dbi:SQLite:dbname=$dbname", "", "", {AutoCommit => 0}); my $sth = $dbh->prepare( "select lextype from $lexicon_table where orth=?" ); $sth->execute($confusing); while(my @row = $sth->fetchrow_array){ push(@lextypes, $row[0]); } my $list_table = "list_tbl"; $sth = $dbh->prepare( "select * from $list_table where lextype=?" ); my $total=0; my $out = "
Lexical Type | Example (Lexicon, Corpus) | |
---|---|---|
Lexical Type | Linguistic Name | Example (Lexicon, Corpus) |
".$row[0]." | "; $out .= "".$row[1]." | "; $out .= "".$examples." (".$row[3].", ".$row[4].")"." | "; $out .= "
$mes