Hi all,
I came back to a project of mine after a week or so and I'm facing a
problem which I have no idea where it came from! This is the first time
I'm seeing it on this project - everything worked just fine a week ago!
The problem is this:
Consider some java class (opennlp-POS-tagger) with 3 .tag()
overloads...signatures and bodies follow:
public *String[] tag(String[] sentence)* {
return this.tag(sentence, null); //this is essentially what I'm
trying in my code
}
public *String[] tag(String[] sentence, Object[] additionaContext) *{
bestSequence = beam.bestSequence(sentence, additionaContext);
List<String> t = bestSequence.getOutcomes();
return t.toArray(new String[t.size()]);
}
public *String[][] tag(int numTaggings, String[] sentence) *{
Sequence[] bestSequences = beam.bestSequences(numTaggings,
sentence,null);
String[][] tags = new String[bestSequences.length][];
for (int si=0;si<tags.length;si++) {
List<String> t = bestSequences[si].getOutcomes();
tags[si] = t.toArray(new String[t.size()]);
}
Now, from my code I'm trying to do:
(.tag opennlp-pos (into-array ["New-York" "(NY)" "is" "the" "city"
"that" "never" "sleeps" "."]) nil)
which gives me a IllegalArgumentException Unexpected param type,
expected: int, given: [Ljava.lang.String; clojure.lang.Reflector.boxArg
(Reflector.java:432)
Basically, it's trying to invoke the last overload ,whereas I'm trying
to invoke the second one!!!
If I omit the 'nil' at the end , the correct method is invoked (the
first which calls the second)...why can't Clojure find the second
overload and goes for the 3rd?
any ideas?
Jim
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.