I am new to Scala, and as a matter of fact I'm quite an ignorant in Java as well (and I am not interested in going any deeper in my Java knowledge). The problem is that I am using a Java API that's only available for Java (the Freeling Java API).
Now, I have created a java class call Analyzer with only one static public method call analyze which takes a String of words (all parts of a sentence) and returns a java.util.ArrayList of String, in which each string has the word, lemma and tag of each of the words of this sentence (using freeling).
Now, I understand you can use a java class inside a scala app seamlessly. I declared the package (named analyzer) and compiled "Analyzer.java" to "Analyzer.class". My idea is to load this class "Analyzer" into the scala REPL (and another time into a scala source file) and use it from the scala REPL to see if it works.
I mean, I want to do something like this in the Scala REPL:
scala> import analyzer.Analyzer
scala> val result: java.util.ArrayList[String] = Analyzer.analyze("The cat eats fish")
scala> println(result.get(0))
The the DT
The problem is that when I try to import the package, it gives me an error:
scala> import analyzer.Analyzer
<console>:7: error: not found: value analyzer
import analyzer.Analyzer
Even though I start scala with the -classpath option pointing to the directory where Analyzer.class is.
Is this possible? How should I do it?