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

Count specific 2 words in many documents

PiciaPicia Member Posts: 11 Contributor II
I would like to ask for help with the following problem. I have a lot of txt documents and I need to count the number of occurences of specific words in these documents. That is, in every document how many times there is word1 and word2. For instance document1: word1 = 2 times, word2 = 7 times. I am capable of counting one word, but I need two.
I tokenize words, transform cases, filter tokens - and "filter tokens" operator seems to accept only one string.

Answers

  • kaymankayman Member Posts: 662 Unicorn
    You can use the wordlist to data operator for this. Once you have tokenized all your words in the process documents operator the 'wor' output gives you what you need, the exact count of all tokens (words) you have. The wordlist to data converts this list into an exampleset and then you use a filter to get your exact 2 words, with the count of them.
Sign In or Register to comment.