mvysny / aedict

Original Aedict 2 source codes
http://www.aedict.eu
GNU General Public License v3.0
40 stars 7 forks source link

Crash on search #962

Closed rbleuse closed 2 years ago

rbleuse commented 2 years ago

Hi Martin,

I got a crash every time I type でんえん (french dictionary).

It appears when I type the last n from dennen

mvysny commented 2 years ago

Uh-oh, there are two issues here:

mvysny commented 2 years ago

@rbleuse just to be extra-sure: it's illegal to even attempt to deinflect でんえ to e.g. denu or something, right? :)

rbleuse commented 2 years ago

I didn't analyze much, but for example the only verb that ends with nu is shinu, which gives shine for the imperative form, so I think that the deinflection engine is right. I don't know if the process is same for でんえ and でね though Indeed, only でね should be deinflected into でぬ, not でんえ.

The second problem is that the engine translates えんえ into exnu, and that extra x makes that the deinflection is not found :

val result = EnumSet.noneOf(InflectableWordClass::class.java)
for (deinflection in verb[deinflected]) {
    for (def in deinflection.deinflected.filter { it.key == deinflected }.values) {
        result.addAll(def)
    }
}

The filter can't find exnu whereas the deinflected tree contains enu

mvysny commented 2 years ago

Yup, the x thing was caused the deinflection not to be found. I've fixed this in https://gitlab.com/mvysny/jputils/-/commit/54820e9759c69fc56f230df4a4978e2c587a0aa3 ; I'll close this ticket once new jputils has been released & integrated into aedict.

mvysny commented 2 years ago

Fixed in Aedict 3.50.22