The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
In N-Grams How to export to xls only 2, 3, 4 N-Grams Results
jmphillips
Member Posts: 18 Contributor II
Hello community: can you help me with this problem...... I want see in the end of the process in excel for example, only 2-Grams, or 3-Grams results.
Thanks a lot !
Regards.
Thanks a lot !
Regards.
Tagged:
0
Best Answer
-
kayman Member Posts: 662 UnicornUse filter tokens.
The logic of n-grams is that it adds underscores, so if you have 1 underscore you know it's a bigram, 2 is a trigram and so on.
So a regex as below would filter out bigrams, but you can extend to add additional grams.
^[^_]+_[^_]+$
Read as : start at beginning of word, take everything except an underscore, an underscore, and again everything except an underscore until the end of the word. So whatever matches must be a bigram.5
Answers
Regards