* @param config tagger configuration file
* @return true (whether this operation succeeded; always true
* @throws Exception ??
*/
protected static boolean convertMultifileTagger(String filename, String newFilename, TaggerConfig config) throws Exception {
InDataStreamFile rf = new InDataStreamFile(filename);
GlobalHolder.init(config);
if (VERBOSE) {
System.err.println(" length of holder " + new File(filename).length());
}
xSize = rf.readInt();
ySize = rf.readInt();
dict.read(filename + ".dict");
if (VERBOSE) {
System.err.println(" dictionary read ");
}
tags.read(filename + ".tags");
readExtractors(filename + ".ex");
dict.setAmbClasses();
int[] numFA = new int[extractors.getSize() + extractorsRare.getSize()];
int sizeAssoc = rf.readInt();
PrintFile pfVP = null;
if (VERBOSE) {
pfVP = new PrintFile("pairs.txt");
}
for (int i = 0; i < sizeAssoc; i++) {
int numF = rf.readInt();
FeatureKey fK = new FeatureKey();
fK.read(rf);
numFA[fK.num]++;
fAssociations.put(fK, numF);
}
if (VERBOSE) {
pfVP.close();
}
if (VERBOSE) {
for (int k = 0; k < numFA.length; k++) {
System.err.println(" Number of features of kind " + k + ' ' + numFA[k]);
}
}
prob = new LambdaSolveTagger(filename + ".prob");
if (VERBOSE) {
System.err.println(" prob read ");
}
saveModel(newFilename, config);
rf.close();
return true;
}