Java: how to check if character belongs to a specific unicode block?

前端 未结 5 375
故里飘歌
故里飘歌 2021-01-04 02:43

I need to identify what natural language my input belongs to. The goal is to distinguish between Arabic and English words in a mixed input, where the inpu

5条回答
  •  臣服心动
    2021-01-04 03:25

    You have the opposite problem to this one, but ironically what doesn't work for him it just should work great for you. It is to just look for words in English (only ASCII compatible chars) with reg-exp "\w".

提交回复
热议问题