Package edu.upf.taln.dri.lib
Class Factory
- java.lang.Object
-
- edu.upf.taln.dri.lib.Factory
-
public class Factory extends Object
Factory class to get the instance of PDFimporter by the interfacePDFimporter
and to get instances of new Documents by the interfaceDocument
s.
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Factory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
checkConfig()
This method returns a String with the status check results of the configuration settings and the current status of the resources of Dr.static PDFtoTextConvMethod
checkPDFtoTextConverter()
Get the PDF to text converter currently used by the library.static Document
createNewDocument()
Instantiates a newDocument
, without any data loaded.static Document
createNewDocument(File file)
Instantiates a newDocument
, populating it with the XML string-serialized contents read from a file.static Document
createNewDocument(String absoluteFilePath)
Instantiates a newDocument
, populating it with the XML string-serialized contents read from a file.static JATSloader
getJATSloader()
Get the JATS loader (singleton) by the interfaceJATSloader
to invoke proper methods to generateDocument
s from JATS XML filesstatic ModuleConfig
getModuleConfig()
Get a copy of the current module configuration of the library.static PDFloader
getPDFloader()
static PlainTextLoader
getPlainTextLoader()
Get the plain text loader (singleton) by the interfacePlainTextLoader
to invoke proper methods to generateDocument
s from plain textstatic String
getResourceFolderFullPath()
Get resource folder full pathstatic String
getVersion()
Get the version of the librarystatic void
initFramework()
This method should be invoked in order to initialize the resources of Dr.static boolean
isEnableMate()
Check if the sentence parser is enabled.static boolean
setDRIPropertyFilePath(String filePath)
Set programmatically the value of the full local path to DRI property file.static void
setEnableMate(boolean enableSentenceParsing)
Enable or disable the parsing of sentences.static void
setModuleConfig(ModuleConfig configurationObject)
Set the module configuration by passing an instance of theModuleConfig
class that specifies which modules of the library are enabled.static void
setPDFtoTextConverter(PDFtoTextConvMethod converter)
Set the PDF to text converter that the library should use.
-
-
-
Field Detail
-
DRIconfigPathPropertyName
public static final String DRIconfigPathPropertyName
- See Also:
- Constant Field Values
-
GROBIDhome
public static String GROBIDhome
-
GROBIDproperties
public static String GROBIDproperties
-
sentenceExtracionFlagKey
public static final String sentenceExtracionFlagKey
-
citationSpotFlagKey
public static final String citationSpotFlagKey
-
citationLinkFlagKey
public static final String citationLinkFlagKey
-
citationEnrichFlagKey
public static final String citationEnrichFlagKey
-
graphExtractionFlagKey
public static final String graphExtractionFlagKey
-
sentenceRhetoricalAnnotationFlagKey
public static final String sentenceRhetoricalAnnotationFlagKey
-
terminologyExtractionFlagKey
public static final String terminologyExtractionFlagKey
-
metaannotationsExtractionFlagKey
public static final String metaannotationsExtractionFlagKey
-
headerAnalysisFlagKey
public static final String headerAnalysisFlagKey
-
coreferenceAnalysisFlagKey
public static final String coreferenceAnalysisFlagKey
-
causalityAnalysisFlagKey
public static final String causalityAnalysisFlagKey
-
babelNetAnalysisFlagKey
public static final String babelNetAnalysisFlagKey
-
summaryAnalysisFlagKey
public static final String summaryAnalysisFlagKey
-
inputCandidateInlineCitationAStype_citationSanitizerResource
public static String inputCandidateInlineCitationAStype_citationSanitizerResource
-
inputCandidateInlineCitationMarkerAStype_citationSanitizerResource
public static String inputCandidateInlineCitationMarkerAStype_citationSanitizerResource
-
PDFXimporter_Resource
protected static ImporterPDFX PDFXimporter_Resource
-
PDFEXTimporter_Resource
protected static ImporterPDFEXT PDFEXTimporter_Resource
-
GROBIDimporter_Resource
protected static ImporterGROBID GROBIDimporter_Resource
-
JATSimporter_Resource
protected static ImporterJATS JATSimporter_Resource
-
MateParsersLang_Resource
protected static Map<LangENUM,MateParser> MateParsersLang_Resource
-
RhetoricalClassifier_Resource
protected static RhetoricalClassifier RhetoricalClassifier_Resource
-
TermAnnotator_Resource
protected static TermAnnotator TermAnnotator_Resource
-
MetaAnnotator_Resource
protected static MetaAnnotator MetaAnnotator_Resource
-
LanguageDetector_Resource
protected static LanguageDetector LanguageDetector_Resource
-
CitationSanitizer_Resource
protected static InlineCitationSpotter CitationSanitizer_Resource
-
CitationLinker_Resource
protected static CitationLinker CitationLinker_Resource
-
BiblioEntryParser_Resource
protected static BiblioEntryParser BiblioEntryParser_Resource
-
HeaderAnalyzer_Resource
protected static HeaderAnalyzer HeaderAnalyzer_Resource
-
CorefChainBuilder_Resource
protected static CorefChainBuilder CorefChainBuilder_Resource
-
BabelnetAnnotator_Resource
public static BabelnetAnnotator BabelnetAnnotator_Resource
-
LexRankSummarizer_Resource
protected static LexRankSummarizer LexRankSummarizer_Resource
-
TitleSimSummarizer_Resource
protected static TitleSimSummarizer TitleSimSummarizer_Resource
-
corpusController_preprocess_XGAPPpreprocStep1
protected static gate.CorpusController corpusController_preprocess_XGAPPpreprocStep1
-
corpusController_preprocess_XGAPPpreprocStep2
protected static gate.CorpusController corpusController_preprocess_XGAPPpreprocStep2
-
corpusController_XGAPPheader
protected static gate.CorpusController corpusController_XGAPPheader
-
corpusController_XGAPPcitMarker
protected static gate.CorpusController corpusController_XGAPPcitMarker
-
corpusController_XGAPPcorefMentionSpot
protected static gate.CorpusController corpusController_XGAPPcorefMentionSpot
-
corpusController_XGAPPcausality
protected static gate.CorpusController corpusController_XGAPPcausality
-
corpusController_XGAPPmetaAnnotator
protected static gate.CorpusController corpusController_XGAPPmetaAnnotator
-
-
Method Detail
-
checkConfig
public static String checkConfig()
This method returns a String with the status check results of the configuration settings and the current status of the resources of Dr. Inventor Text Mining Framework
-
setDRIPropertyFilePath
public static boolean setDRIPropertyFilePath(String filePath)
Set programmatically the value of the full local path to DRI property file. If the value of this path is specified by the system property named 'DRIconf', the system property value has priority- Parameters:
filePath
-- Returns:
-
initFramework
public static void initFramework() throws DRIexception
This method should be invoked in order to initialize the resources of Dr. Inventor Text Mining Framework. After the first call, subsequent calls will check if Dr. Inventor Text Mining Framework has already been initialized and, if so, the initialization process is simply skipped.- Throws:
DRIexception
-
getPDFloader
public static PDFloader getPDFloader() throws DRIexception
Get the PDF loader (singleton) by the interfacePDFloader
to invoke proper methods to generateDocument
s from PDF files- Returns:
- Throws:
DRIexception
-
getJATSloader
public static JATSloader getJATSloader() throws DRIexception
Get the JATS loader (singleton) by the interfaceJATSloader
to invoke proper methods to generateDocument
s from JATS XML files- Returns:
- Throws:
DRIexception
-
getPlainTextLoader
public static PlainTextLoader getPlainTextLoader() throws DRIexception
Get the plain text loader (singleton) by the interfacePlainTextLoader
to invoke proper methods to generateDocument
s from plain text- Returns:
- Throws:
DRIexception
-
createNewDocument
public static Document createNewDocument() throws DRIexception
Instantiates a newDocument
, without any data loaded.- Returns:
- the new
Document
instance - Throws:
DRIexception
-
createNewDocument
public static Document createNewDocument(String absoluteFilePath) throws DRIexception
Instantiates a newDocument
, populating it with the XML string-serialized contents read from a file.- Parameters:
absoluteFilePath
- the absolute path of the file with the XML string-serialized contents of the document to load- Returns:
- the new
Document
instance populated with the XML string-serialized contents - Throws:
DRIexception
-
createNewDocument
public static Document createNewDocument(File file) throws DRIexception
Instantiates a newDocument
, populating it with the XML string-serialized contents read from a file.- Parameters:
file
- the file with the XML string-serialized contents of the document to load- Returns:
- the new
Document
instance populated with the XML string-serialized contents - Throws:
DRIexception
-
isEnableMate
public static boolean isEnableMate()
Check if the sentence parser is enabled. The parsing of sentences should be enabled for the library to properly work.- Returns:
-
setEnableMate
public static void setEnableMate(boolean enableSentenceParsing)
Enable or disable the parsing of sentences. The parsing of sentences should be enabled for the library to properly work.- Parameters:
enableSentenceParsing
-
-
checkPDFtoTextConverter
public static PDFtoTextConvMethod checkPDFtoTextConverter()
Get the PDF to text converter currently used by the library.- Returns:
-
setPDFtoTextConverter
public static void setPDFtoTextConverter(PDFtoTextConvMethod converter)
Set the PDF to text converter that the library should use.- Parameters:
enableSentenceParsing
-
-
getResourceFolderFullPath
public static String getResourceFolderFullPath()
Get resource folder full path- Returns:
-
getVersion
public static String getVersion()
Get the version of the library- Returns:
-
setModuleConfig
public static void setModuleConfig(ModuleConfig configurationObject)
Set the module configuration by passing an instance of theModuleConfig
class that specifies which modules of the library are enabled.- Parameters:
configurationObject
-
-
getModuleConfig
public static ModuleConfig getModuleConfig()
Get a copy of the current module configuration of the library. IMPORTANT; changes to the boolean flags of the returnedModuleConfig
instance do not change any module configuration (enable or disable any module). To change the module configuration, provide a new instance ofModuleConfig
by the thesetModuleConfig(ModuleConfig configurationObject)
method.- Returns:
-
-