A simple NLP for .Net
The following functions are available:
Function | Language | Explanation |
---|---|---|
Singularize | Portugese | In development, not working perfectly |
Pluralize | Portugese | In development, not working perfectly |
WordTokenize | All | None |
WordsLike | All | None |
TransformText | all | None |
RemoveEspecials | all | None |
Levenshtein | all | None |
Tokenize | all | None |
Stem | English ,Portugese | None |
Examples
Turn words into singular (Very Unstable)
Private RanNLP As New NLP(Language.PT)
MsgBox(NLP.Singularize("abordagens"))
'Return "abordagem"
Turn words into plural
Private RanNLP As New NLP(Language.PT)
MsgBox(NLP.Pluralize("casa"))
'Return "casas"
Check similarity of words and return a float with confidentiality
Private RanNLP As New NLP(Language.PT)
MsgBox(NLP.WordsLike("casa","casarão"))
'Return 57.14286
Stem words
Private RanNLP As New NLP(Language.PT)
MsgBox(NLP.Stem("papelaria"))
'Return "papel"
TransformText text
Debug.Print(NLP.TransformText("Ola mundo", Transform.LowerCase))
Debug.Print(NLP.TransformText("Ola mundo", Transform.SentenceCase))
Debug.Print(NLP.TransformText("Ola mundo", Transform.TitleCase))
Debug.Print(NLP.TransformText("Ola mundo", Transform.UpperCase))
'Returns
'ola mundo'
'Ola mundo'
'Ola Mundo'
'OLA MUNDO'
Debug.Print(NLP.RemoveEspecials("eleição"))
'Return eleicao
Private RanNLP As New NLP(Language.PT)
Dim LowerAllText As Boolean = True
Debug.Print(RanNLP.Levenshtein("casa", "Casarão"))
Debug.Print(RanNLP.Levenshtein("casa", "Casarão", LowerAllText))
'Returns
'4'
'3'
Private RanNLP As New NLP(Language.PT)
RanNLP.Tokenize("ola mundo todo. teste 3+3")
'Returns tokenize words ex
'Token.Type: "Text"
'Token.line': 0
'Token.value': "ola"