Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/dict
diff options
context:
space:
mode:
authorAssim Deodia <assim.deodia@gmail.com>2008-06-18 04:44:47 (GMT)
committer Assim Deodia <assim.deodia@gmail.com>2008-06-18 04:44:47 (GMT)
commit8934f10685a6cec558cc9b9aeacf6c530b2cc6c6 (patch)
tree3c3fa0ad5edcefda2639867a170c83e3d677a4d6 /dict
parent2385830803ca8b6eaf9a2666f26c0f5586167c46 (diff)
dictionary and word class interface for sqlite DB
Diffstat (limited to 'dict')
-rw-r--r--dict/dict.sql.zipbin0 -> 4913531 bytes
-rw-r--r--dict/index.php69
2 files changed, 69 insertions, 0 deletions
diff --git a/dict/dict.sql.zip b/dict/dict.sql.zip
new file mode 100644
index 0000000..5a8d304
--- /dev/null
+++ b/dict/dict.sql.zip
Binary files differ
diff --git a/dict/index.php b/dict/index.php
new file mode 100644
index 0000000..b9588f4
--- /dev/null
+++ b/dict/index.php
@@ -0,0 +1,69 @@
+<?PHP
+set_time_limit ( 0 ) ;
+mysql_connect('localhost', 'root', 'kandisa');
+mysql_select_db('wordnet30');
+
+$q1 = "SELECT *
+FROM `word`
+WHERE `lemma` REGEXP CONVERT( _utf8 '^[a-z]*[a-z]$'
+USING latin1 )
+COLLATE latin1_swedish_ci";
+$result = mysql_query($q1) or die('mysql_query1:'.mysql_error());
+
+$num_rows = mysql_num_rows($result);
+
+
+while($num_rows > 0){
+
+
+ $row = mysql_fetch_assoc($result);
+ $q2 = "INSERT into `las_word` (`wordid`, `lemma`) VALUES ( '".$row['wordid']."', '".$row['lemma']."' )";
+ $result2 = mysql_query($q2) or print('mysql_query:2'.mysql_error());
+
+ $q3 = "SELECT * FROM `sense` WHERE `wordid` = '".$row['wordid']."'";
+ $result3 = mysql_query($q3) or print('mysql_query:3'.mysql_error());
+ $num_rows3 = mysql_num_rows($result3);
+
+
+ for($i = 0; $i< $num_rows3; $i++){
+
+ $row3 = mysql_fetch_assoc($result3);
+
+ $q4 = "INSERT INTO `las_sense` (`wordid`, `synsetid`, `rank`) VALUES ('".$row3['wordid']."', '".$row3['synsetid']."', '".$row3['rank']."')";
+ $result4 = mysql_query($q4) or print('mysql_query:4'.mysql_error());
+
+ $q5 = "SELECT * FROM `synset` WHERE `synsetid` = '".$row3['synsetid']."'";
+ $q6 = "SELECT * FROM `sample` WHERE `synsetid` = '".$row3['synsetid']."'";
+
+ $result5 = mysql_query($q5) or print('mysql_query:5'.mysql_error());
+ $num_rows5 = mysql_num_rows($result5);
+
+ $result6 = mysql_query($q6) or print('mysql_query:6'.mysql_error());
+ $num_rows6 = mysql_num_rows($result6);
+
+ for($j = 0;$j < $num_rows5; $j++){
+
+ $row5 = mysql_fetch_assoc($result5);
+ $def = addslashes($row5['definition']);
+ $q7 = "INSERT INTO `las_synset` (`synsetid`, `pos`, `definition`) VALUES ('".$row5['synsetid']."', '".$row5['pos']."', '".$def."')";
+ $result7 = mysql_query($q7) or print('mysql_query:7'.mysql_error().$q7);
+
+ }
+
+ for($k = 0;$k < $num_rows6; $k++){
+
+ $row6 = mysql_fetch_assoc($result6);
+ $sample = addslashes($row6['sample']);
+ $q8 = "INSERT INTO `las_sample` (`synsetid`, `sampleid`, `sample`) VALUES ('".$row6['synsetid']."', '".$row6['sampleid']."', '".$sample."')";
+ $result8 = mysql_query($q8) or print('mysql_query:8'.mysql_error());
+
+ }
+
+ }
+
+ $num_rows --;
+ //echo "<br/>".$row['wordid'].":".$row['lemma'];
+}
+if(num_rows == 0)
+ echo "Done :)";
+?> \ No newline at end of file