@Override
	public void run() {
		int compteur = 0;
		FileReader fr;

		try {
			fr = new FileReader(new File(Common.DIRRSC + corpus));
			BufferedReader br = new BufferedReader(fr);
			String line = br.readLine();
			while (line != null) {
				try {
					HashMap<String, Short> tf_doc;

					String[] doc = line.split("\t");
					int hash_doc = Integer.parseInt((doc[0]));
					tf_doc = getTermFrequencies(doc[1], normalizer,
							stopwords);
					for (Map.Entry<String, Short> word : tf_doc.entrySet()) {
						String w = word.getKey();
						if (!Common.isEmptyWord(w)) {
							TreeMap<Integer, Short> listDocs = index.get(w);
							if (listDocs != null) {
								// le mot existe dans l'index, on l'ajoute dans
								// la liste des documents
								listDocs.put(hash_doc, word.getValue());
								index.put(w, listDocs);
							} else {
								TreeMap<Integer, Short> list_docs = new TreeMap<>();
								list_docs.put(hash_doc, word.getValue());
								index.put(w, list_docs);
							}
						}
					}

				} catch (IOException e) {
					e.printStackTrace();
				}
				if (compteur == this.reached) {
					compteur = 0;
					saveTempIndex();
				}
				line=br.readLine();
				compteur++;
			}
			br.close();
			fr.close();
		} catch (FileNotFoundException e1) {
			e1.printStackTrace();
		}
		catch (IOException e) {
			e.printStackTrace();
		}
	
		saveTempIndex();
		fusionIndexes(this.tmp_idx, this.name_idx);
		System.gc();
	}