Skip to content

Mistaken ruby generation by ttlig.py's from_furi #38

@passaglia

Description

@passaglia

ttlig.py's from_furi method fails on words that contain kanji, end with kana, and where the ending kana is same as the last kana of the preceding kanji.
e.g.:

可愛い (かわいい)
憎く (にくく)
低く (ひくく)

from speach import ttlig
ttlig.RubyToken.from_furi(surface='可愛い',kana='かわいい').to_code()
# it returns {可愛/かわ}い
# but the correct result should be {可愛/かわい}い

@larvata pointed this out downstream in a yomikata issue. I fixed this in yomikata by stripping surface and kana of trailing overlapping trailing characters before running them through the main logic, a pretty ugly hack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions