Skip to content

foreign spelling in uppercase #38

Closed Answered by polm
eadmaster asked this question in Q&A
Oct 29, 2023 · 3 comments · 7 replies
Discussion options

You must be logged in to vote
import cutlet

katsu = cutlet.Cutlet()

text = "カツカレーを食べた"

tokens = katsu.romaji_tokens(katsu.tagger(text))

def upper_foreign(tok):
    if tok.foreign:
        return tok.surface.upper()
    else:
        return tok.surface

res = [upper_foreign(tok) for tok in tokens]
print(*res)

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@polm
Comment options

@eadmaster
Comment options

@polm
Comment options

Answer selected by eadmaster
@eadmaster
Comment options

@polm
Comment options

@eadmaster
Comment options

Comment options

You must be logged in to vote
1 reply
@polm
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants