Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- docContents = docContents.replaceAll("_", " ");
- String[] words = docContents.split("\\s+");
- ArrayList<String> tokens = new ArrayList<String>();
- for (int i = 0; i < words.length; i++) {
- words[i] = words[i].replaceAll("\\W", "");
- words[i] = words[i].replaceAll("\\d", "");
- if (words[i].length() > 0) {
- tokens.add(words[i]);
- }
- }
- return tokens;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement