public class ArticlesTranslator
extends java.lang.Object
Constructor and Description |
---|
ArticlesTranslator(java.lang.String[] langs,
java.lang.String pathArticles) |
Modifier and Type | Method and Description |
---|---|
void |
generateSetsCommon(java.lang.String commonArticles,
boolean onlyMissing)
Looks for the index files in the given folder and generates temporal files (tokenised)
to be translated with only the articles that also appear in file
String commonArticles . |
void |
generateSetsFullFolder(java.util.HashSet<java.lang.Integer> commonIDs,
boolean onlyMissing)
Looks for the index files in the given folder and generates temporal files (tokenised)
to be translated.
|
static void |
main(java.lang.String[] args) |
java.lang.String |
mirrorCommonArticles2Langs(java.lang.String commonArticles)
Method for converting the file with the articles in common L1.icat1.L2.icat2.method
into the mirror file with L2.icat2.L1.icat1.method.
|
void |
reconstructTradArticles(java.util.HashSet<java.lang.Integer> commonIDs,
boolean onlyMissing)
Given the original index files and the temporal files already translated,
the method reconstructs the translation of every individual article and
saves them in path/plain/L1/index/id.trad.L2.txt
|
void |
reconstructTradArticlesCommon(java.lang.String commonArticles,
boolean onlyMissing)
Given the original index files and the temporal files already translated,
the method reconstructs the translation of every individual article that
was originally in the file of common articles and saves them in
path/plain/L1/index/id.trad.L2.txt
|
void |
translateSets(java.lang.String translator,
int sgeThreads)
Main method to call the decoder
String translator for all the files generated
by generateSetsFullFolder() . |
public ArticlesTranslator(java.lang.String[] langs, java.lang.String pathArticles)
public static void main(java.lang.String[] args)
args
- public void translateSets(java.lang.String translator, int sgeThreads) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
String translator
for all the files generated
by generateSetsFullFolder()
.
The processes are distributed among the available processors.translator
- java.lang.InterruptedException
java.util.concurrent.ExecutionException
public void reconstructTradArticlesCommon(java.lang.String commonArticles, boolean onlyMissing)
onlyMissing
- public void reconstructTradArticles(java.util.HashSet<java.lang.Integer> commonIDs, boolean onlyMissing)
commonIDs
- onlyMissing
- public void generateSetsCommon(java.lang.String commonArticles, boolean onlyMissing)
String commonArticles
.
TODO also lowercase??
These files are the concatenation of the articles in the corresponding index folder
with lengthonlyMissing
- public void generateSetsFullFolder(java.util.HashSet<java.lang.Integer> commonIDs, boolean onlyMissing)
commonIDs
- onlyMissing
- public java.lang.String mirrorCommonArticles2Langs(java.lang.String commonArticles)
commonArticles
-