Is it possible to stem words without using Regex in F#?
I want to know how can I write a F# function which inputs a string and stems it.
eg.
input = "going"
output = "go"
I can’t find a way to write the code without using the regex: .*ing\b and replace function which would be almost like doing in C# without any advantage.
Semi pseudo code of what I am trying to write is:
let stemming word =
match word
|(word-"ing")+ing -> (word-"ing")
Here is a function applying the simplest stemming rule:
Parameterized active patterns makes pattern matching more readable and more convenient in this case. If stemming rules get complicated, you could update active patterns to keep the
stemfunction unchanged.