Skip to content

Conversation

exoego
Copy link
Contributor

@exoego exoego commented Aug 13, 2025

Closes #19
(recreation of #20 due to accidental repo cleanup)

  • Adds utils/halfwidth_katakana_to_hiragana.
    • Counterintuitively, this is not "half to full" conversion. Because, ..._to_hiragana util can be leveraged in to_hiragana's character loops so the input is not enumerated multiple times.
  • In to_katakana and to_romaji, the util is invoked only when input contains half-width kana,
    • The input may be fully enumerated at worst case when no half-width katakana is used.
  • to_haflwidth_katakana or new option is NOT added, since I don't need such.

hira.push(hira_char);
previous_kana = Some(hira_char);
} else if is_char_halfwidth_katakana(input_char) {
let result = HALFWIDTH_KATAKANA_TO_HIRAGANA_NODE_TREE.get(&chars[index..]);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer a pos variable that gets incremented instead of the previous_read_forward_count.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean this?
fbbf388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: hankaku-kana (half-width kana) support
2 participants