Search code examples
javamalletcharsequence

In MALLET Java API, why can't the Input2CharSequence pipe feed into the CharSequenceLowercase() pipe?


When I try to use these pipes successively, I get the error:

Exception in thread "main" java.lang.IllegalArgumentException: CharSequenceLowercase expects a String, found a class java.lang.StringBuffer

I don't see any pipes available in MALLET to fix this. But it seems to me CharSequenceLowercase() should be able to take in a CharSequence...


Solution

  • Comment that line and then call

    pipeList.add(new TokenSequenceLowercase());
    

    which lower cases the tokens. It looks like the CharSequenceLowerCase pipe cannot accept a StringBuffer. if you look into its code it accepts only String.