Post by tsh73 on Feb 13, 2019 8:23:27 GMT
I found a thing - an idea - that could aid in deciphering substitution ciphers.
I just never seen the before (or forgot it).
It is
So now we can take a garbled word... remember "covfefe"?
and check what dictionary word match.
Sometimes there are few.
I just never seen the before (or forgot it).
It is
Pattern word.
(first letter transliterated as A, next distinct letter as B, and so on)
(first letter transliterated as A, next distinct letter as B, and so on)
So now we can take a garbled word... remember "covfefe"?
and check what dictionary word match.
Sometimes there are few.
Source word
covfefe
Pattern word
abcdede
Matching words:
1 bernini
-- end of dictionary --
'pattern word
'(first letter transliterated as A, next distinct letter as B, and so on).
'term from letter of Doug McIlroy regarding unixdict.txt etc
'http://wiki.puzzlers.org/dokuwiki/doku.php?id=solving:wordlists:about:mcilroy
' "unixdict.txt"
'it is LF- delimited. Last word has LF after it too
'it is small enough to search in it with INSTR
' "unixdictWin.txt" same thing converted to Window CR/LF
w$="covfefe"
print "Source word"
print , w$
le=len(w$)
pw$=patternWord$(w$)
print "Pattern word"
print ,pw$
print "Matching words:"
open "unixdictWin.txt" for input as #1
WHILE NOT(EOF(#1))
input #1, a$
if len(a$)<> le then [skip]
if pw$<>patternWord$(a$) then [skip]
i=i+1
print i, a$
'if i>20 then exit while
[skip]
wend
close #1
print"-- end of dictionary --"
end
function patternWord$(w$)
dim a(asc("z")) 'clears it to 0
lastUsed=asc("a")-1
res$=""
for i = 1 to len(w$)
c$=mid$(w$,i,1)
if a(asc(c$))=0 then
lastUsed=lastUsed+1
a(asc(c$))=lastUsed
r$=chr$(lastUsed)
else
r$=chr$(a(asc(c$)))
end if
res$=res$+r$
next
patternWord$=res$
end function