Search in sources :

Example 6 with PreProcessor

use of org.edamontology.edammap.core.preprocessing.PreProcessor in project edammap by edamontology.

the class Util method makeIdf.

private static void makeIdf(String queryPath, String database, String idfPath, UtilArgs args, boolean stemming) throws IOException, ParseException {
    logger.info("Make query IDF from file {} of type {} to {}{}", queryPath, args.makeIdfType, idfPath, database != null ? " using database " + database : "");
    ProcessorArgs processorArgs = new ProcessorArgs();
    processorArgs.setFetching(false);
    processorArgs.setDb(database);
    processorArgs.setIdf(null);
    processorArgs.setIdfStemmed(null);
    Processor processor = new Processor(processorArgs);
    int idfs = processor.makeQueryIdf(QueryLoader.get(queryPath, args.makeIdfType, args.fetcherArgs.getTimeout(), args.fetcherArgs.getPrivateArgs().getUserAgent()), args.makeIdfType, idfPath, args.makeIdfWebpagesDocs, args.makeIdfFulltext, new PreProcessor(stemming), null, args.fetcherArgs);
    logger.info("Wrote {} IDFs to {}", idfs, idfPath);
}
Also used : PreProcessor(org.edamontology.edammap.core.preprocessing.PreProcessor) Processor(org.edamontology.edammap.core.processing.Processor) PreProcessor(org.edamontology.edammap.core.preprocessing.PreProcessor) ProcessorArgs(org.edamontology.edammap.core.processing.ProcessorArgs)

Aggregations

PreProcessor (org.edamontology.edammap.core.preprocessing.PreProcessor)6 Idf (org.edamontology.edammap.core.idf.Idf)4 Query (org.edamontology.edammap.core.query.Query)4 URI (java.net.URI)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 Parameter (com.beust.jcommander.Parameter)2 BufferedReader (java.io.BufferedReader)2 BufferedWriter (java.io.BufferedWriter)2 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 InputStreamReader (java.io.InputStreamReader)2 OutputStreamWriter (java.io.OutputStreamWriter)2 Field (java.lang.reflect.Field)2 URISyntaxException (java.net.URISyntaxException)2 CharsetEncoder (java.nio.charset.CharsetEncoder)2 CodingErrorAction (java.nio.charset.CodingErrorAction)2 StandardCharsets (java.nio.charset.StandardCharsets)2 Files (java.nio.file.Files)2 Path (java.nio.file.Path)2