User: editor -- 2011-01-17 << 698 700 >> |
Hits: 3566 |
Type: Count and statistics |
Search all Count and statistics examples |
Description: |
How to count the "is", "are", "am" as whole words in a text file? Word like "This" should not be counted as "is". |
Input Sample: |
I am here. Are we here? He is there. Where are you? This is a test. |
Output Sample: |
is: 2 are: 2 am: 1 |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
1. open "Tools->Pattern Counter" menu 2. set "source" to "File", and select file. 3. click "clear" button to clear all default pattern 4. click "Add",set "Name" to "is" set "Pattern" to , click "ok" 5. click "Add" again, set "Name" to "are", set "Pattern" to 6. click "Add" again, set "Name" to "am", set "Pattern" to 7. check "option" of "Ignore case" and "Regular exp" 8. click "Count", all words will be counted. Note: "Ingore case" option will count word like "Am" and "am" as well. \b is word boundary, \b(is)\b will NOT count "This" as "is". |
Screenshot 1: Pattern_Counter_Window |