rime / librime

Rime Input Method Engine, the core library
https://rime.im
BSD 3-Clause "New" or "Revised" License
3.39k stars 556 forks source link

table.cc sometimes failed when dict.yaml contains only one row #399

Open sih4sing5hong5 opened 4 years ago

sih4sing5hong5 commented 4 years ago

If *.dict.yaml contains only one row, table.cc sometimes failed in some conditions.

Case A - Worked

It rewrote from luna_pinyin.dict.yaml, removed other rows. This configure worked with default luna_pinyin.schema.yaml.

---
name: luna_pinyin
version: "2014.06.13"
sort: by_weight
use_preset_vocabulary: false
...

ㄖ   ri

Case B - Failed

Repeated a charactor from Case A. This configure failed with default luna_pinyin.schema.yaml.

---
name: luna_pinyin
version: "2014.06.13"
sort: by_weight
use_preset_vocabulary: false
...

ㄖㄖ  ri

Log

      E0903 08:52:15.268484     6 table.cc:316] invalid metadata.
      E0903 08:52:15.268558     6 dictionary.cc:263] Error loading table for dictionary 'luna_pinyin'.

Trace

I traced Table::Load() and Table::Save() in table.cc. But I have no idea about how does table.cc save and load the prism file. Can you give some clues? Thank you.

sih4sing5hong5 commented 4 years ago

I tried with the deb version of ubuntu18.04. I will try again with newest librime next week.