MetaphonePtBr 1.0.33

dotnet add package MetaphonePtBr --version 1.0.33                
NuGet\Install-Package MetaphonePtBr -Version 1.0.33                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MetaphonePtBr" Version="1.0.33" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MetaphonePtBr --version 1.0.33                
#r "nuget: MetaphonePtBr, 1.0.33"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MetaphonePtBr as a Cake Addin
#addin nuget:?package=MetaphonePtBr&version=1.0.33

// Install MetaphonePtBr as a Cake Tool
#tool nuget:?package=MetaphonePtBr&version=1.0.33                

MetaphonePtBr

License Issues open Issues closed Pull requests open Pull requests closed NuGet Downloads

What is it?

MetaphonePtBr is a text transformation algorithm based on phonetic rules of the Portuguese Brazilian 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 generates a metaphone token from the single word provided.

For instance, the name Cristopher and the following variations generates 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
GHc 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
Sc S
T
Rule Result
TH T
Vowels
Rule Result
ˆ[v] v
W
Rule Result
W[LRv] V
Wc 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 Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • 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
1.0.33 81 5/3/2024