static L ai_parser1(S input, S category) { L tokInput = javaTokWithAngleBracketsC(input); new L results; // TODO // Collection literalExamples = combinedMechSetsCI(ai_mechListNamesForAngleBracketCategory(p)); Collection patterns = combinedMechSetsCI(ai_mechPatternListNamesForAngleBracketCategory(category)); // Try matching pattern & input word-by-word for (S pat : patterns) ai_matchAngleBracketPattern_toParseResults(javaTokWithAngleBracketsC_addNumbers(pat), tokInput, results); // Try expanding patterns for (S pat : patterns) ai_matchAngleBracketPattern_spread_toParseResults(javaTokWithAngleBracketsC_addNumbers(pat), tokInput, results); // Go through sorted results, try to solve assumptions using subsolve for (ParseResult1 p : parseResultsByNumberOfAssumptions(results)) { new L verified; for (PairS assumption : p.assumptions) { S cat = assumption.a, phrase = assumption.b; if (eq(cat, "")) for (S pat : mL("Noun phrase patterns")) { LPairS match = ai_matchAngleBracketPattern(javaTokWithAngleBracketsC_addNumbers(pat), javaTokWithAngleBracketsC(phrase)); if (match != null && empty(match)) { //print("Verified: " + assumption); verified.add(assumption); } } } addIfNotNull(results, parseResultWithVerifiedAssumptions(p, verified)); } ret parseResults_setCategory(category, takeFirst(10, parseResultsByNumberOfAssumptions(results))); }