!752 concepts. concept Imperative { new Ref v; // verb new Ref o; // object sS _fieldOrder = "v o"; } concept Measurement { new Ref x; // e.g. "all" new Ref y; // e.g. "programs" } concept Addition { new Ref x; // e.g. "programs" new Ref prep; // preposition, e.g. "with" new Ref z; // e.g. "a large number of files" sS _fieldOrder = "x prep z"; } p { testParse([[Find all programs with a file called "concepts.structure"]]); } sbool properSentence(Concept c) { if (!c << Imperative || neq(c/Imperative.v, cstr("find"))) false; c = c/Imperative.o!; ret matchCstr("all programs with a file called *", c); //if (!c << Measurement || neq(c/Measurement.x, cstr("all"))) false; //c = c/Measurement.y; } !include #1005497 // testParse + parseToOptions using unrollOptions static void parse(S s, Collector out) { new Matches m; if (flexMatchStartIC(ll("find"), s, m)) ret if out.add(cnew(Imperative, v := cstr($1), o := parseToOptions($2))); if (flexMatchStartIC(ll("all", "a"), s, m)) ret if out.add(cnew(Measurement, x := cstr($1), y := parseToOptions($2))); for (S prep : ll("called", "with")) if (flexMatchIC("* \*prep*/ *", s, m)) ret if out.add(cnew(Addition, x := parseToOptions($1), prep : = cstr(prep), z := parseToOptions($2))); out.add(cstr(s)); // default }