code: private boolean isPosTokenMatched(AnalyzedToken token) {
      if (posToken == null || posToken.posTag == null) {
        // if no POS set defaulting to true
        return true;
      }
      if (token.getPOSTag() == null) {
        return posToken.posUnknown && token.hasNoTag();
      }
      boolean match;
      if (posToken.regExp) {
        Matcher mPos = posToken.posPattern.matcher(token.getPOSTag());
        match = mPos.matches();
      } else {
        match = posToken.posTag.equals(token.getPOSTag());
      }
      if (!match && posToken.posUnknown) { // ignore helper tags
        match = token.hasNoTag();
      }
      return match;
    }
docs: Tests if part of speech matches a given string.
  Special value UNKNOWN_TAG matches null POS tags.
  @param token Token to test.
  @return true if matches