We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PrefixSelector doesnt properly works with word repetition. I.e. you can type same word(or even short prfix) several times and get same suggestion.
You can use something like this to solve the problem: (scala code)
class MySelector(terms: Array[String]) extends PrefixSelector[MyElement](terms: _*) { val storage = new Array[Boolean](20) def startWith(child: Array[String], parent: Array[String]):Boolean = { val pi = parent.toIterator.zipWithIndex for (i <- 0 until parent.size) storage(i) = false child.forall { cw => pi.exists { case (w, i) => if (w.startsWith(cw) && !storage(i)) { storage(i) = true; true } else false } } } override def select(element: MyElement, ctx: SelectorContext): Boolean = { val select = startWith(terms,element.getTerms) select } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
PrefixSelector doesnt properly works with word repetition. I.e. you can type same word(or even short prfix) several times and get same suggestion.
You can use something like this to solve the problem: (scala code)
The text was updated successfully, but these errors were encountered: