public class GrobidProperties
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FILE_ENDING_TEI_FULLTEXT |
static java.lang.String |
FILE_ENDING_TEI_HEADER |
static Logger |
LOGGER |
Constructor and Description |
---|
GrobidProperties()
Creates a new object and searches, where to find the grobid home folder.
|
Modifier and Type | Method and Description |
---|---|
protected static void |
checkProperties()
Checks if the given properties contains non-empty and non-null values for
the properties of list Grobid properties
|
static java.io.File |
get_GROBID_HOME_PATH()
Return the GROBID_HOME path.
|
static Consolidation.GrobidConsolidationService |
getConsolidationService()
Returns the consolidation service to be used.
|
static java.io.File |
getCorpusPath(java.io.File resourcesDir,
GrobidModel model) |
static java.lang.String |
getCrossrefMailto()
Get the "mailto" parameter to be used in the crossref query and in User-Agent
header, as recommended by CrossRef REST API documentation.
|
static java.lang.String |
getCrossrefToken()
Get the Crossref Metadata Plus authorization token to be used for Crossref
requests for the subscribers of this service.
|
static java.lang.String |
getDeLFTFilePath() |
static java.lang.String |
getDeLFTPath()
Returns the installation path of DeLFT if set, null otherwise.
|
protected static java.util.Map<java.lang.String,java.lang.String> |
getEnvironmentVariableOverrides(java.util.Map<java.lang.String,java.lang.String> environmentVariablesMap) |
static java.io.File |
getEvalCorpusPath(java.io.File resourcesDir,
GrobidModel model) |
static java.lang.String |
getGluttonHost() |
static java.lang.Integer |
getGluttonPort() |
static GrobidCRFEngine |
getGrobidCRFEngine() |
static java.io.File |
getGrobidHomePath() |
static java.io.File |
getGrobidPropertiesPath()
Return the GROBID_HOME path.
|
static GrobidProperties |
getInstance()
Returns an instance of
GrobidProperties object. |
static GrobidProperties |
getInstance(GrobidHomeFinder grobidHomeFinder)
Returns an instance of
GrobidProperties object based on a custom grobid-home directory. |
static java.io.File |
getLanguageDetectionResourcePath() |
static java.lang.String |
getLanguageDetectorFactory() |
static java.lang.String |
getLexiconPath() |
static int |
getMaxPoolConnections()
Returns the maximum parallel connections allowed in the pool.
|
static java.io.File |
getModelPath() |
static java.io.File |
getModelPath(GrobidModel model) |
static java.io.File |
getNativeLibraryPath()
Returns the content of property GrobidPropertyKeys.PROP_NATIVE_LIB_PATH as
File object. |
static java.lang.Integer |
getNBThreads()
Returns the number of threads, given in the grobid-property file.
|
protected static GrobidProperties |
getNewInstance()
Creates a new
GrobidProperties object, initializes it and returns
it. |
static java.lang.Integer |
getPdfBlocksMax() |
static java.lang.Integer |
getPdfTokensMax() |
static java.lang.Integer |
getPdfToXMLMemoryLimitMb() |
static java.io.File |
getPdfToXMLPath()
Returns the path to the home folder of pdf to xml program.
|
static java.lang.Integer |
getPdfToXMLTimeoutMs() |
static int |
getPoolMaxWait()
Returns maximum time to wait before timeout when the pool is full.
|
protected static java.lang.String |
getPropertyValue(java.lang.String pkey)
Return the value corresponding to the property key.
|
protected static java.lang.String |
getPropertyValue(java.lang.String pkey,
java.lang.String pDefaultVal)
Return the value corresponding to the property key.
|
static java.util.Properties |
getProps()
Returns all grobid-properties.
|
static java.lang.String |
getProxyHost()
Returns the host for a proxy connection, given in the grobid-property
file.
|
static java.lang.Integer |
getProxyPort()
Returns the port for a proxy connection, given in the grobid-property
file.
|
static java.lang.String |
getPythonVirtualEnv() |
static java.io.File |
getTemplatePath(java.io.File resourcesDir,
GrobidModel model) |
static java.io.File |
getTempPath()
Returns the temprorary path of grobid
|
static java.lang.String |
getVersion()
Returns the current version of GROBID
|
protected static void |
initializePaths()
Initialize the different paths set in the configuration file
grobid.properties.
|
static java.lang.Boolean |
isContextExecutionServer()
Returns if the execution context is stand alone or server.
|
static boolean |
isDeLFTRedirectOutput() |
static boolean |
isHeaderUseHeuristics() |
static java.lang.Boolean |
isResourcesInHome()
Returns if resources like firstnames, lastnames and countries are
supposed to be read from grobid-home folder, given in the grobid-property
file.
|
static java.lang.Boolean |
isUseLanguageId()
Returns if a language id shall be used, given in the grobid-property
file.
|
static void |
loadPdf2XMLPath()
Returns the path to the home folder of pdf to xml converter.
|
static void |
reload()
Reload GrobidServiceProperties.
|
static void |
reset()
Resets this class and all its static fields.
|
static void |
set_GROBID_HOME_PATH(java.lang.String pGROBID_HOME_PATH)
Set the GROBID_HOME path.
|
static void |
setConsolidationService(java.lang.String service)
Set which consolidation service to use
|
static void |
setContextExecutionServer(java.lang.Boolean state)
Set if the execution context is stand alone or server.
|
static void |
setCrossrefMailto(java.lang.String mailto)
Set the "mailto" parameter to be used in the crossref query and in User-Agent
header, as recommended by CrossRef REST API documentation.
|
static void |
setCrossrefToken(java.lang.String token)
Set the Crossref Metadata Plus authorization token to be used for Crossref
requests for the subscribers of this service.
|
static void |
setGrobidPropertiesPath(java.lang.String pGrobidPropertiesPath)
Set the GROBID_HOME path.
|
static void |
setNativeLibraryPath(java.lang.String nativeLibPath) |
static void |
setNBThreads(java.lang.String nbThreads)
Sets the number of threads, given in the grobid-property file.
|
static void |
setPropertyValue(java.lang.String pkey,
java.lang.String pValue)
Return the value corresponding to the property key.
|
static void |
setProxyHost(java.lang.String host)
Sets the host a proxy connection, given in the grobid-property file.
|
static void |
setProxyPort(java.lang.String port)
Sets the port for a proxy connection, given in the grobid-property file.
|
static void |
setPythonVirtualEnv(java.lang.String pythonVirtualEnv) |
static void |
setResourcesInHome(java.lang.String resourceInHome)
Sets if resources like firstnames, lastnames and countries are supposed
to be read from grobid-home folder, given in the grobid-property file.
|
static void |
setUseLanguageId(java.lang.String useLanguageId)
Sets if a language id shall be used, given in the grobid-property file.
|
static void |
setVersion(java.lang.String version)
Sets the GROBID version.
|
static boolean |
useELMo() |
public static final Logger LOGGER
public static final java.lang.String FILE_ENDING_TEI_HEADER
public static final java.lang.String FILE_ENDING_TEI_FULLTEXT
public GrobidProperties()
public static void reset()
public static GrobidProperties getInstance()
GrobidProperties
object. If no one is set, then
it creates one. public static GrobidProperties getInstance(GrobidHomeFinder grobidHomeFinder)
GrobidProperties
object based on a custom grobid-home directory.
If no one is set, then it creates one. public static void reload()
protected static GrobidProperties getNewInstance()
GrobidProperties
object, initializes it and returns
it. public static java.util.Properties getProps()
public static java.io.File get_GROBID_HOME_PATH()
public static java.io.File getGrobidHomePath()
public static void set_GROBID_HOME_PATH(java.lang.String pGROBID_HOME_PATH)
public static java.io.File getGrobidPropertiesPath()
public static void setGrobidPropertiesPath(java.lang.String pGrobidPropertiesPath)
protected static java.lang.String getPropertyValue(java.lang.String pkey)
pkey
- the property keyprotected static java.lang.String getPropertyValue(java.lang.String pkey, java.lang.String pDefaultVal)
pkey
- the property keypDefaultVal
- the default valuepublic static void setPropertyValue(java.lang.String pkey, java.lang.String pValue)
pkey
- the property keypublic static java.lang.String getVersion()
protected static java.util.Map<java.lang.String,java.lang.String> getEnvironmentVariableOverrides(java.util.Map<java.lang.String,java.lang.String> environmentVariablesMap)
protected static void initializePaths()
protected static void checkProperties()
public static java.io.File getTempPath()
public static void setNativeLibraryPath(java.lang.String nativeLibPath)
public static java.io.File getNativeLibraryPath()
File
object.public static boolean isHeaderUseHeuristics()
public static java.lang.String getDeLFTPath()
public static java.lang.String getDeLFTFilePath()
public static boolean isDeLFTRedirectOutput()
public static java.lang.String getGluttonHost()
public static java.lang.Integer getGluttonPort()
public static boolean useELMo()
public static java.lang.String getProxyHost()
public static void setProxyHost(java.lang.String host)
host
- for connecting crossrefpublic static java.lang.Integer getProxyPort()
public static void setCrossrefMailto(java.lang.String mailto)
mailto
- email parameter to be used for requesting crossrefpublic static java.lang.String getCrossrefMailto()
public static void setCrossrefToken(java.lang.String token)
token
- authorization token to be used for requesting crossrefpublic static java.lang.String getCrossrefToken()
public static void setProxyPort(java.lang.String port)
port
- for connecting crossrefpublic static java.lang.Integer getPdfToXMLMemoryLimitMb()
public static java.lang.Integer getPdfToXMLTimeoutMs()
public static java.lang.Integer getNBThreads()
public static java.lang.Integer getPdfBlocksMax()
public static java.lang.Integer getPdfTokensMax()
public static void setNBThreads(java.lang.String nbThreads)
nbThreads
- umber of threadspublic static java.lang.Boolean isUseLanguageId()
public static java.lang.String getLanguageDetectorFactory()
public static void setUseLanguageId(java.lang.String useLanguageId)
useLanguageId
- true, if a language id shall be usedpublic static java.lang.Boolean isResourcesInHome()
public static void setResourcesInHome(java.lang.String resourceInHome)
resourceInHome
- true, if a language id shall be usedpublic static void loadPdf2XMLPath()
public static java.io.File getPdfToXMLPath()
public static GrobidCRFEngine getGrobidCRFEngine()
public static java.io.File getModelPath(GrobidModel model)
public static java.io.File getModelPath()
public static java.io.File getTemplatePath(java.io.File resourcesDir, GrobidModel model)
public static java.io.File getEvalCorpusPath(java.io.File resourcesDir, GrobidModel model)
public static java.io.File getCorpusPath(java.io.File resourcesDir, GrobidModel model)
public static java.lang.String getLexiconPath()
public static java.io.File getLanguageDetectionResourcePath()
public static int getMaxPoolConnections()
public static int getPoolMaxWait()
public static Consolidation.GrobidConsolidationService getConsolidationService()
public static void setConsolidationService(java.lang.String service)
public static java.lang.Boolean isContextExecutionServer()
public static void setContextExecutionServer(java.lang.Boolean state)
state
- true to set the context of execution to server, false else.public static void setVersion(java.lang.String version)
public static java.lang.String getPythonVirtualEnv()
public static void setPythonVirtualEnv(java.lang.String pythonVirtualEnv)