chore(i18n,curriculum): processed translations (#43390)
This commit is contained in:
@ -8,86 +8,86 @@ dashedName: soundex
|
||||
|
||||
# --description--
|
||||
|
||||
Soundex is an algorithm for creating indices for words based on their pronunciation. The goal is for homophones to be encoded to the same representation so that they can be matched despite minor differences in spelling (from [the WP article](https://en.wikipedia.org/wiki/soundex)). There is a major issue in many of the implementations concerning the separation of two consonants that have the same soundex code! According to the [official Rules](https://www.archives.gov/research/census/soundex.html). So check for instance if **Ashcraft** is coded to **A-261**.
|
||||
Soundex é um algoritmo para criar índices para palavras com base em sua pronúncia. O objetivo é que os homófonos sejam codificados para a mesma representação, para que eles possam ser combinados apesar das pequenas diferenças na ortografia (do [artigo da Wikipédia](https://en.wikipedia.org/wiki/soundex)). Há uma questão importante em muitas das implementações relativas à separação de duas consoantes que têm o mesmo código soundex! De acordo com as [regras oficiais](https://www.archives.gov/research/census/soundex.html). Então, verifique por exemplo se **Ashcraft** é codificado para **A-261**.
|
||||
|
||||
<ul>
|
||||
<li>If a vowel (A, E, I, O, U) separates two consonants that have the same soundex code, the consonant to the right of the vowel is coded. Tymczak is coded as T-522 (T, 5 for the M, 2 for the C, Z ignored (see "Side-by-Side" rule above), 2 for the K). Since the vowel "A" separates the Z and K, the K is coded.</li>
|
||||
<li>If "H" or "W" separate two consonants that have the same soundex code, the consonant to the right of the vowel is not coded. Example: Ashcraft is coded A-261 (A, 2 for the S, C ignored, 6 for the R, 1 for the F). It is not coded A-226.</li>
|
||||
<li>Se uma vogal (A, E, I, O, U) separa duas consoantes que tenham o mesmo código soundex, a consoante à direita da vogal é codificada. Tymczak é codificado como T-522 (T, 5 para M, 2 para o C, Z ignorado – veja a regra "Lado a lado" acima –, 2 para o K). Uma vez que a vogal "A" separa Z e K, o K está codificado.</li>
|
||||
<li>Se "H" ou "W" separa duas consoantes que tenham o mesmo código soundex, a consoante à direita da vogal não é codificada. Exemplo: Ashcraft está codificado A-261 (A, 2 para o S, C ignorado, 6 para o R, 1 para o F). Ele não é codificado A-226.</li>
|
||||
</ul>
|
||||
|
||||
# --instructions--
|
||||
|
||||
Write a function that takes a string as a parameter and returns the encoded string.
|
||||
Escreva uma função que receba uma string como parâmetro e retorne a string codificada.
|
||||
|
||||
# --hints--
|
||||
|
||||
`soundex` should be a function.
|
||||
`soundex` deve ser uma função.
|
||||
|
||||
```js
|
||||
assert(typeof soundex == 'function');
|
||||
```
|
||||
|
||||
`soundex("Soundex")` should return a string.
|
||||
`soundex("Soundex")` deve retornar uma string.
|
||||
|
||||
```js
|
||||
assert(typeof soundex('Soundex') == 'string');
|
||||
```
|
||||
|
||||
`soundex("Soundex")` should return `"S532"`.
|
||||
`soundex("Soundex")` deve retornar `"S532"`.
|
||||
|
||||
```js
|
||||
assert.equal(soundex('Soundex'), 'S532');
|
||||
```
|
||||
|
||||
`soundex("Example")` should return `"E251"`.
|
||||
`soundex("Example")` deve retornar `"E251"`.
|
||||
|
||||
```js
|
||||
assert.equal(soundex('Example'), 'E251');
|
||||
```
|
||||
|
||||
`soundex("Sownteks")` should return `"S532"`.
|
||||
`soundex("Sownteks")` deve retornar `"S532"`.
|
||||
|
||||
```js
|
||||
assert.equal(soundex('Sownteks'), 'S532');
|
||||
```
|
||||
|
||||
`soundex("Ekzampul")` should return `"E251"`.
|
||||
`soundex("Ekzampul")` deve retornar `"E251"`.
|
||||
|
||||
```js
|
||||
assert.equal(soundex('Ekzampul'), 'E251');
|
||||
```
|
||||
|
||||
`soundex("Euler")` should return `"E460"`.
|
||||
`soundex("Euler")` deve retornar `"E460"`.
|
||||
|
||||
```js
|
||||
assert.equal(soundex('Euler'), 'E460');
|
||||
```
|
||||
|
||||
`soundex("Gauss")` should return `"G200"`.
|
||||
`soundex("Gauss")` deve retornar `"G200"`.
|
||||
|
||||
```js
|
||||
assert.equal(soundex('Gauss'), 'G200');
|
||||
```
|
||||
|
||||
`soundex("Hilbert")` should return `"H416"`.
|
||||
`soundex("Hilbert")` deve retornar `"H416"`.
|
||||
|
||||
```js
|
||||
assert.equal(soundex('Hilbert'), 'H416');
|
||||
```
|
||||
|
||||
`soundex("Knuth")` should return `"K530"`.
|
||||
`soundex("Knuth")` deve retornar `"K530"`.
|
||||
|
||||
```js
|
||||
assert.equal(soundex('Knuth'), 'K530');
|
||||
```
|
||||
|
||||
`soundex("Lloyd")` should return `"L300"`.
|
||||
`soundex("Lloyd")` deve retornar `"L300"`.
|
||||
|
||||
```js
|
||||
assert.equal(soundex('Lloyd'), 'L300');
|
||||
```
|
||||
|
||||
`soundex("Lukasiewicz")` should return `"L222"`.
|
||||
`soundex("Lukasiewicz")` deve retornar `"L222"`.
|
||||
|
||||
```js
|
||||
assert.equal(soundex('Lukasiewicz'), 'L222');
|
||||
|
Reference in New Issue
Block a user