What's the longest rotational word in the English language.

cmartinez

Joined Jan 17, 2007
8,218
God that was hard... at least for me. But here it goes:

SLIME -> LIMES

Kind of lame, considering there's only one degree of rotation ... but what the heck.
 

jpanhalt

Joined Jan 18, 2008
11,087
Here's a couple...

tattarrattat => tattarrattat

palindromes => semordnilap
The first example is a palindrome. The second involves inversion of the word, but the words are not different, so it is a semordnilap, not a palindrome. (edited)

A rotate keeps the same order of letters for those that are rotated. It is not reading the word backwards. For example:

"abcdefgh" rotated right last letter to first letter x 4 gives: "efghabcd." It is like the "swapf" PIC instruction.

Here's some enhanced midrange code that does the same:

Code:
     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'
I
 
Last edited:

joeyd999

Joined Jun 6, 2011
5,234
Here is my first cut (on Ubuntu Linux). The resulting .txt file is attached.

Bash:
#!/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
I think I can modify it to both eliminate duplicates and make it more efficient. Maybe later.

Edit: I should point out that the dictionary contains many words with punctuation (i.e. apostrophes, mostly). I'm wondering if there'd be additional unique results if I removed punctuation during the search.

Edit 2: Modified the code. I had the final sort out of place. It was sorting every iteration. Not good.
 

Attachments

Last edited:

ericgibbs

Joined Jan 29, 2010
18,766
hi,

Given a strong pull and a stretch of the imagination then 'elastic >> citsale' , which a berry, could be the longest word.!:rolleyes:

E
 

joeyd999

Joined Jun 6, 2011
5,234
hi,

Given a strong pull and a stretch of the imagination then 'elastic >> citsale' , which a berry, could be the longest word.!:rolleyes:

E
The longest words from my exhaustive dictionary search are:

elections selection
electives selective
housework workhouse
printings sprinting
 

joeyd999

Joined Jun 6, 2011
5,234
Now that I graciously provided a huge dictionary of "rotatable" words, how about a poetry competition using only those words?

Rose hoes shit; hits Eros' shoe...
 
Last edited:

joeyd999

Joined Jun 6, 2011
5,234
This version creates a list without duplicates. Still not very efficient. Output attached.

Bash:
#!/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
 

Attachments

joeyd999

Joined Jun 6, 2011
5,234
I found a more extensive list of words at:

https://github.com/dwyl/english-words

It contains a lot of abbreviations with interspersed periods -- this mucks up my regexp (each . acts like a wild card). So I modified to code to ignore words with periods (below).

I am running the program now...this may take a while. (Hey, @nsaspook, run this on one of your multiprocess server boxes...tell me how fast it runs.)

For now, here is the updated code:

Bash:
#!/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
 

joeyd999

Joined Jun 6, 2011
5,234
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,

EXPLOITATIONS > SEXPLOITATION
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
 

Attachments

joeyd999

Joined Jun 6, 2011
5,234
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

Hey, can we, for fun (and lack of a better word) call these "rotodromes"?
 

jpanhalt

Joined Jan 18, 2008
11,087
And the winner seems to be #13 with 13 characters (see post #19).

The TS has already disqualified compound words like housework > workhouse.
 

joeyd999

Joined Jun 6, 2011
5,234
The TS has already disqualified compound words like housework > workhouse.
Yes, and words like "weewee".

I can eliminate the weewees, but I have no idea how to instruct the script to eliminate compound words -- without an additional compound word dictionary, and a substantially more complicated search.
 

jpanhalt

Joined Jan 18, 2008
11,087
I did a semi-manual search for words beginning in "s". Of course, "sledgehammer" came up. "Ledgehammers" could be a real word, but I considered it fabricated, as are a lot of words on such scrabble sites. Derivatives of "slaughter" and "laughters" (e.g., slaughtering and laughterings) came up too.

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."

As for weewee and the like, there are lots of very large names for organisms that duplicate a part (called tautonyms). Since such word games often ignore spacing (Martin Gardner and others). One would need to add that as another criterion.
 

joeyd999

Joined Jun 6, 2011
5,234
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."
I disagree. This'd eliminate clearly different words like:

suprising uprisings

Please see my list. Lots like this.
 

jpanhalt

Joined Jan 18, 2008
11,087
Hey, can we, for fun (and lack of a better word) call these "rotodromes"?
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.
 
Top