I have a maven project, two actually, three if you count the parent. Any I have set up an interface class like this in the nlp-api
project:
package net.trajano.jee.nlp
interface Nlp {
fun analyze(text: String)
}
In the nlp
project where I do the implementation I have a class as follows:
package net.trajano.jee.nlp.impl
import edu.stanford.nlp.simple.Document
import net.trajano.jee.nlp.Nlp
class CoreNlp : Nlp {
override fun analyze(text: String) {
val doc = Document(text)
for (sent in doc.sentences()) {
// ...
}
}
}
However, I am getting the following error
D:\p\jee\nlp\src\main\java\net\trajano\jee\nlp\impl\CoreNlp.kt
ERROR: Class ‘CoreNlp’ must be declared abstract or implement abstract member public abstract fun analyze(text: String): Unit defined in net.trajano.jee.nlp.Nlp (6, 1)
ERROR: ‘analyze’ overrides nothing (7, 2)
If I relocated them to the same project (still different packages) it still does not work.
Am I missing something? I was following the https://kotlinlang.org/docs/reference/interfaces.html document