recently I encountered the same problem you had literally years ago. Since Jahmm uses enums to represent the alphabet used by the HMM (V according ro Rabiner's notation), you gotta create an enum containing all distinct strings you want to use.
Doing so can cause a lot of work, but I figured out a shorter approach:
Using the library ByteBuddy, you can create an enum on the fly:
Class<? extends Enum<?>> generatedEnum = null;
public Class<? extends Enum<?>> createEnum(String name, List<String> entries) {
generatedEnum = new ByteBuddy()
.makeEnumeration(entries)
.name(name)
.make()
.load(getClass().getClassLoader(), ClassLoadingStrategy.Default.WRAPPER)
.getLoaded();
return generatedEnum;
}
Using ByteBuddy, you can generate the enum used for Jahmm from a List of Strings.
I hope this approach may save some other people time ;-)
Philipp