Jaume Ortolà i Font <[email protected]> čálii: > Hi, > > I need to match a Spanish contraction ("del" or "al") in Constraint Grammar, > but I am unable to do it. > > The contraction is: > ^del/de<pr>+el<det><def><m><sg>$ > > The only think that seems to be visible in the Constraint Grammar syntax is > the second element of the > contraction: > el<det><def><m><sg> > > It matches ("el") or (det def m sg), but not ("de"), ("del") or (pr). > > Does anybody know how to match the first element of the contraction (the > preposition)?
Yes, with subreadings. See all of chapter 18 of the manual: https://visl.sdu.dk/cg3/chunked/subreadings.html E.g. if the lexical unit at position 0 is ^del/de<pr>+el<det><def><m><sg>$, then all of these context conditions should match: (0/1 ("de")) (0/-1 ("de")) (0/0 ("el")) (0 ("el")) (0/* ("el")) (0/* ("de")) > This could be solved differently. I think these contractions should be > tokenized earlier in the pipeline as two > tokens. This way we would avoid a lot of exceptions and workarounds when > dealing with them. Is it feasible? > These contractions are extremely frequent and now they cause a lot of > undesired results. Yeah, you could split them early too. If "del" isn't ambiguous then you don't really gain much by keeping it as one lexical unit.
signature.asc
Description: PGP signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Apertium-stuff mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/apertium-stuff
