Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why just check the first character in word? #6

Open
xuehui1991 opened this issue Nov 2, 2016 · 1 comment
Open

why just check the first character in word? #6

xuehui1991 opened this issue Nov 2, 2016 · 1 comment

Comments

@xuehui1991
Copy link

Hey I just wonder that why just only check the first character in word in Tokenizer.java?

public boolean ifWords_Eng(String tmpWord)
{
if (tmpWord.charAt(0)>='A' && tmpWord.charAt(0)<='Z') return true;
if (tmpWord.charAt(0)>='a' && tmpWord.charAt(0)<='z') return true;
return false;
}

@sodawater
Copy link

sodawater commented Dec 8, 2016

Sorry for replying you so late.
It's a naive filter for non-word. You can check the all characters. But words like "U.S.A." might be filtered. Usually it won't affect the outcome...

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

No branches or pull requests

2 participants