The insensitive hash table

So we needed analyze a case-sensitive text. We decided to store hold each word in a hashtable. That is simple enough.

Name Value
The 2
ice 1
over 1
flew 1
little 1
fox 1

But what the.. We needed it case-sensitive but the hashtable thought The and the was the same.. So what now. By using changing @{} to the full form New-Object System.Collections.Hashtable we switch it to the case-sensitive form. Lets try again.

Name Value
the 1
fox 1
ice 1
The 1
flew 1
little 1
over 1

Comments

  1. Johan O says:

    Uhm.. why is both “The” in the second list with a large T and still identified as different

    • virot says:

      I made an error, there were only one The in the input sentence. I managed to give the first the a large T.

Leave a Reply