odict icon indicating copy to clipboard operation
odict copied to clipboard

[v2] Compiling freedict xml from dictionaries repo fails

Open htimur opened this issue 1 year ago • 1 comments

Hi there, great initiative!

I was playing around with the new V2 CLI and I'm getting an error when I tried to convert the XML files generated by https://github.com/TheOpenDictionary/dictionaries.

As I understood the new V2 is not bc with the old format, but I'm failing to make it work even with intermediate ODXML files.

The error I'm getting executing cli compile -o ./odict/test.odict ./freedict/eng-deu.xml:

An error occurred parsing your XML: 

unknown variant ``, expected one of `adj_pn`, `adj_kari`, `art`, `adj_ku`, `adj_nari`, `adj_na`, `adj_shiku`, `adj_t`, `adj_ix`, `n_adv`, `adv_to`, `adj_no`, `n_pref`, `n_suf`, `n_t`, `adj_f`, `v5b`, `v5g`, `v5k`, `v5m`, `v5n`, `v5r`, `v5r_i`, `v5aru`, `v5k_s`, `v5s`, `v5t`, `v5u`, `v5uru`, `v5u_s`, `v1`, `v1_s`, `vz`, `vk`, `v2b_s`, `v2b_k`, `v2d_s`, `v2d_k`, `v2g_s`, `v2g_k`, `v2h_s`, `v2h_k`, `v2k_s`, `v2k_k`, `v2m_s`, `v2m_k`, `v2n_s`, `v2r_s`, `v2r_k`, `v2s_s`, `v2t_s`, `v2t_k`, `v2a_s`, `v2w_s`, `v2y_s`, `v2y_k`, `v2z_s`, `vn`, `vr`, `vs_c`, `vs`, `vs_i`, `vs_s`, `v_unspec`, `v4b`, `v4g`, `v4h`, `v4k`, `v4m`, `v4n`, `v4r`, `v4s`, `v4t`, `abv`, `adf`, `adj`, `phr_adj`, `adv`, `phr_adv`, `aff`, `aux`, `aux_adj`, `aux_v`, `chr`, `cf`, `cls`, `conj`, `conj_c`, `cop`, `ctr`, `det`, `expr`, `inf`, `intf`, `intj`, `vi`, `name`, `n`, `num`, `part`, `phr`, `postp`, `pref`, `prep`, `phr_prep`, `pron`, `propn`, `prov`, `punc`, `conj_s`, `suff`, `sym`, `vt`, `un`, `v`

Would appreciate if you can point me to what is wrong.

htimur avatar May 03 '24 09:05 htimur

Hey @htimur! Good catch – the V2 CLI has stricter matching against part-of-speech tag. It looks like in this case the pos field is being set to an empty string, when really it should just be omitted. Under V2, the compiler will error if "pos" is specified but an invalid value, whereas I believe V1 would have just ignored the field.

Looks like we'll have to tweak the converter. I still have to go through and update the converters to be compliant with V2 as part of the new release :)

Nickersoft avatar May 06 '24 21:05 Nickersoft