void TestSpansAdvanced::addDocuments( IndexWriter * writer )
{
    addDocument( writer, _T( "1" ), _T( "I think it should work." ));
    addDocument( writer, _T( "2" ), _T( "I think it should work." ));
    addDocument( writer, _T( "3" ), _T( "I think it should work." ));
    addDocument( writer, _T( "4" ), _T( "I think it should work." ));
}
void TestSpansAdvanced2::addDocuments( IndexWriter * writer )
{
    TestSpansAdvanced::addDocuments( writer );
    addDocument( writer, _T( "A" ), _T( "Should we, could we, would we?" ));
    addDocument( writer, _T( "B" ), _T( "It should.  Should it?" ));
    addDocument( writer, _T( "C" ), _T( "It shouldn't." ));
    addDocument( writer, _T( "D" ), _T( "Should we, should we, should we." ));
}
Exemple #3
0
/*!
 * \brief DocumentManager::createDocument
 */
void DocumentManager::createDocument()
{
	IDocument *d = new IDocument();
	d->setObjectName(QString("%1").arg(i++));
	addDocument(d);
	;
}
Exemple #4
0
void FrostEdit::openDocument(const QModelIndex& ind) {
	QString doc = mFileSystemModel->filePath(ind);
	if(!mFileSystemModel->isDir(ind)){
		addDocument(doc);
		addEditor(doc);
	}
}
Exemple #5
0
void FrostEdit::on_actionOpen_triggered() {
	QStringList list = QFileDialog::getOpenFileNames(this, "Open file", QDir::currentPath(), "FrostBasic Code Files (*.frb);;CoolBasic Code Files (*.cb);;All Files(*.*)");
	for(auto& i: list) {
		addDocument(i);
		addEditor(i);
	}
}
Exemple #6
0
void MainWindow::openDocument()
{
    QString fileName = QFileDialog::getOpenFileName(this);
    if (fileName.isEmpty())
        return;

    QFile file(fileName);
    if (!file.open(QIODevice::ReadOnly)) {
        QMessageBox::warning(this,
                            tr("File error"),
                            tr("Failed to open\n%1").arg(fileName));
        return;
    }
    QTextStream stream(&file);

    Document *doc = new Document();
    if (!doc->load(stream)) {
        QMessageBox::warning(this,
                            tr("Parse error"),
                            tr("Failed to parse\n%1").arg(fileName));
        delete doc;
        return;
    }

    doc->setFileName(fileName);
    addDocument(doc);
}
void CWizDocumentListView::addDocuments(const CWizMessageDataArray& arrayMessage)
{
    CWizMessageDataArray::const_iterator it;
    for (it = arrayMessage.begin(); it != arrayMessage.end(); it++) {
        addDocument(*it, false);
    }

    sortItems();
}
Exemple #8
0
void FrostEdit::dropEvent(QDropEvent* e)  {
	const QMimeData* data = e->mimeData();
	if(data != nullptr) {
		for(QUrl u: data->urls()) {
			QString i = u.path().mid(1);
			addDocument(i);
			addEditor(i);
		}
	}
}
Exemple #9
0
void CWizDocumentListView::addDocuments(const CWizDocumentDataArray& arrayDocument)
{
    CWizDocumentDataArray::const_iterator it;
    for (it = arrayDocument.begin(); it != arrayDocument.end(); it++) {
        addDocument(*it, false);
    }

    sortItems();

    //if (selectedItems().empty()) {
    //    setCurrentRow(0);
    //}
}
void DirectoryScannerPipe::addDocumentsInDirectory(
        string const & directory, Corpus * const corpus) const {
    for (fs::directory_iterator end, dir(directory);
            dir != end; ++dir) {
        string const location = (* dir).path().generic_string();
        if (fs::is_directory(*dir)) {
            if (isRecursive()) {
                addDocumentsInDirectory(location, corpus);
            }
        } else {
            addDocument(location, corpus);
        }
    }
}
void DocumentsDialog::onDocumentChangedExternally( Document *doc )
{
    int c = count();
    for (int i = 0; i < c; ++i)
    {
        Item *itm = item(i);
        if (itm->document() == doc) {
            itm->update();
            return;
        }
    }

    addDocument(doc);
}
Exemple #12
0
void Fichier::analyseLigne(string ligne,long nbHitsAnalyse,int heureAnalyse,string nomFichierDot)
{
    vector <string> tableauInfos = decoupeLigne(ligne);
    if (tableauInfos [POSITION_CODERETOUR] == CODEOK){
        
        if (optionsActives[TYPE_FICHIER_INUTILE] && optionsActives [VERIF_HORAIRE]){
            
            if( !inutiliteFichier( tableauInfos [POSITION_URLDOC]) && extraitDate( tableauInfos [POSITION_DATE]) == heureAnalyse  ){
                addDocument(tableauInfos);
                
            }
        }else if (optionsActives[TYPE_FICHIER_INUTILE]){
            if( !inutiliteFichier( tableauInfos [POSITION_URLDOC]) ){
                addDocument(tableauInfos);
                
            }
            
        }else if (optionsActives[VERIF_HORAIRE]){
            if( extraitDate( tableauInfos [POSITION_DATE]) == heureAnalyse  ){
                addDocument(tableauInfos);
                
                
            }
            
            
        }else {
            // ici on a pas d'option
            
            addDocument(tableauInfos);
            
        }
    }
    
    
    
    
} //----- Fin de M?thode
Exemple #13
0
int docengine::saveDocument(QsciScintillaqq *sci, QString fileName, bool copy)
{
    QTabWidgetqq* tabWidget = sci->tabWidget();
    QFile file(fileName);
    QFileInfo fi(file);
    bool retry = true;
    do {
        retry = false;
        removeDocument(sci->fileName());

        if(!write(&file,sci)) {
            // Manage error
            QMessageBox msgBox;
            msgBox.setWindowTitle(MainWindow::instance()->windowTitle());
            msgBox.setText(tr("Error trying to write to \"%1\"").arg(file.fileName()));
            msgBox.setDetailedText(file.errorString());
            msgBox.setStandardButtons(QMessageBox::Abort | QMessageBox::Retry);
            msgBox.setDefaultButton(QMessageBox::Retry);
            msgBox.setIcon(QMessageBox::Critical);
            int ret = msgBox.exec();
            if(ret == QMessageBox::Abort) {
                return MainWindow::saveFileResult_Canceled;
                break;
            } else if(ret == QMessageBox::Retry) {
                retry = true;
                continue;
            }
        }

    //Update the file name if necessary.
        if(!copy){
            if((fileName != "") && (sci->fileName() != fileName)) {
                removeDocument(sci->fileName());
                sci->setFileName(fileName);
                sci->autoSyntaxHighlight();
                tabWidget->setTabToolTip(sci->getTabIndex(), sci->fileName());
                tabWidget->setTabText(sci->getTabIndex(), fi.fileName());

            }
            sci->setModified(false);
        }
        addDocument(fileName);

        file.close();

    }while(retry);

    return MainWindow::saveFileResult_Saved;
}
Exemple #14
0
void CWizDocumentListView::addAndSelectDocument(const WIZDOCUMENTDATA& document)
{
    Q_ASSERT(acceptDocument(document));

    int index = documentIndexFromGUID(document.strGUID);
    if (-1 == index) {
        index = addDocument(document, false);
    }

    if (-1 == index)
        return;

    setCurrentItem(item(index), QItemSelectionModel::ClearAndSelect);
    sortItems();
}
Exemple #15
0
// private slot
void FilesWidget::updateLocationOfSender()
{
    Document *document = qobject_cast<Document *>(sender());

    Q_ASSERT(document != NULL);

    if (document == DocumentManager::current()) {
        DocumentManager::setCurrent(NULL);
    }

    removeDocument(document);
    addDocument(document);

    if (DocumentManager::current() == NULL) {
        DocumentManager::setCurrent(document);
    }
}
Exemple #16
0
void docengine::documentChanged(QString fileName)
{
    removeDocument(fileName);
    QTabWidgetqq *tabWidget = MainWindow::instance()->container->focusQTabWidgetqq();
    int x = isDocumentOpen(fileName);

    //Don't bother continuing if we can't find the document in one of the open tabs.... though this should never happen
    if(x == -1) {
        removeDocument(fileName);
        return;
    }

    QFile file(fileName);
    bool  fileExisted = file.exists();

    QMessageBox msgBox;
    msgBox.setWindowTitle(MainWindow::instance()->windowTitle());
    msgBox.setIcon(QMessageBox::Critical);
    if(fileExisted) {
        msgBox.setText(tr("The file \"%1\" has been changed outside of the editor.  Would you like to reload it?").arg(fileName));
    }else {
        msgBox.setText(tr("The file \"%1\" has been removed from the file system.  Would you like to save it now?").arg(fileName));
    }
    msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No | QMessageBox::Close);
    msgBox.setDefaultButton(QMessageBox::Yes);

    int ret = msgBox.exec();
    if(ret == QMessageBox::No) {
        return;
    }else if(ret == QMessageBox::Close) {

        if(x != -1) {
            MainWindow::instance()->kindlyTabClose(tabWidget->QSciScintillaqqAt(x));
        }
        return;
    }

    //If the file exists, we try to reload it, otherwise save it back to disk.
    if(fileExisted) {
        loadDocuments(QStringList(fileName),MainWindow::instance()->container->focusQTabWidgetqq(),true);
    }else {
        saveDocument(tabWidget->QSciScintillaqqAt(x),fileName);
    }
    addDocument(fileName);
}
Exemple #17
0
Document* MainWindow::openDoc(const QString& file)
{
    Document* doc = m_app->openDoc(file);
    if (doc) {
        if (setCurrentDoc(doc)) {
            statusBar()->showMessage(doc->name() + " already loaded", 2000);
            return doc;
        } else {
            Document* prevDoc = currentDoc();
            addDocument(doc);
            doc->view()->fitAll();
            statusBar()->showMessage(doc->name() + " loaded", 2000);

            if(prevDoc && !prevDoc->ocafDoc()->IsSaved() && !prevDoc->ocafDoc()->IsModified())
                closeDoc(prevDoc);
        }
    }
    return doc;
}
Exemple #18
0
void FrostEdit::addEditor(TabWidgetFrame* wid, const QString& str) {
	Document* doc = addDocument(str);

	if(doc == nullptr)
		return;

	int index = tabWidgetContains(wid->tabWidget(), doc);
	if(index >= 0) {
		wid->tabWidget()->setCurrentIndex(index);
		return;
	}

	TextEdit* edit = new TextEdit(wid->tabWidget(), doc);
	edit->setFindReplaceInstance(mFindReplace);
	edit->setFont(mFont);
	mSyntaxStyle.applyToTextEdit(edit);

	wid->tabWidget()->addTab(edit, doc->getDynamicName());
	wid->tabWidget()->setCurrentIndex(wid->tabWidget()->count()-1);

}
//==============================================================================
void MultiDocumentPanel::setLayoutMode (const LayoutMode newLayoutMode)
{
    if (mode != newLayoutMode)
    {
        mode = newLayoutMode;

        if (mode == FloatingWindows)
        {
            tabComponent = nullptr;
        }
        else
        {
            for (int i = getNumChildComponents(); --i >= 0;)
            {
                MultiDocumentPanelWindow* const dw = dynamic_cast <MultiDocumentPanelWindow*> (getChildComponent (i));

                if (dw != nullptr)
                {
                    dw->getContentComponent()->getProperties().set ("mdiDocumentPos_", dw->getWindowStateAsString());
                    dw->clearContentComponent();
                    delete dw;
                }
            }
        }

        resized();

        const Array <Component*> tempComps (components);
        components.clear();

        for (int i = 0; i < tempComps.size(); ++i)
        {
            Component* const c = tempComps.getUnchecked(i);

            addDocument (c,
                         Colour ((uint32) static_cast <int> (c->getProperties().getWithDefault ("mdiDocumentBkg_", (int) Colours::white.getARGB()))),
                         MultiDocHelpers::shouldDeleteComp (c));
        }
    }
}
Document &DocumentManager::addDefaultDocument(
    const SettingsManager &settings_manager)
{
    Document &doc = addDocument();
    Score &score = doc.getScore();

    auto settings = settings_manager.getReadHandle();

    // Add an initial player and instrument.
    Player player;
    player.setDescription("Player 1");
    player.setTuning(settings->get(Settings::DefaultTuning));
    score.insertPlayer(player);

    Instrument instrument;
    instrument.setDescription(settings->get(Settings::DefaultInstrumentName) +
                              " 1");
    instrument.setMidiPreset(settings->get(Settings::DefaultInstrumentPreset));
    score.insertInstrument(instrument);

    ScoreUtils::addStandardFilters(score);

    // Add an initial staff, player change, and tempo marker.
    System system;
    system.insertStaff(Staff(player.getTuning().getStringCount()));

    PlayerChange initialPlayers;
    initialPlayers.insertActivePlayer(0, ActivePlayer(0, 0));
    system.insertPlayerChange(initialPlayers);

    TempoMarker tempo;
    tempo.setDescription("Moderately");
    system.insertTempoMarker(tempo);

    score.insertSystem(system);

    return doc;
}
void BOpenSaveEditorModule::editorUnset(BCodeEditor *edr)
{
    B_D(BOpenSaveEditorModule);
    if (edr) {
        if (!d->actNewFile.isNull())
            disconnect(d->actNewFile, SIGNAL(triggered()), edr, SLOT(addDocument()));
        if (!d->actOpenFiles.isNull())
            disconnect(d->actOpenFiles, SIGNAL(triggered()), edr, SLOT(openDocuments()));
        if (!d->actReopenFile.isNull())
            disconnect(d->actReopenFile, SIGNAL(triggered()), edr, SLOT(reopenCurrentDocument()));
        if (!d->actSaveFile.isNull())
            disconnect(d->actSaveFile, SIGNAL(triggered()), edr, SLOT(saveCurrentDocument()));
        if (!d->actSaveFileAs.isNull())
            disconnect(d->actSaveFileAs, SIGNAL(triggered()), edr, SLOT(saveCurrentDocumentAs()));
        if (!d->actSaveAllFiles.isNull())
            disconnect(d->actSaveAllFiles, SIGNAL(triggered()), edr, SLOT(saveAllDocuments()));
        if (!d->actCloseFile.isNull())
            disconnect(d->actCloseFile, SIGNAL(triggered()), edr, SLOT(closeCurrentDocument()));
        if (!d->actCloseAllFiles.isNull())
            disconnect(d->actCloseAllFiles, SIGNAL(triggered()), edr, SLOT(closeAllDocuments()));
    }
    d->checkActions();
    d->resetFileHistory();
}
Exemple #22
0
Document *MainWindow::newDoc()
{
    Document* doc = m_app->newDoc();
    addDocument(doc);
    return doc;
}
void DocumentListModel::startSearch()
{
    if (m_searchThread) {
        qDebug() << "Already searching or finished search";
        return;
    }
    if(m_documentsFolder.isEmpty()) {
        qDebug() << "No search folder is set - not performing search";
        return;
    }
    m_searchThread = new SearchThread(m_docTypes, m_documentsFolder);
    connect(m_searchThread, SIGNAL(documentFound(DocumentListModel::DocumentInfo)), this, SLOT(addDocument(DocumentListModel::DocumentInfo)));
    connect(m_searchThread, SIGNAL(finished()), this, SLOT(searchFinished()));
    m_searchThread->setAutoDelete(false);
    QThreadPool::globalInstance()->start(m_searchThread);
}
Exemple #24
0
bool docengine::loadDocuments(QStringList fileNames, QTabWidgetqq *tabWidget, bool reload)
{
    MainWindow* mwin = MainWindow::instance();
    if(!fileNames.isEmpty())
    {
        mwin->getSettings()->setValue("lastSelectedDir", QFileInfo(fileNames[0]).absolutePath());

        // Ok, now open our files
        for (int i = 0; i < fileNames.count(); i++) {
            QFile file(fileNames[i]);
            QFileInfo fi(fileNames[i]);

            int x = isDocumentOpen(fi.absoluteFilePath());
            if(!reload){
                if (x > -1 ) {
                    if(fileNames.count() == 1){
                        tabWidget->setCurrentIndex(x);
                    }
                    continue;
                }
            }
            int index = 0,pos=0;
            if(reload){
                index = x;
            }else {
                index = tabWidget->addEditorTab(true, fi.fileName());
            }
            QsciScintillaqq* sci = tabWidget->QSciScintillaqqAt(index);
            pos = sci->SendScintilla(QsciScintilla::SCI_GETCURRENTPOS);
            sci->setEncoding(generalFunctions::getFileMimeEncoding(fi.absoluteFilePath()));
            if (!read(&file, sci)) {
                // Manage error
                QMessageBox msgBox;
                msgBox.setWindowTitle(mwin->windowTitle());
                msgBox.setText(tr("Error trying to open \"%1\"").arg(fi.fileName()));
                msgBox.setDetailedText(file.errorString());
                msgBox.setStandardButtons(QMessageBox::Abort | QMessageBox::Retry | QMessageBox::Ignore);
                msgBox.setDefaultButton(QMessageBox::Retry);
                msgBox.setIcon(QMessageBox::Critical);
                int ret = msgBox.exec();
                if(ret == QMessageBox::Abort) {
                    tabWidget->removeTab(index);
                    break;
                } else if(ret == QMessageBox::Retry) {
                    tabWidget->removeTab(index);
                    i--;
                    continue;
                } else if(ret == QMessageBox::Ignore) {
                    tabWidget->removeTab(index);
                    continue;
                }
            }

            // If there was only a new empty tab opened, remove it
            if(tabWidget->count() == 2 && tabWidget->QSciScintillaqqAt(0)->isNewEmptyDocument()) {
                tabWidget->removeTab(0);
                index--;
            }
            file.close();
            if(!reload) {
                sci->setFileName(fi.absoluteFilePath());
                sci->setEolMode(sci->guessEolMode());
                tabWidget->setTabToolTip(index, sci->fileName());
                sci->autoSyntaxHighlight();
                addDocument(fi.absoluteFilePath());
            }else {
                sci->scrollCursorToCenter(pos);
            }

            sci->setFocus(Qt::OtherFocusReason);
            sci->setModified(false);
        }
    }
    return true;
}
void DocumentsDialog::init( Mode mode, const QList<Document*> &docs )
{
    DocumentManager *mng = Main::documentManager();
    connect(mng, SIGNAL(changedExternally(Document*)), this, SLOT(onDocumentChangedExternally(Document*)));

    mMode = mode;

    mLabel = new QLabel;
    mLabel->setWordWrap(true);

    mDocTree = new QTreeWidget;
    mDocTree->setRootIsDecorated(false);

    QStringList headerLabels;
    headerLabels << tr("Document") << tr("Path", "File path.");
    if (mode == ExternalChange)
        headerLabels << tr("Status");
    mDocTree->setHeaderLabels(headerLabels);

    mDocTree->header()->setStretchLastSection(false);
    mDocTree->header()->setSectionResizeMode(1, QHeaderView::Stretch);
    if (mode == ExternalChange)
        mDocTree->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents);

    switch (mode)
    {
    case ExternalChange:
        setWindowTitle(tr("Externally Changed Documents"));
        mLabel->setText(tr("The following documents have changed externally.\n\n"
            "Apply the desired actions to selected documents, until the list is empty."));
        break;
    case Quit:
        setWindowTitle(tr("Unsaved Documents"));
        mLabel->setText(tr("The following documents have unsaved changes.\n\n"
            "Apply desired actions to selected documents, until the list is empty."));
        break;
    }

    foreach(Document *doc, docs)
        addDocument(doc);

    QDialogButtonBox *dialogBtnBox = new QDialogButtonBox();
    QPushButton *btn;
    QPushButton *defaultBtn;
    if (mode == ExternalChange) {
        defaultBtn = btn = dialogBtnBox->addButton(tr("&Reload"), QDialogButtonBox::ActionRole);
        btn->setIcon( QIcon::fromTheme("view-refresh") );
        connect(btn, SIGNAL(clicked()), this, SLOT(reloadSelected()));

        btn = dialogBtnBox->addButton(tr("Over&write"), QDialogButtonBox::ActionRole);
        btn->setIcon( QIcon::fromTheme("document-save") );
        connect(btn, SIGNAL(clicked()), this, SLOT(saveSelected()));

        btn = dialogBtnBox->addButton(tr("&Ignore"), QDialogButtonBox::AcceptRole);
        btn->setIcon( QIcon::fromTheme("window-close") );
        connect(btn, SIGNAL(clicked()), this, SLOT(ignoreSelected()));

        btn = dialogBtnBox->addButton(tr("&Close"), QDialogButtonBox::AcceptRole);
        btn->setIcon( QIcon::fromTheme("window-close") );
        connect(btn, SIGNAL(clicked()), this, SLOT(closeSelected()));
    }
    else {
        defaultBtn = btn = dialogBtnBox->addButton(tr("&Save"), QDialogButtonBox::ActionRole);
        btn->setIcon( QIcon::fromTheme("document-save") );
        connect(btn, SIGNAL(clicked()), this, SLOT(saveSelected()));

        btn = dialogBtnBox->addButton(tr("&Discard"), QDialogButtonBox::ActionRole);
        btn->setIcon( QIcon::fromTheme("window-close") );
        connect(btn, SIGNAL(clicked()), this, SLOT(ignoreSelected()));

        btn = dialogBtnBox->addButton(tr("&Cancel"), QDialogButtonBox::RejectRole);
        btn->setIcon( QIcon::fromTheme("window-close") );
        connect(btn, SIGNAL(clicked()), this, SLOT(reject()));
    }

    QPushButton *selectAllBtn = new QPushButton(tr("Select &All"));
    connect(selectAllBtn, SIGNAL(clicked()), this, SLOT(selectAll()));

    QPushButton *selectNoneBtn = new QPushButton(tr("Select N&one"));
    connect(selectNoneBtn, SIGNAL(clicked()), this, SLOT(selectNone()));

    QLabel *iconLabel = new QLabel;
    iconLabel->setPixmap( QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(48,48) );
    iconLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );

    QHBoxLayout *lblBox = new QHBoxLayout();
    lblBox->addWidget( iconLabel );
    lblBox->addWidget( mLabel );

    QHBoxLayout *selectionBox = new QHBoxLayout();
    selectionBox->addWidget(selectAllBtn);
    selectionBox->addWidget(selectNoneBtn);

    QVBoxLayout *vbox = new QVBoxLayout();
    vbox->addLayout( lblBox );
    vbox->addWidget( mDocTree );
    vbox->addLayout( selectionBox );
    vbox->addWidget( dialogBtnBox );

    setLayout(vbox);

    defaultBtn->setDefault(true);
    defaultBtn->setFocus(Qt::OtherFocusReason);

    resize(500,300);
}
Exemple #26
0
void MainWindow::newDocument()
{
    addDocument(new Document());
}
    void multiTxtDocument::loadFile ( string fileName, bool caseOn,  bool noPunct, bool debugMode, bool noTxtIds, bool tercomLike )
    {
        if ( multiTxtDocumentParams.debugMode )
        {
            cerr << "DEBUG tercpp : multiTxtDocument::loadFile : loading files  " << endl << fileName << endl << "END DEBUG" << endl;
            cerr << "DEBUG tercpp : multiTxtDocument::loadFile : testing params  " << endl << Tools::printParams ( multiTxtDocumentParams ) << endl << "END DEBUG" << endl;
            cerr << "DEBUG tercpp : multiTxtDocument::loadFile : testing others params  " << endl << "caseOn : " << caseOn << endl << "noPunct : " << noPunct << endl << "debugMode : " << debugMode << endl << "noTxtIds : " << noTxtIds << endl << "tercomLike : " << tercomLike << endl << "END DEBUG" << endl;
        }

        ifstream fichierLoad ( fileName.c_str(), ios::in );
        string line="";
        documentStructure l_doc;
	stringstream l_stream;
	l_doc.setFileName(fileName);
	l_stream.str ( "" );
	l_stream << ( int ) documents.size();
	l_doc.setDocId ( l_stream.str() );
        if ( fichierLoad )
        {
            int l_ids = 1;
	    l_stream.str ( "" );
	    string l_key="";
	    string line_mod="";
            while ( getline ( fichierLoad, line ) )
            {
		l_key="";
		line_mod="";
                l_stream.str ( "" );

                if ( noTxtIds )
                {
                    l_stream << l_ids;
                    l_key = l_stream.str();
                    line_mod = line;
                    l_ids++;
                }
                else
                {
		    if ((int)line.rfind ( "(" )==-1)
		    {
			cerr << "ERROR : multiTxtDocument::loadFile : Id not found, maybe you should use the --noTxtIds Option ? " << endl;
			exit ( 0 );
		    }
                    l_key = line.substr ( line.rfind ( "(" ), line.size() - 1 );
                    line_mod = line.substr ( 0, line.rfind ( "(" ) - 1 );
                }
                if ( multiTxtDocumentParams.debugMode )
                {
                    cerr << "DEBUG multiTxtDocument::loadFile : line NOT tokenized |" << line_mod << "|" << endl << "END DEBUG" << endl;
                }
                if ( !tercomLike )
                {
                    if ( multiTxtDocumentParams.debugMode )
                    {
                        cerr << "DEBUG tercpp : multiTxtDocument::loadFile : " << endl << "TERCOM AT FALSE " << endl << "END DEBUG" << endl;
                    }

//                    line_mod = tokenizePunct ( line_mod );
                }
                if ( !caseOn )
                {
                    if ( multiTxtDocumentParams.debugMode )
                    {
                        cerr << "DEBUG tercpp : multiTxtDocument::loadFile : " << endl << "CASEON AT FALSE " << endl << "END DEBUG" << endl;
                    }
                    line_mod = lowerCase ( line_mod );
                }
                if ( noPunct )
                {
                    if ( multiTxtDocumentParams.debugMode )
                    {
                        cerr << "DEBUG tercpp : multiTxtDocument::loadFile : " << endl << "NOPUNCT AT TRUE " << endl << "END DEBUG" << endl;
                    }
                    if ( !tercomLike )
                    {
                        line_mod = removePunctTercom ( line_mod );
                    }
                    else
                    {
                        line_mod = removePunct ( line_mod );
                    }
                }
                if ( multiTxtDocumentParams.debugMode )
                {
                    cerr << "DEBUG multiTxtDocument::loadFile : line tokenized |" << line_mod << "|" << endl << "END DEBUG" << endl;
                }
                vector<string> vecDocLine = stringToVector ( line_mod, " " );
// 	  string l_key;
// 	  hashHypothesis.addValue(l_key,vecDocLine);
// 	  l_key=(string)vecDocLine.at((int)vecDocLine.size()-1);
// 	  vecDocLine.pop_back();
                if ( multiTxtDocumentParams.debugMode )
                {
                    cerr << "DEBUG tercpp multiTxtDocument::loadFile : " << l_key << "|" << vectorToString ( vecDocLine ) << "|" << endl << "Vector Size : " << vecDocLine.size() << endl << "Line length : " << ( int ) line_mod.length() << endl << "END DEBUG" << endl;
                }
//             hashHypothesis.addValue(l_key,vecDocLine);
                segmentStructure l_seg ( l_key, vecDocLine, l_doc.getDocId() );
                l_doc.addSegments ( l_seg );
		 
            }
	    
//         Ref=line;
//         getline ( fichierHyp, line );
//         Hyp=line;
            fichierLoad.close();  // on ferme le fichier
	    addDocument ( l_doc );
            if ( multiTxtDocumentParams.debugMode )
            {
                cerr << "DEBUG multiTxtDocument::loadFile : document " << l_doc.getDocId() << " added !!!" << endl << "END DEBUG" << endl;
            }
	    l_key.erase();
	    line_mod.erase();
            l_stream.str("");
        }
        else  // sinon
        {
            cerr << "ERROR : multiTxtDocument::loadFile : can't open file : " + fileName + " !" << endl;
            exit ( 0 );
        }
    }