Skip to content

parameterized macros #111

Description

@gertjanvannoord

Consider these macros which will find all words that can occur as the OBJ1 of the verb DRINKEN:

obj1_drinken_lexical = """
( @rel="obj1" and
@word and
../node[@rel="hd" and
@lemma="drinken"]
)"""

obj1_drinken_phrase = """
( @rel="hd" and
../@rel="obj1" and
../../node[@rel="hd" and
@lemma="drinken"]
)"""

obj1_drinken_lexical_nonlocal = """
( (@cat or @word) and
%i% = //node[@rel="obj1" and
../node[@rel="hd" and
@lemma="drinken"]]/%i%
)"""

obj1_drinken_phrase_nonlocal = """
( @rel="hd" and
../%i% = //node[@rel="obj1" and
../node[@rel="hd" and
@lemma="drinken"]]/%i%
)"""

obj1_drinken = """
( %obj1_drinken_lexical%
or %obj1_drinken_phrase%
or %obj1_drinken_lexical_nonlocal%
or %obj1_drinken_phrase_nonlocal%
)
"""

If we want to do the same thing for "eten", we need another page of macros. I want to
be able to say

%dependent("obj1","drinken")%

and then define

dependent(Rel,Head) = """
( dependent_lexical(%Rel%,%Head%)
or dependent_phrase(%Rel%,%Head%)
or ....

etc

"""

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions