Here you can find the source of isPOSTag(String token)
public static boolean isPOSTag(String token)
//package com.java2s; /**// w ww . j a v a 2s. co m * This software is released under the University of Illinois/Research and Academic Use License. See * the LICENSE file in the root folder for details. Copyright (c) 2016 * * Developed by: The Cognitive Computation Group University of Illinois at Urbana-Champaign * http://cogcomp.cs.illinois.edu/ */ import java.util.*; public class Main { private static Set<String> posTagSet; public static final List<String> allPOS = Arrays.asList("#", "$", "``", "''", ",", "-LRB-", "-RRB-", ".", ":", "CC", "CD", "DT", "EX", "FW", "IN", "JJ", "JJR", "JJS", "LS", "MD", "NN", "NNP", "NNPS", "NNS", "PDT", "POS", "PRP", "PRP$", "RB", "RBR", "RBS", "RP", "SYM", "TO", "UH", "VB", "VBD", "VBG", "VBN", "VBP", "VBZ", "WDT", "WP", "WP$", "WRB"); /** * Very simple way of testing whether something is a part of speech tag. Just look up a list of * allowed POS tags and see if the label is in it. */ public static boolean isPOSTag(String token) { if (posTagSet == null) { initializePOSTagSet(); } return posTagSet.contains(token); } private static void initializePOSTagSet() { posTagSet = new HashSet<>(); for (String str : allPOS) { posTagSet.add(str); } posTagSet.add("AUX"); } }