Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A couple more ideas:</p> <ul> <li>Quotes, for each open quote there must be an end quote after it.</li> <li>Capital letters, usually start of sentence or noun etc (any additional grammar rules that apply</li> <li>Use a small enough dictionary to fit all in memory, and count the number of valid words in a particular arrangement.</li> </ul> <p>One way, although generally this approach is one of the most time consuming- is to use a genetic algorithm.</p> <p>Lets say the current default arrangement of columns is </p> <pre><code>|de| | f|Cl|nf|ed|au| i|ti| |ma|ha|or|nn|ou| S|on|nd|on| [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18] &lt;--- define this to be a chromosome </code></pre> <p>You could create a population of 100, 1000 w/e number of chromosomes that start off randomly assigned (keep in mind the 'random' assignment cannot have duplicate numbers and must be valid)</p> <p>Then run a fitness function on each assignment, or multiple fitness functions if you would like to break it down that way. Start off with one super fitness function that assigns a fitness value to each assignment.</p> <p>Only take the top 50% of chromosomes and move them onto the next generation, where you create 'children' chromosomes based on your choice of a crossover function and a probability of mutation- for this type of problem I recommend a very light crossover function (or none...) and a decent mutation rate. If you can find the columns that do not contribute to words/ the fitness function much then maybe flip those around.</p> <p>Keep doing this for many generations and see how the top rated assignment looks like each generation, you would expect the valid to plateau at some point and that would be your correct assignment.</p> <p>This approach could only be mildly better than brute force with fitness function, but it could also turn out to be pretty good.</p> <p>One last idea: try to abstract away from 'first column, second column' and assign the columns into chunks that form words, because just because [1,4,6....] turns out to form "the" "him" "her" etc, doesnt mean it belongs right in the beginning.</p> <p>I have a different approach that I kind of like better, I think a Dynamic Algorithm would be better suited for this.</p> <p><strong>EDIT: Another Approach</strong></p> <p>Again based on the dictionary approach, but you would focus on choosing the first few columns before the rest, and if it falls apart and you are not getting words in any particular row it means your earlier selections were wrong and you will need to backtrack.</p> <p>Select row 1.. well chances are there are not too many words here but you will narrow yourself down to a subset of your dictionary- the subset that has words that start with the chars in your first column.</p> <p>Now you have a row that works, select an adjacent row to the right. If it either forms full words or still has valid words possible (given no space is present signifying end of word). Repeat.</p> <p>If no adjacent rows are possible given your previous choices, backtrack one row to the left, and dont select the same thing again.</p> <p>The weakness here is that your dictionary would need to contain all the words in your sentence, as well as all variants of the words. You might need to come up with a heuristic similar to a fitness function that says, "90% of words match, so this is still a valid attempt..." or something of that sort.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload