Good evening guys, I need help. I am doing preprocessing of text and for this I need to remove from a book in .txt format all stopwords
found in a text file also "stopwords_br.txt". I found a program I think that's a bit like what I'm looking for. However this is in C ++ and I do not understand the commands.
Help me if possible. Thank you.
string line, deleteline;
ifstream stopword;
stopword.open("example.txt");
if (stopword.is_open())
{
while ( getline (stopword,line) )
{
cout << line << endl;
}
stopword.close();
}
else cout << "Unable to open file";
ofstream temp;
temp.open("temp.txt");
cout << "Please input the stop-word you want to delete..\n ";
cin >> deleteline;
while (getline(stopword,line))
{
if (line != deleteline)
{
temp << line << endl;
}
}
temp.close();
stopword.close();
remove("example.txt");
rename("temp.txt","example.txt");
cout <<endl<<endl<<endl;
system("pause");
return 0;