link-grammar icon indicating copy to clipboard operation
link-grammar copied to clipboard

Using idiom-like construct for collocation with holes (and maybe more)

Open ampli opened this issue 7 years ago • 0 comments

In issue #743 I said:

extending idiom definitions to allow <a>_<b>

and did not tell for what it may be good. Here is the story.

From README.md:

"holes" in collocations (aka "set phrases" of "phrasemes"):

The link-grammar provides several mechanisms to support circumpositions or even more complicated multi-word structures. One mechanism is by ordinary links; see the V, XJ and RJ links. The other mechanism is by means of post-processing rules. (For example, the "filler-it" SF rules use post-processing.) However, rules for many common forms have not yet been written. The general problem is of supporting structures that have "holes" in the middle, that require "lacing" to tie them together.

So I made this test:

-<CLAUSE>: {({@COd-} & (C- or <clause-conjoin>)) or ({@CO-} & (Wd- & {CC+})) or [Rn-]};
+<CLAUSE1>: {({@COd-} & (C- or <clause-conjoin>)) or ({@CO-} & (Wd- & {CC+})) or [Rn-]};
+<CLAUSE>: ((COL1C2- & COL1C3+) or {COL1C5-}) & <CLAUSE1>;

+%if_<CLAUSE>_then_<CLAUSE>: <CLAUSE>
+if.col1: (({Xd-} & Wd-) or (({Xd-} & MVs-) or {Xd-}) or QI-) & COL1C2+ & COL1C4+;
+then.col1: <CLAUSE> & COL1C3- &  COL1C4- & COL1C5+ & <CLAUSE>;

Since the current code doesn't support if_<CLAUSE>_then_<CLAUSE>: <CLAUSE> I just tried to mimic it manually. And it seem to work as expected.

ampli avatar Apr 26 '18 01:04 ampli