Skip to content

Instantly share code, notes, and snippets.

@ji6czd
Created April 10, 2025 13:58
Show Gist options
  • Save ji6czd/f67eaea154dd056c4ad23468764b5902 to your computer and use it in GitHub Desktop.
Save ji6czd/f67eaea154dd056c4ad23468764b5902 to your computer and use it in GitHub Desktop.
Momo test sample.
import sys
from momoPy import segment_braille_rule, convert_to_kana, to_jp_braille
def run(source: str):
segmented_string = segment_braille_rule(source)
braille_string = to_jp_braille(convert_to_kana(source))
print(f"O: {source}")
print(f"S: {segmented_string}")
print(f"B: {braille_string}")
def main():
for line in sys.stdin:
line = line.strip()
if not line:
continue
run(line)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment