[Hejes-devel] [1672] lagyszaruak: egybe; lagy szaru kulon

hejes-devel at nytud.hu hejes-devel at nytud.hu
Mon Oct 17 12:25:43 CEST 2016


Revision: 1672
Author:   mittelholcz
Date:     2016-10-17 12:25:43 +0200 (Mon, 17 Oct 2016)
Log Message:
-----------
lagyszaruak: egybe; lagy szaru kulon

Modified Paths:
--------------
    trunk/web2py/applications/helyesiras_webdev/modules/egybekulon2.py

Modified: trunk/web2py/applications/helyesiras_webdev/modules/egybekulon2.py
===================================================================
--- trunk/web2py/applications/helyesiras_webdev/modules/egybekulon2.py	2016-10-17 09:57:02 UTC (rev 1671)
+++ trunk/web2py/applications/helyesiras_webdev/modules/egybekulon2.py	2016-10-17 10:25:43 UTC (rev 1672)
@@ -77,8 +77,8 @@
     """
     self.dbconn = dbconn
     with open(os.path.dirname(os.path.realpath(__file__)) + '/resources/egybekulon2_-_lagyszaruak') as file_:
-      self.literally_exceptions = set([ x.strip() for x in file_ ])
-      self.literally_exceptions = set([ unicode(x, 'utf8') for x in self.literally_exceptions if x and not x.startswith('#') ])
+      self.lagyszaru_exceptions = set([ x.strip() for x in file_ ])
+      self.lagyszaru_exceptions = set([ unicode(x, 'utf8') for x in self.lagyszaru_exceptions if x and not x.startswith('#') ])
     pass
     
   @staticmethod
@@ -235,20 +235,10 @@
       ret.append(''.join([t.tok for t in self.toklst.toks[:-1]]) + head)
     #############################
     # lagyszaruak
-    # TODO:
-    #   OK: a ragozott alakokra is mukodnie kellene (pl. 'lagyszaruaknak')
-    #   2. honnan jon a magyarazat? Azt is at kell irni, kulonben mas lesz a magyarazat, mint a javaslat.
-    #   OK: lehet, hogy nem kene minden result-ot atirni, ha tobb kulonbozo is van
-    ####
-    #if any([x in ''.join(self.usrtoks) for x in self.literally_exceptions]):
-    #  for res in result:
-    #    if ' ' in res.get('actual', ''):
-    #      res['actual'] = res['actual'].replace(' ', '')
-    ####
-    # print('norm form:')
-    # for i in ret:
-    #     print('\t'+i)
-    # return ['lágyszárúak', 'lágyszárúak']
+    inp = ''.join(self.usrtoks)
+    for exception in self.lagyszaru_exceptions:
+        if exception in inp:
+            return [exception.encode('utf-8') for x in range(2)]
     ############################
     return ret
 




More information about the Hejes-devel mailing list