[Hejes-devel] [713] helyesiras_test: enabled humor vs hunspell comparison
hejes-devel at nytud.hu
hejes-devel at nytud.hu
Tue May 7 16:40:55 CEST 2013
Revision: 713
Author: mihaltz
Date: 2013-05-07 16:40:55 +0200 (Tue, 07 May 2013)
Log Message:
-----------
helyesiras_test: enabled humor vs hunspell comparison
Modified Paths:
--------------
trunk/web2py/applications/helyesiras_test/controllers/default.py
trunk/web2py/applications/helyesiras_test/views/default/spell_test.html
Modified: trunk/web2py/applications/helyesiras_test/controllers/default.py
===================================================================
--- trunk/web2py/applications/helyesiras_test/controllers/default.py 2013-05-06 22:29:45 UTC (rev 712)
+++ trunk/web2py/applications/helyesiras_test/controllers/default.py 2013-05-07 14:40:55 UTC (rev 713)
@@ -68,8 +68,8 @@
_class='userform questionform spellform')
if form.accepts(request,session):
toks = form.vars.word.split(' ')
- res1 = [] # spell.call_humor_spellchecker_cmdline_ntok(toks)
- res2 = [] # spell.call_hunspell_cmdline_ntok(toks)
+ res1 = spell.call_humor_spellchecker_cmdline_ntok(toks)
+ res2 = spell.call_hunspell_cmdline_ntok(toks)
res_u = spell.union_humor_hunspell([unicode(x, 'utf8') for x in toks]) # Convert to unicode before passing it on to spell.py
return dict(form=form, res_union=res_u, res_humor=res1, res_hunspell=res2, toks=toks)
return dict(form=form, res_union=[], res_humor=[], res_hunspell=[], toks=[])
Modified: trunk/web2py/applications/helyesiras_test/views/default/spell_test.html
===================================================================
--- trunk/web2py/applications/helyesiras_test/views/default/spell_test.html 2013-05-06 22:29:45 UTC (rev 712)
+++ trunk/web2py/applications/helyesiras_test/views/default/spell_test.html 2013-05-07 14:40:55 UTC (rev 713)
@@ -17,7 +17,7 @@
{{else:}}
<ul>
-{{for t, s in zip(toks, res_union):}}
+{{for t, s, hu, hs in zip(toks, res_union, res_humor, res_hunspell):}}
<li>"{{=t}}":
{{
if s[0]:
@@ -30,6 +30,30 @@
pass
}}
</li>
+Humor:
+{{
+if hu[0]:
+ }} {{ ="Ok" }} {{
+else:
+ }} {{ ="Ismeretlen" }}{{
+ if hu[1] != []:
+ =", javaslatok: " }} <i> {{=', '.join(hu[1])}} </i> {{
+ pass
+pass
+}}
+<br/>
+Hunspell:
+{{
+if hs[0]:
+ }} {{ ="Ok" }} {{
+else:
+ }} {{ ="Ismeretlen" }}{{
+ if hs[1] != []:
+ =", javaslatok: " }} <i> {{=', '.join(hs[1])}} </i> {{
+ pass
+pass
+}}
+<br/>
{{pass}}
</ul>
More information about the Hejes-devel
mailing list