Created
July 28, 2015 02:27
-
-
Save ikegami-yukino/bee699d090eed7d5dade to your computer and use it in GitHub Desktop.
Japanese character matcher for Java8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final Pattern PAT_JAPANESE_CHARACTER = Pattern | |
.compile("[\\p{IsHiragana}\\p{IsKatakana}\\p{InCJKUnifiedIdeographs}]"); | |
private static boolean isJapanese(final String token) { | |
return PAT_JAPANESE_CHARACTER.matcher(token).find(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment