Hello!
I am facing a problem over and would like to ask if anyone knows the solution.
On the following code i am looping files for sentences and then words. If a specific word is found i would like to store a String with the specific phrase.
In example word[x-3] until word[x+3]
any Suggestions ?
Thanks in advance.
public void ScanSearch() {
for (int i = 0; i < files.length; i++) {
try {
BufferedReader fileIn = new BufferedReader(new FileReader(files[i][1]));
int lineCount =1;
String line = fileIn.readLine();
while(line != null){
String[] lineWords = line.split(" ");
for (int j=0; j<lineWords.length; j++){
System.out.println(searchType);
System.out.println(lineWords[j]);
if (lineWords[j] == inputArr[0]){
System.out.println("bingo");
}
}
lineCount++;
line = fileIn.readLine();
}
} catch (Exception e) {
e.printStackTrace();
}
}