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

Full sub-pattern not matched #1

Open
IFtech-A opened this issue Mar 17, 2021 · 1 comment
Open

Full sub-pattern not matched #1

IFtech-A opened this issue Mar 17, 2021 · 1 comment

Comments

@IFtech-A
Copy link

I do not know if this is an implementation issue or a feature.
Full sub-patterns are not matched if the text contains the pattern.

Test code

package main
  
import (
        "fmt"
        gf "github.com/waltsmith88/go-flashtext"
        "os"
)

func main() {

        keywordProcessor := gf.NewKeywordProcessor()
        keywordProcessor.AddKeywordsFromList([]string{"retractable", "able"})

        cleanNameList := keywordProcessor.ExtractKeywords("it is so retractable")
        fmt.Printf("Found %v keywords\n", len(cleanNameList))
        for _, keyword := range cleanNameList {
                fmt.Fprintf(os.Stderr, "%v\n", keyword)
        }
}

Expected result

Found 2 keywords
retractable
able

Result

Found 1 keywords
retractable
@code-innovator-zyx
Copy link

I do not know if this is an implementation issue or a feature. Full sub-patterns are not matched if the text contains the pattern.

Test code

package main
  
import (
        "fmt"
        gf "github.com/waltsmith88/go-flashtext"
        "os"
)

func main() {

        keywordProcessor := gf.NewKeywordProcessor()
        keywordProcessor.AddKeywordsFromList([]string{"retractable", "able"})

        cleanNameList := keywordProcessor.ExtractKeywords("it is so retractable")
        fmt.Printf("Found %v keywords\n", len(cleanNameList))
        for _, keyword := range cleanNameList {
                fmt.Fprintf(os.Stderr, "%v\n", keyword)
        }
}

Expected result

Found 2 keywords
retractable
able

Result

Found 1 keywords
retractable

This requires you to do the participle matching yourself

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

2 participants