CollinsHeadFinder extends HeadFinderBase { public static CollinsHeadFinder getInstance() { if (instance == null) instance = new CollinsHeadFinder(); return instance; } CollinsHeadFinder(); static CollinsHeadFinder getInstance(); @Override List<Pair<HeadSearchDirection, String[]>> getNonterminalHeadInformation(
            String nonTerminal); static CollinsHeadFinder instance; }
@Test public void testGetHeadword() throws Exception { TreeView view = (TreeView) ta.getView(ViewNames.PARSE_GOLD); CollinsHeadFinder headFinder = CollinsHeadFinder.getInstance(); Constituent headWord = headFinder.getHeadWord(view.getRootConstituent(0)); assertEquals("are", headWord.getTokenizedSurfaceForm()); Constituent parsePhrase = view.getParsePhrase(new Constituent("", "", ta, 0, 8)); headWord = headFinder.getHeadWord(parsePhrase); assertEquals("Asia", headWord.getTokenizedSurfaceForm()); }