Skip to content
Snippets Groups Projects
Commit 6d41ff00 authored by Adam Radziszewski's avatar Adam Radziszewski
Browse files

update noprep.ccl, WCCL rules for removing prepositions from NP chunks: handle...

update noprep.ccl, WCCL rules for removing prepositions from NP chunks: handle AgP and AdjP chunks as well
parent 1987150e
No related merge requests found
// generates "real" NP chunks by removing chunk-initial prepositions
// the new chunks are added as "cut_np"
// generates "real" NP, AdjP and AgP chunks by removing
// chunk-initial prepositions
// the new chunks are added as cut_np, cut_adjp and cut_agp
// the prepositions cut from np and adjp are marked as cut_prep
// to be used with wccl-rules
tag_rules(
rule("noprep",
rule("noprep_np",
and(
isannbeg(0, "chunk_np"),
not(in({prep}, class[0])),
rlook(0, end, $End,
isannend($End, "chunk_np")
),
or(
rlook(0, $End, $Hd, isannhead($Hd, "chunk_np")),
setvar($Hd, 0)
)
),
mark(0, $End, "cut_np")
mark(0, $End, $Hd, "cut_np")
);
rule("withprep",
rule("withprep_np",
and(
isannbeg(0, "chunk_np"),
in({prep}, class[0]),
rlook(0, end, $End,
isannend($End, "chunk_np")
),
or(
rlook(1, $End, $Hd, isannhead($Hd, "chunk_np")),
setvar($Hd, 1)
)
),
mark(1, $End, "cut_np")
mark(0, 0, "cut_prep"),
mark(1, $End, $Hd, "cut_np")
);
rule("noprep_adjp",
and(
isannbeg(0, "chunk_adjp"),
not(in({prep}, class[0])),
rlook(0, end, $End,
isannend($End, "chunk_adjp")
),
or(
rlook(0, $End, $Hd, isannhead($Hd, "chunk_adjp")),
setvar($Hd, 0)
)
),
mark(0, $End, $Hd, "cut_adjp")
);
rule("withprep_adjp",
and(
isannbeg(0, "chunk_adjp"),
in({prep}, class[0]),
rlook(0, end, $End,
isannend($End, "chunk_adjp")
),
or(
rlook(1, $End, $Hd, isannhead($Hd, "chunk_adjp")),
setvar($Hd, 1)
)
),
mark(0, 0, "cut_prep"),
mark(1, $End, $Hd, "cut_adjp")
);
rule("noprep_agp",
and(
isannbeg(0, "chunk_agp"),
not(in({prep}, class[0])),
rlook(0, end, $End,
isannend($End, "chunk_agp")
),
or(
rlook(0, $End, $Hd, isannhead($Hd, "chunk_agp")),
setvar($Hd, 0)
)
),
mark(0, $End, $Hd, "cut_agp")
);
rule("withprep_agp",
and(
isannbeg(0, "chunk_agp"),
in({prep}, class[0]),
rlook(0, end, $End,
isannend($End, "chunk_agp")
),
or(
rlook(1, $End, $Hd, isannhead($Hd, "chunk_agp")),
setvar($Hd, 1)
)
),
mark(1, $End, $Hd, "cut_agp")
)
)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment