So i have a text file (tagged.txt
) full of different sentences. What I am looking to do is read this text file into Java, and extract specific words from this file.
e.g
Sentence : I went to the shop to buy a new pair of trainers
If the sentence has the words shop
, buy
, or trainers
in it, I would like that sentence to equal an opinion.
I have created a list of the words in a text file (words.txt
), in which I would like to stream against the tagged.txt
file.
I just wanted to know if there is a way of implementing this in Java.