in reply to unglue words joined together by juncture rules

Consider the word:
'cowboycaddogcowcowboyboycatdodogcaddodocowboytoycaddye'
the alphabet:
cowboy caddy boytoy co cow boy cat cats do dog dye eddie eyes kowtow toy tow tyco
and the juncture rules:
t|d => dd cats|eyes => caddye
There are 24 ungluings and I am posting them here. The algorithm I used is of a branch-and-bound genus, and employs a breadth first search on the decision space.

Here are the details: Potential *ungluings* are added to a queue. Elements of the queue are rejected when no possible ungluings can be formed on their right hand side (i.e. their as-of-yet-not-unlgued-bit). The solution and runtime stats for this example are as follows:


0.0215 seconds

143 iterations

largest queue memory usage: 15,612 bytes

largest queue length: 24 items

    cow-boy-cat-dog-cow-cow-boy-boy-cat-do-dog-cat-do-do-cow-boy-toy-cats-eyes
    cowboy-cat-dog-cow-cow-boy-boy-cat-do-dog-cat-do-do-cow-boy-toy-cats-eyes
    cow-boy-cat-dog-cow-cowboy-boy-cat-do-dog-cat-do-do-cow-boy-toy-cats-eyes
    cow-boy-cat-dog-cow-cow-boy-boy-cat-do-dog-cat-do-do-cowboy-toy-cats-eyes
    cow-boy-cat-dog-cow-cow-boy-boy-cat-do-dog-cat-do-do-cow-boytoy-cats-eyes
    cowboy-cat-dog-cow-cowboy-boy-cat-do-dog-cat-do-do-cow-boy-toy-cats-eyes
    cowboy-cat-dog-cow-cow-boy-boy-cat-do-dog-cat-do-do-cowboy-toy-cats-eyes
    cowboy-cat-dog-cow-cow-boy-boy-cat-do-dog-cat-do-do-cow-boytoy-cats-eyes
    cow-boy-cat-dog-cow-cowboy-boy-cat-do-dog-cat-do-do-cowboy-toy-cats-eyes
    cow-boy-cat-dog-cow-cowboy-boy-cat-do-dog-cat-do-do-cow-boytoy-cats-eyes
    cow-boy-cat-dog-cow-cow-boy-boy-cat-do-dog-cat-do-do-cow-boy-toy-cat-dye
    cowboy-cat-dog-cow-cowboy-boy-cat-do-dog-cat-do-do-cowboy-toy-cats-eyes
    cowboy-cat-dog-cow-cowboy-boy-cat-do-dog-cat-do-do-cow-boytoy-cats-eyes
    cowboy-cat-dog-cow-cow-boy-boy-cat-do-dog-cat-do-do-cow-boy-toy-cat-dye
    cow-boy-cat-dog-cow-cowboy-boy-cat-do-dog-cat-do-do-cow-boy-toy-cat-dye
    cow-boy-cat-dog-cow-cow-boy-boy-cat-do-dog-cat-do-do-cowboy-toy-cat-dye
    cow-boy-cat-dog-cow-cow-boy-boy-cat-do-dog-cat-do-do-cow-boytoy-cat-dye
    cowboy-cat-dog-cow-cowboy-boy-cat-do-dog-cat-do-do-cow-boy-toy-cat-dye
    cowboy-cat-dog-cow-cow-boy-boy-cat-do-dog-cat-do-do-cowboy-toy-cat-dye
    cowboy-cat-dog-cow-cow-boy-boy-cat-do-dog-cat-do-do-cow-boytoy-cat-dye
    cow-boy-cat-dog-cow-cowboy-boy-cat-do-dog-cat-do-do-cowboy-toy-cat-dye
    cow-boy-cat-dog-cow-cowboy-boy-cat-do-dog-cat-do-do-cow-boytoy-cat-dye
    cowboy-cat-dog-cow-cowboy-boy-cat-do-dog-cat-do-do-cowboy-toy-cat-dye
    cowboy-cat-dog-cow-cowboy-boy-cat-do-dog-cat-do-do-cow-boytoy-cat-dye


The code is relatively simple. Say the word and Ill post it. (In case you'd like to have the crack at it yourself).

Could you share an actual example of your problem with us?

Replies are listed 'Best First'.
Re^2: unglue words joined together by juncture rules
by pc2 (Beadle) on Mar 30, 2008 at 12:00 UTC

    salutations,

    thank you for the answer, but we are not sure we understood what you meant in the penultimate line of your answer.

    EDIT (Mar 31): in the expression between parenthesis ("In case you'd like to have the crack at it yourself").

      Penultimate, meaning second to last?
      Online Etymology Dictionary penultimate (adj.) 1677, from earlier penultima (n.) "the next to the last syllable of a +word or verse," from fem. of L. adj. penultimus "next-to-last," from +pæne "almost" + ultimus "final." Online Etymology Dictionary, - Douglas Harper

      So "say the word and Ill post it" was unclear???

      If thats what you you are referring to than I meant that if you wanted the code that solves your problem, Id give it to you if you said so. I just didnt want to spoil the fun (the description of the code in the first few paragraphs is more than enough to solve it in under an hour)

      edit (april 01):
      regarding "to have a crack at it", that is both american and australian slang meaning "to try something". You can see the urban dictionary definition. Other tagged definitions in the urban dictionary include:

          give it a go
          have a try
          jump right in
          have a go
          to try