Skip to content
New issue

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

Build order calls produce different scan-results #95

Open
Alien2150 opened this issue Mar 8, 2022 · 1 comment
Open

Build order calls produce different scan-results #95

Alien2150 opened this issue Mar 8, 2022 · 1 comment

Comments

@Alien2150
Copy link

Alien2150 commented Mar 8, 2022

Putting "addKeywords" in different code spots produces different results. Here is JUnit Test that produces different results with 0.6.3. The Second test fails:

class TrieTest {
    @Test
    fun `works`() {
        val trie = Trie.builder()
                .ignoreCase()
                .stopOnHit()
                .onlyWholeWords()
                .addKeywords(listOf("WhatsApp", "Ban me please"))
                .build()

        assertFalse(trie.parseText("Ban me please. I appreciated it").isEmpty(), "failed 1")
        assertEquals(1, trie.parseText("Call me on WhatsApp. Here is my number").size, "failed 2")
    }

    @Test
    fun `bug-report`() {
        val trie = Trie.builder()
                .addKeywords(listOf("WhatsApp", "Ban me please"))
                .ignoreCase()
                .stopOnHit()
                .onlyWholeWords()
                .build()

        assertFalse(trie.parseText("Ban me please. I appreciated it").isEmpty(), "failed 1")
        assertEquals(1, trie.parseText("Call me on WhatsApp. Here is my number").size, "failed 2")
    }
}
@Alien2150
Copy link
Author

Alien2150 commented Mar 8, 2022

This was not happening on 0.4.x

@Alien2150 Alien2150 changed the title Build order has different results Build order calls produce different scan-results Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant