MetaphonePtBr 2.0.0
dotnet add package MetaphonePtBr --version 2.0.0
NuGet\Install-Package MetaphonePtBr -Version 2.0.0
<PackageReference Include="MetaphonePtBr" Version="2.0.0" />
<PackageVersion Include="MetaphonePtBr" Version="2.0.0" />
<PackageReference Include="MetaphonePtBr" />
paket add MetaphonePtBr --version 2.0.0
#r "nuget: MetaphonePtBr, 2.0.0"
#:package MetaphonePtBr@2.0.0
#addin nuget:?package=MetaphonePtBr&version=2.0.0
#tool nuget:?package=MetaphonePtBr&version=2.0.0
MetaphonePtBr
What is it?
MetaphonePtBr is a text transformation algorithm based on phonetic rules of the Brazilian Portuguese language.
How to use?
First, add the NuGet package to the desired project.
Then, on any string containing a single word:
var metaphoneToken = "Word".GetMetaphoneToken();
It is just that!
How it works?
Basically, it gets the metaphone token from the single PT-BR word.
For instance, the name Cristopher
and the following variations have the same KSF
metaphone token:
- Christofer
- Christofr
- Christopher
- Christophr
- Cristofer
- Cristofr
- Cristophr
In other words, the metaphone token is the core letters that identify the word by the way it sound. It can be very useful for searches like names, addresses, products, brands and many more when:
- Looking for similar word
- Looking for a specific word, even though it was slightly misspelled
While iterating through the letters of the word, depending on the current letter, the algorithm considers:
- The current index
- *The next letter
- *The first letter after the next letter
- *The previous letter
- *The first letter before the previous letter
*If there is.
The rules
Symbol | Meaning |
---|---|
Letter | Letter |
ˆ | Begin of the word |
$ | End of the word |
[] | One occurrence of any |
v | Any vowel |
c | Any consonant |
. | Any letter |
0 | Bypass |
- The default rule among all the following mutable letters is to keep it as it is, so this rule has not been mapped, except for bypass cases
- All the following rules are ordered by priority
C
Rule | Result |
---|---|
C[AOUc] | K |
C[EI] | S |
CHR | K |
CH | X |
C$ | K |
Ç | S |
G
Rule | Result |
---|---|
G[AOU] | G |
G[EI] | J |
GH[EI] | J |
GH[c] | G |
H
Rule | Result |
---|---|
ˆH[v] | v |
H | 0 |
Immutables
Rule | Result |
---|---|
B | B |
D | D |
F | F |
J | J |
K | K |
M | M |
V | V |
L
Rule | Result |
---|---|
L[v] | v |
LH | 0 |
N
Rule | Result |
---|---|
N$ | M |
NH | 0 |
P
Rule | Result |
---|---|
PH | F |
Q
Rule | Result |
---|---|
Q | K |
R
Rule | Result |
---|---|
^R | 0 |
R$ | 0 |
RR | 0 |
S
Rule | Result |
---|---|
SH | X |
SC[EI] | S |
SC[AOU] | SK |
SCH | X |
S[c] | S |
T
Rule | Result |
---|---|
TH | T |
Vowels
Rule | Result |
---|---|
ˆ[v] | v |
W
Rule | Result |
---|---|
W[LRv] | V |
W[c] | 0 |
X
Rule | Result |
---|---|
X$ | X |
^EX[v] | Z |
.EX[v] | X |
[CGKLRXv][AIOU]X | X |
[DFMNPQSTVZ][AIOU]X | KS |
EX[EI] | X |
EX[CPT] | S |
EX[.] | KS |
Y
Rule | Result |
---|---|
Y | I |
Z
Rule | Result |
---|---|
Z$ | S |
Credits
This project is a .NET library based on this project by Carlos Costa Jordão.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
2.0.0 | 131 | 9/2/2025 |