Open IFtech-A opened 3 years ago
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
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
Expected result
Result