[Hejes-devel] [826] ohanal.fix

hejes-devel at nytud.hu hejes-devel at nytud.hu
Thu Jun 20 15:29:48 CEST 2013


Revision: 826
Author:   hussami
Date:     2013-06-20 15:29:48 +0200 (Thu, 20 Jun 2013)
Log Message:
-----------
ohanal.fix

Modified Paths:
--------------
    trunk/misc/osiris_xml/ohanalyze.py

Modified: trunk/misc/osiris_xml/ohanalyze.py
===================================================================
--- trunk/misc/osiris_xml/ohanalyze.py	2013-06-20 12:15:35 UTC (rev 825)
+++ trunk/misc/osiris_xml/ohanalyze.py	2013-06-20 13:29:48 UTC (rev 826)
@@ -5,6 +5,7 @@
 import sys
 import MySQLdb
 import re
+sys.path.append("../../web2py/applications/helyesiras_webdev/modules")
 from egybekulon2_humor import StemmingAnalysis
 from egybekulon2_humor import HumorAna
 import itertools
@@ -22,6 +23,7 @@
 
   def connect(self, server, user, pwd, dbs):
     self.connection = MySQLdb.connect(host=server, user=user, passwd=pwd, \
+#      db=dbs)
       db=dbs, charset='utf8')
 
   def disconnect(self):
@@ -56,8 +58,9 @@
     self.data = {}
     results = self.mysqlhandler.fetchall()
     for row in results:
-      self.data[row[0].encode("utf8")] = 0
-#      self.data[row[0]] = 0
+#      print row[0]
+#      self.data[row[0].encode("utf8")] = 0
+      self.data[row[0]] = 0
 #     if c == 300:
 #       print row[0].encode("utf8")
 #       print self.data
@@ -313,9 +316,10 @@
     if where == 0:
       self.output("use dbdict", where)
     self.output("drop table incidences", where)
-    self.output("create table incidences(term varchar(100) " +\
-#    self.output("create table incidences(term varchar(100) collate utf8_bin " +\
-      "not null, dict_id int, " + "idx int)", where)
+#    self.output("create table incidences(term varchar(100) " +\
+    self.output("create table incidences(term varchar(100) collate utf8_bin " +\
+      "not null, dict_id int, idx int)  engine=MyISAM default charset=utf8 " +\
+      "collate=utf8_bin", where)
     self.output("create index incidence_index on incidences(term)", where)
 
     query = "select id, actual, norm from ohdict";




More information about the Hejes-devel mailing list