drime

French rhyme dictionary with web and CLI interface
git clone https://a3nm.net/git/drime/
Log | Files | Refs | README

commit 2708c23009a6928a655ec724566ddd70a4358e98
parent a97b9699b51e36934f5fb4f497dab7bb10bbbd59
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sat, 26 Oct 2013 12:54:46 +0200

selectively disable do_extends

Diffstat:
lexique2sql.py | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lexique2sql.py b/lexique2sql.py @@ -123,7 +123,7 @@ class Word: + ', '.join([sql_field(f) for f in sql_fields]) + ');') - def __init__(self, word, phon, base, kind, freq): + def __init__(self, word, phon, base, kind, freq, do_extends=True): self.word = word self.phon = phon # workarounds for lexique @@ -133,7 +133,10 @@ class Word: self.orig = [(kind, base)] self.freq = float(freq) self.nsyl = None - self.do_extends() + if do_extends: + # don't do this in the case where we are calling from lookup + # it's not needed and may cause encoding problems + self.do_extends() def align_sum(self, align): s = 0