Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
42
Task/Soundex/Run-BASIC/soundex.basic
Normal file
42
Task/Soundex/Run-BASIC/soundex.basic
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
global val$
|
||||
val$(1) = "BPFV"
|
||||
val$(2) = "CSGJKQXZ"
|
||||
val$(3) = "DT"
|
||||
val$(4) = "L"
|
||||
val$(5) = "MN"
|
||||
val$(6) = "R"
|
||||
|
||||
' ---------------------------------
|
||||
' show soundex on these words
|
||||
' ---------------------------------
|
||||
w$(1) = "Robert" 'R163
|
||||
w$(2) = "Rupert" 'R163
|
||||
w$(3) = "Rubin" 'R150
|
||||
w$(4) = "moses" 'M220
|
||||
w$(5) = "O'Mally" 'O540
|
||||
w$(6) = "d jay" 'D200
|
||||
|
||||
for i = 1 to 6
|
||||
print w$(i);" soundex:";soundex$(w$(i))
|
||||
next i
|
||||
wait
|
||||
|
||||
' ---------------------------------
|
||||
' Return soundex of word
|
||||
' ---------------------------------
|
||||
function soundex$(a$)
|
||||
a$ = upper$(a$)
|
||||
for i = 2 to len(a$)
|
||||
theLtr$ = mid$(a$,i,1)
|
||||
s$ = "0"
|
||||
if instr("AEIOUYHW |",theLtr$) <> 0 then s$ = ""
|
||||
if theLtr$ <> preLtr$ then
|
||||
for j = 1 to 6
|
||||
if instr(val$(j),theLtr$) <> 0 then s$ = str$(j)
|
||||
next j
|
||||
end if
|
||||
sdx$ = sdx$ + s$
|
||||
preLtr$ = theLtr$
|
||||
next i
|
||||
soundex$ = left$(a$,1) + left$(sdx$;"000",3)
|
||||
end function
|
||||
Loading…
Add table
Add a link
Reference in a new issue