The first example is a palindrome. The second involves inversion of the word, but the words areHere's a couple...
tattarrattat => tattarrattat
palindromes => semordnilap
movlw b'10000001' ;WREG = b'10000001
bsf STATUS,0
btfss WREG,0
bcf STATUS,0
rrf WREG
bra $-4 ;after 4 rotations WREG = b'00011000'
nop
;alternatively
movlw b'10000001' ;WREG = b'10000001
swapf WREG
nop ;WREG = b'00011000'
#!/bin/bash
DICT=/usr/share/dict/words
TEMP=tempfile
OUT=outfile.txt
#Clean start -- delete old temporary and output files
rm -f $TEMP $OUT
#Iterate over each word in the dictionary file
cat $DICT | while read WORD || [[ -n $WORD ]]; do
LENGTH=${#WORD} #get word length
if (( LENGTH > 1 )); then #we only need to check words.length > 1
#Construct a regexp to compare all permutations simultaneously
#i.e. "joeyd" => "^(oeydj|eydjo|ydjoe|djoey)$"
REGEX="^("
for ((i=1 ; i < LENGTH; i++)); do
if ((i>1)); then
REGEX=${REGEX}\|${WORD:$i}${WORD:0:((i))}
else
REGEX=${REGEX}${WORD:$i}${WORD:0:((i))}
fi
done
REGEX="${REGEX})$" #close the regexp
unset MATCHLIST
for MATCH in `grep -iE $REGEX $DICT`; do
MATCHLIST="$MATCHLIST $MATCH"
done
if [[ -v MATCHLIST ]]; then
echo "$LENGTH $WORD $MATCHLIST"
echo "$LENGTH $WORD $MATCHLIST" >> $TEMP
fi
fi
done
sort -n $TEMP > $OUT
The longest words from my exhaustive dictionary search are:hi,
Given a strong pull and a stretch of the imagination then 'elastic >> citsale' , which a berry, could be the longest word.!
E
#!/bin/bash
DICT=/usr/share/dict/words
TEMP=tempfile
OUT=outfile.txt
#Clean start -- delete old temporary and output files
rm -f $TEMP $OUT
touch $TEMP #avoid file not found error during dup check
#Iterate over each word in the dictionary file
cat $DICT | while read WORD || [[ -n $WORD ]]; do
LENGTH=${#WORD} #get word length
if (( LENGTH > 1 )); then #we only need to check words.length > 1
if (! grep -iwq $WORD $TEMP); then #only process if word does not exist in $TEMP file
#Construct a regexp to compare all permutations simultaneously
#i.e. "joeyd" => "^(oeydj|eydjo|ydjoe|djoey)$"
REGEX="^("
for ((i=1 ; i < LENGTH; i++)); do
if ((i>1)); then
REGEX=${REGEX}\|${WORD:$i}${WORD:0:((i))}
else
REGEX=${REGEX}${WORD:$i}${WORD:0:((i))}
fi
done
REGEX="${REGEX})$" #close the regexp
unset MATCHLIST
for MATCH in `grep -iE $REGEX $DICT`; do
MATCHLIST="$MATCHLIST $MATCH"
done
if [[ -v MATCHLIST ]]; then
echo "$LENGTH $WORD $MATCHLIST"
echo "$LENGTH $WORD $MATCHLIST" >> $TEMP
fi
fi
fi
done
sort -n $TEMP > $OUT
#!/bin/bash
#DICT=/usr/share/dict/words
DICT=words.txt
TEMP=tempfile
OUT=outfile.txt
#Clean start -- delete old temporary and output files
rm -f $TEMP $OUT
touch $TEMP #avoid file not found error during dup check
#Iterate over each word in the dictionary file
cat $DICT | while read WORD || [[ -n $WORD ]]; do
LENGTH=${#WORD} #get word length
if [[ $WORD != *.* ]]; then #words with periods (i.e. abbreviations) muck up our regexp
if ((LENGTH > 1 )); then #we only need to check words.length > 1
if (! grep -iwq $WORD $TEMP); then #only process if word does not exist in $TEMP file
#Construct a regexp to compare all permutations simultaneously
#i.e. "joeyd" => "^(oeydj|eydjo|ydjoe|djoey)$"
REGEX="^("
for ((i=1 ; i < LENGTH; i++)); do
if ((i>1)); then
REGEX=${REGEX}\|${WORD:$i}${WORD:0:((i))}
else
REGEX=${REGEX}${WORD:$i}${WORD:0:((i))}
fi
done
REGEX="${REGEX})$" #close the regexp
unset MATCHLIST
for MATCH in `grep -iE $REGEX $DICT`; do
MATCHLIST="$MATCHLIST $MATCH"
done
if [[ -v MATCHLIST ]]; then
echo "$LENGTH $WORD $MATCHLIST"
echo "$LENGTH $WORD $MATCHLIST" >> $TEMP
fi
fi
fi
fi
done
sort -n $TEMP > $OUT
You were correct!EXPLOITATIONS > SEXPLOITATION
Lots of acronyms, proper nouns, and (IMO nonsense words), but attached is my final answer.
Processing time, about 1.5 hours. While watching the output, I realized I can speed this up considerably, and, simultaneously eliminate matches such as "weewee".
BTW,
You were correct!
Here are the longest words:
11 anarthropod arthropodan
11 decimosexto sextodecimo
11 deviscerate eviscerated
11 ethological lethologica
11 grasshopper hoppergrass
11 housemother motherhouse
11 peculations speculation
11 stabulation tabulations
12 breakweather weatherbreak
12 great-great- great-great- (say what?)
12 manslaughter slaughterman
13 exploitations sexploitation
Yes, and words like "weewee".The TS has already disqualified compound words like housework > workhouse.
I disagree. This'd eliminate clearly different words like:One could search for all words beginning in "s" and compare that to words of the same length ending in "s." In the spirit of this challenge, however, maybe a minimum of 2 rotations should be required for words beginning "s."
Simple, just create a new class order of solutions.I disagree. This'd eliminate clearly different words like:
suprising uprisings
Please see my list. Lots like this.
Palindrome's etymology is from again ("palin") + running back ("drome"). Maybe "rotopalin" or rotapalin" or "rotopalindrome." (Unfortunately those mix Latin and Greek.) I was thinking of "rotonyms," but apparently that word is taken and applies to a type of encrypting (http://tyleruebele.com/rotonym ). From the movie 2001 Space Odyssey) , "HAL" was IBM with each letter shifted left in the standard alphabet.Hey, can we, for fun (and lack of a better word) call these "rotodromes"?
What’s a ‘suprising’?I disagree. This'd eliminate clearly different words like:
suprising uprisings
Please see my list. Lots like this.
This is what happens when one stares at lists of random words all day long.What’s a ‘suprising’?
by Duane Benson
by Duane Benson
by Jake Hertz
by Jake Hertz