search with negative context

88 views
Skip to first unread message

Charles Mizzi

unread,
Nov 14, 2017, 3:40:33 AM11/14/17
to Unitex-GramLab
Hello,

Is it possible to get a word only if it is not preceded by a list of words ?

A very simple example :

"M. Jean Martin habite rue Jean Cocteau à Paris"

I want to get "Jean" only if it is not preceded by "rue", "chemin", " boulevard" ...

I tried with negative right context :  |>-- ![RUE+CHEMIN+BOULEVARD]-- JEAN -- 0
but it failed ...

Thanks for your help !

Cristian Martinez

unread,
Nov 14, 2017, 8:32:20 AM11/14/17
to Unitex-GramLab
Hi Charles,

What about this:



Regards,
Auto Generated Inline Image 1

eric.laporte

unread,
Nov 14, 2017, 3:09:58 PM11/14/17
to unitex-...@googlegroups.com
Hi Charles,
The <TOKEN> box in Cristian's graph is required. In your graph, when the parser gets out of the negative right context, it rewinds to the position in the text just before the word which is neither rue, chemin or boulevard. You have to move the parser forward so that it reaches the word you want to match. See Section 6.3.1 in the user's manual and Figures 6.15 and 6.16.
Best regards,
Eric

Charles Mizzi

unread,
Nov 17, 2017, 2:15:59 AM11/17/17
to Unitex-GramLab
Thanks Cristian & Eric !


JB Favre

unread,
Nov 8, 2018, 9:41:42 AM11/8/18
to Unitex-GramLab
Hello, it it possible to put more than one box in the negative context ? For instance, I'd like to match "satisfaction" alone, but not "questionnaire de satisfaction". It works my I put only "de" in the negative context, but not when I put <questionnaire> de (it matches satisfaction whereas it shouldn't). 
Thanks !
 
 
 
 
 
exempleunitex.png

eric.laporte

unread,
Nov 8, 2018, 10:47:18 AM11/8/18
to Unitex-GramLab
Hi JB,
The boxes with the green "![" are a negative right context, not a negative left context. There is nothing for negative left contexts in Unitex currently. You can certainly manage another way, maybe with CasSys.
Good luck,
Eric


Reply all
Reply to author
Forward
0 new messages