Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/157.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 删除停止字,然后应用大小写折叠(如何组合两个代码)_C++_Text - Fatal编程技术网

C++ 删除停止字,然后应用大小写折叠(如何组合两个代码)

C++ 删除停止字,然后应用大小写折叠(如何组合两个代码),c++,text,C++,Text,我有一个名为aisha的txt文件,其中包括 This is a new file I did it for mediu. Its about Removing stopwords fRom the file and apply casefolding to it I Tried doing that many Times and finally now I could do 我写了两个代码一个是删除一些停止词 #include <iostream> #include <st

我有一个名为aisha的txt文件,其中包括

This is a new file I did it for mediu.
Its about Removing stopwords fRom the file
and apply casefolding to it
I Tried doing that many Times
and finally now I could do
我写了两个代码一个是删除一些停止词

#include <iostream>
#include <string>
#include <fstream>

int main()
{
    using namespace std;

    ifstream file("aisha.txt");
    if(file.is_open())
    {
        string myArray[200];

        for(int i = 0; i < 200; ++i)
        {
            file >> myArray[i];

            if (myArray[i] !="is" && myArray[i]!="the" && myArray[i]!="that"&& myArray[i]!="it"&& myArray[i]!="to"){
            cout<< myArray[i]<<"  ";
            }



        } 

    }
system("PAUSE");
return 0;
}
#包括
#包括
#包括
int main()
{
使用名称空间std;
ifstream文件(“aisha.txt”);
if(file.is_open())
{
字符串myArray[200];
对于(int i=0;i<200;++i)
{
文件>>myArray[i];
如果(myArray[i]!=“is”&&myArray[i]!=“the”&&myArray[i]!=“that”&&myArray[i]!=“it”&&myArray[i]!=“to”){
cout>myArray[i];
if(myArray[i]=='i')

cout将文本处理器放在不同的函数中,并在
main
中逐个调用它们。不会出现名称和类型冲突

这是一个粗略的例子

void removeStopWords(ifstream file) {
    // put your code here for removing the stopwords
}

void applyCaseFolding(ifstream file) {
    // put your code here for applying case folding
}

int main() {
    ifstream file("aisha.txt");
    if(file.is_open()) {
         removeStopWords(file);
         applyCaseFolding(file);
    }

    return 0;
}

对不起,我可以问一下每个功能中包含哪些部分吗?
void removeStopWords(ifstream file) {
    // put your code here for removing the stopwords
}

void applyCaseFolding(ifstream file) {
    // put your code here for applying case folding
}

int main() {
    ifstream file("aisha.txt");
    if(file.is_open()) {
         removeStopWords(file);
         applyCaseFolding(file);
    }

    return 0;
}