| 1 | #!/usr/bin/perl -w | ||
| 2 | |||
| 3 | use Org::FRDCSA::Method::Walking; | ||
| 4 | |||
| 5 | use Data::Dumper; | ||
| 6 | |||
| 7 | # walk through all the strings simultaneously, and figure out how to resync them | ||
| 8 | |||
| 9 | my $entries; | ||
| 10 | if (0) { | ||
| 11 | $entries = | ||
| 12 | [ | ||
| 13 | "this is the first and the second", | ||
| 14 | "this is the second and the third", | ||
| 15 | "this is the third and the first", | ||
| 16 | ]; | ||
| 17 | } else { | ||
| 18 | $entries = | ||
| 19 | [ | ||
| 20 | "So Andy and Lidda went to the store, where they bought a dog.", | ||
| 21 | "So Kate and Eva went to the grocery, where they shopped for food.", | ||
| 22 | "So Mary went to the church, where she got to know God", | ||
| 23 | ]; | ||
| 24 | } | ||
| 25 | |||
| 26 | # it will walk to the point where there is the first, second and third. | ||
| 27 | |||
| 28 | # then it will search until it finds "and the" common to all of them. | ||
| 29 | # Perhaps what it can do is search all combinations of lengths less | ||
| 30 | # than a given range and look for the shared string using LCS. once it has found a shared string, it continues on from that point | ||
| 31 | |||
| 32 | print Dumper | ||
| 33 | (AIE | ||
| 34 | ( | ||
| 35 | Entries => $entries, | ||
| 36 | )); |