Extract unmatching units - Python

67 views
Skip to first unread message

Sarah SI AHMED HADDI

unread,
May 6, 2021, 6:18:38 AM5/6/21
to Unitex-GramLab
Bonjour la communauté Unitex,

Savez-vous s'il existe une fonction python qui permet d'extraire les unmatching après l'application d'une grammaire ?

Merci par avance et bien cordialement,
---
Sarah SI AHMED HADDI

eric.laporte

unread,
May 6, 2021, 11:21:24 AM5/6/21
to Unitex-GramLab
Do you match units in a text or in a list ?
Eric

Sarah SI AHMED HADDI

unread,
May 6, 2021, 11:22:25 AM5/6/21
to Unitex-GramLab

in a text ! 

eric.laporte

unread,
May 6, 2021, 11:24:00 AM5/6/21
to Unitex-GramLab
So, when you search a text for a query (which can match words or sequences of words), how do you define an unmatching unit?
Eric

Sarah SI AHMED HADDI

unread,
May 6, 2021, 11:33:39 AM5/6/21
to Unitex-GramLab
Capture d’écran 2021-05-06 à 17.25.28.png
When we make a locate pattern, there is a possibility to record all the occurrences of the text which are not recognized by this grammar.

eric.laporte

unread,
May 6, 2021, 11:42:28 AM5/6/21
to Unitex-GramLab
Ah OK.  In fact,  not really: this button is a misnomer. It copies into a file all the sentences of the text that don't contain sequences recognized by the grammar. So your problem is to invoke this function from a python script?
Eric

Sarah SI AHMED HADDI

unread,
May 6, 2021, 11:45:30 AM5/6/21
to Unitex-GramLab
Yes, i want to have these sentences to improve my grammar

eric.laporte

unread,
May 7, 2021, 5:52:34 AM5/7/21
to Unitex-GramLab
Sarah,
You can write a python script where you use the subprocess module to call the Extract function of Unitex (manual, Section 14.17).
Reply all
Reply to author
Forward
0 new messages