Skip to content

Implement half-width katakana support#20

Closed
exoego wants to merge 5 commits into
PSeitz:masterfrom
exoego:half-width-katakana
Closed

Implement half-width katakana support#20
exoego wants to merge 5 commits into
PSeitz:masterfrom
exoego:half-width-katakana

Conversation

@exoego

@exoego exoego commented Mar 28, 2025

Copy link
Copy Markdown
Contributor

Closes #19

  • 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.

@exoego

exoego commented Jun 13, 2025

Copy link
Copy Markdown
Contributor Author

@PSeitz Can you take a look 🙇

Comment thread src/utils/katakana_to_hiragana.rs Outdated
} else if is_char_halfwidth_katakana(input_char) {
let result = HALFWIDTH_KATAKANA_TO_HIRAGANA_NODE_TREE.get(&chars[index..]);
result.0.chars().for_each(|char| hira.push(char));
previous_read_forward_count += result.1 - 1;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I don't get this part I don't think it should have a dependency on the outer loop

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Deleted in b92e381
I no longer remember why I added this...

@exoego exoego closed this by deleting the head repository Aug 13, 2025
@PSeitz

PSeitz commented Aug 13, 2025

Copy link
Copy Markdown
Owner

@exoego Was deleting the heap repo on purpose?

@exoego

exoego commented Aug 13, 2025

Copy link
Copy Markdown
Contributor Author

Reopend #21 since I deleted the head repo accidentally

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