TreebankFormatParser { public static int movePastWhiteSpaceChars(String text, int textOffset) { Matcher matcher = nonwhiteSpaceCharPattern.matcher(text); if (matcher.find(textOffset)) { return matcher.start(); } return textOffset; }  static TreebankNode getLeafNode(String parseFragment); static String getType(String parseFragment); static String prepareString(String parse); static String inferPlainText(String treebankText); static TopTreebankNode parse(String parse); static TopTreebankNode parse(String parse, String text, int textOffset); static int movePastWhiteSpaceChars(String text, int textOffset); static String[] splitSentences(String mrgContents); static boolean parensMatch(String contents); static List<TopTreebankNode> parseDocument(String parse, int textOffset, String text); static final String LEAF_NODE_REGEX; static final String TYPE_REGEX; static final String cleanUPRegex1; static final String cleanUPRegex2; static final String cleanUPRegex3; static final String cleanUPRegex4; }
@Test public void testMovePastWhiteSpaceChars() { assertEquals(0, TreebankFormatParser.movePastWhiteSpaceChars("asdf", 0)); assertEquals(1, TreebankFormatParser.movePastWhiteSpaceChars(" asdf", 0)); assertEquals(5, TreebankFormatParser.movePastWhiteSpaceChars(" asdf", 0)); assertEquals(5, TreebankFormatParser.movePastWhiteSpaceChars(" \t\t\n\nasdf", 0)); assertEquals(5, TreebankFormatParser.movePastWhiteSpaceChars(" \t\t\n\nasdf", 2)); assertEquals(3, TreebankFormatParser.movePastWhiteSpaceChars(" \t\t+", 0)); assertEquals(5, TreebankFormatParser.movePastWhiteSpaceChars(" \t\t +-_+", 2)); }