Пример #1
0
int main(){



while(1)
{
char line [80];
interrupt(0x21,0,"SHELL>",0,0);
interrupt(0x21,1,line,0,0);
readIN(line);
}

}
Пример #2
0
void voxcardSystem::readDictionary(QMap<QString, voxCard>& map)
{

    QDir dir(QDir::currentPath() + "/meta/");
    if(!dir.exists()){
        dir.mkpath(dir.path());
    }
    else{
        QFile file(QDir::currentPath() + voxConst::dictFile + QString("%1").arg(learnLang));
        if(!file.open(QIODevice::ReadOnly)){
                return;
        }

        QDataStream readIN(&file);
        QString header;
        readIN >> header;

        if(header != voxConst::voxHeader){
            qDebug() << "header mismatch" << header << "!=" << voxConst::voxHeader;
            return;
        }
        int natL, learnL;
        readIN /*>> voxcardSystem::globalCnt*/ >> natL >> learnL;

        nativeLang = static_cast<voxConst::natLanguages>(natL);
        learnLang = static_cast<voxConst::languages>(learnL);


        while(!readIN.atEnd()){
        //for(int i = 0; i < voxcardSystem::globalCnt; i++){
            voxCard v;
            readIN >> v;
            map.insert(v.learnTerm, v);
        }
        file.close();
    }

}