Java String Tokenize isToken(String sentence, String searchWord)

Here you can find the source of isToken(String sentence, String searchWord)

Description

is Token

License

Apache License

Declaration

public static boolean isToken(String sentence, String searchWord) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {
    public static boolean isToken(String sentence, String searchWord) {
        StringTokenizer sentenceToken = new StringTokenizer(sentence, " .;:");

        while (sentenceToken.hasMoreTokens()) {
            if (sentenceToken.nextToken().equals(searchWord))
                return true;
        }//ww w  . ja va 2  s.  co m

        return false;
    }
}

Related

  1. getTokenTypes(CommonTree tree)
  2. getUnitType(String typeToken)
  3. hasSuffix(String _token)
  4. isPOSTag(String token)
  5. isStringFunction(String token)
  6. maxTokenLength(String s)
  7. parseNMTokens(String nmTokens)
  8. parseString(String in, String token)
  9. readTokens(String line)