commit 0dcc03f00e39e8b573b839df89b54df3d9fb8608
parent e6b424a2503b9d1e8ecbaa3bd0548ce462877208
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Sat, 26 Oct 2013 12:59:45 +0200
do not display the full pronunciation
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/query.py b/query.py
@@ -11,6 +11,8 @@ import frhyme
from lexique2sql import Word
PAGESIZE = 500
+# max number of phonemes to show when inferring
+LIMIT = 5
class BadValues(Exception):
pass
@@ -126,7 +128,7 @@ def do_query(word, phon, minsyll, maxsyll, elide, gender, classical, offset, siz
sure = False
s = word.split(' ')[-3:]
prons = [frhyme.lookup(escape(w))[0][1] for w in s]
- phon = ''.join(prons)
+ phon = ''.join(prons)[-LIMIT:]
# now, create a dummy entry for what was provided
w = Word(word.encode('utf-8'), phon.encode('utf-8'), '', '', '1',
do_extends=False)