voikko / corevoikko

Libvoikko and essential linguistic resources
Other
89 stars 25 forks source link

Bug in vvfst/generate_lex.py (report in Finnish) #29

Closed ahomansikka closed 7 years ago

ahomansikka commented 7 years ago

$ make vvfst-sukija python3 vvfst/generate_lex.py --style=dialect,foreign,foreignloan,inappropriate,incorrect,international,old --min-frequency=10 --extra-usage=education,human,it,medicine,nature,orgname,science --sukija --destdir=vvfst ######################################Traceback (most recent call last): File "vvfst/generate_lex.py", line 432, in handle_word, True) File "(sensuroitu)/corevoikko/tools/pylib/voikkoutils.py", line 213, in process_wordlist word_handler(word.documentElement) File "vvfst/generate_lex.py", line 366, in handle_word sys.stderr.write(errorstr.encode("UTF-8")) TypeError: write() argument must be str, not bytes Makefile:98: recipe for target 'vvfst/joukahainen.lexc.stamp' failed make: *** [vvfst/joukahainen.lexc.stamp] Error 1

Virhe tuli sen jälkeen, kun lisäsin Joukahaiseen sanan aallota, jonka taivutusluokaksi panin katketa-av2. Varsinainen virhe

TypeError: write() argument must be str, not bytes

ei johdu siitä, että generate_lex.py ei osaa tehdä taivutusluokkaa, vaan jostain muusta.

Jos rivin 366 yläpuolelle lisää rivin

print(errorstr)

se tulostaa

ERROR: VFST class not found for (aallota, katketa-av2)

ahomansikka commented 7 years ago

Ongelma ratkeaa, kun korvaa tiedoston "vvfst/generate_lex.py" rivin 366

sys.stderr.write(errorstr.encode("UTF-8"))

rivillä

sys.stderr.write(errorstr)

Tämä diffi tekee puuttuvan taivutuskaavan.

diff --git a/voikko-fi/common/hfconv.py b/voikko-fi/common/hfconv.py index 863ea97..6d85b6c 100644 --- a/voikko-fi/common/hfconv.py +++ b/voikko-fi/common/hfconv.py @@ -468,7 +468,8 @@ modern_classmap = [('valo', 'sw', [(None,'(.)','valo'), ('d','(.)detA','todeta'), ('j>k','(.)jetA','lohjeta'), ('>k','(.)OtA','saota'),

+LEXICON Aallota +l:l Katketaw ; +t:t Katketas ; + LEXICON Katketaw Tositapa4Tt ; t:t Käskytapa_ ;

ahomansikka commented 7 years ago

Tein korjaukset itse. (-: