public class PrecompiledJoinCostReader extends Object implements JoinCostFunction
Constructor and Description |
---|
PrecompiledJoinCostReader()
Empty constructor; need to call load() separately.
|
PrecompiledJoinCostReader(String fileName)
Create a precompiled join cost file reader from the given file
|
Modifier and Type | Method and Description |
---|---|
double |
cost(Target t1,
Unit uleft,
Target t2,
Unit uright)
Return the (precomputed) cost of joining the two given units; if there is no precomputed cost, return
Double.POSITIVE_INFINITY.
|
void |
init(String configPrefix)
Initialise this join cost function by reading the appropriate settings from the MaryProperties using the given
configPrefix.
|
void |
load(String fileName,
InputStream dummy,
String dummy2,
float dummy3)
Load the given precompiled join cost file
|
protected Map left
public PrecompiledJoinCostReader()
public PrecompiledJoinCostReader(String fileName) throws IOException, MaryConfigurationException
fileName
- the file to readIOException
- if a problem occurs while readingMaryConfigurationException
- MaryConfigurationExceptionpublic void init(String configPrefix) throws MaryConfigurationException
init
in interface JoinCostFunction
configPrefix
- the prefix for the (voice-specific) config entries to use when looking up files to load.MaryConfigurationException
- MaryConfigurationExceptionpublic void load(String fileName, InputStream dummy, String dummy2, float dummy3) throws IOException, MaryConfigurationException
load
in interface JoinCostFunction
fileName
- the file to readdummy
- not used, just used to fulfill the join cost function interfacedummy2
- not used, just used to fulfill the join cost function interfacedummy3
- not used, just used to fulfill the join cost function interfaceIOException
- if a problem occurs while readingMaryConfigurationException
- MaryConfigurationExceptionpublic double cost(Target t1, Unit uleft, Target t2, Unit uright)
cost
in interface JoinCostFunction
t1
- t1uleft
- uleftt2
- t2uright
- urightCopyright © 2000–2016 DFKI GmbH. All rights reserved.