public class AnalyserRunningStrategy extends Object implements RunningStrategy
LanguageAnalyser
s because it needs the
document the PR will run on.RunningStrategy.UnconditionalRunningStrategy
Modifier and Type | Field and Description |
---|---|
protected String |
featureName |
protected String |
featureValue |
protected LanguageAnalyser |
pr |
protected int |
runMode |
RUN_ALWAYS, RUN_CONDITIONAL, RUN_NEVER
Constructor and Description |
---|
AnalyserRunningStrategy(LanguageAnalyser pr,
int runMode,
String featureName,
String featureValue) |
Modifier and Type | Method and Description |
---|---|
String |
getFeatureName() |
String |
getFeatureValue() |
ProcessingResource |
getPR()
Gets the associated ProcessingResource.
|
int |
getRunMode()
Returns the run mode (see
RunningStrategy.RUN_ALWAYS , RunningStrategy.RUN_NEVER ,
RunningStrategy.RUN_CONDITIONAL ). |
void |
setFeatureName(String name) |
void |
setFeatureValue(String value) |
void |
setProcessingResource(ProcessingResource pr) |
void |
setRunMode(int mode) |
boolean |
shouldRun()
If the runMode is
RunningStrategy.RUN_ALWAYS returns true. |
protected LanguageAnalyser pr
protected int runMode
protected String featureName
protected String featureValue
public AnalyserRunningStrategy(LanguageAnalyser pr, int runMode, String featureName, String featureValue)
public boolean shouldRun()
RunningStrategy.RUN_ALWAYS
returns true.
If the runMode is RunningStrategy.RUN_NEVER
returns false.
If the runMode is RunningStrategy.RUN_CONDITIONAL
:
featureName
is null returns truefeatureName
is not null returns falsefeatureName
is null returns truefeatureName
is not null and the document features contain
such a feature returns true if the value of the feature is
featureValue
and false otherwise.shouldRun
in interface RunningStrategy
public int getRunMode()
RunningStrategy
RunningStrategy.RUN_ALWAYS
, RunningStrategy.RUN_NEVER
,
RunningStrategy.RUN_CONDITIONAL
).getRunMode
in interface RunningStrategy
public void setRunMode(int mode)
public void setFeatureName(String name)
public void setFeatureValue(String value)
public String getFeatureName()
public String getFeatureValue()
public ProcessingResource getPR()
RunningStrategy
getPR
in interface RunningStrategy
ProcessingResource
value.public void setProcessingResource(ProcessingResource pr)
Copyright © 2024 GATE. All rights reserved.