I think it is harder than that
>1. You cannot use the same animal word twice, e.g. two caches with word dog in the >title. You can use different breeds, e.g. a 'dog' cache and a 'poodle' cache will count >as two.
You also have to make some grouping for words to satisfy rule 1
>2. If a cache has two animals in the title, you may only count one, e.g. SIG-midway >to Goose or Elephant you would need to choose either goose or elephant.
you not have a
http://en.wikipedia.org/wiki/Subset_sum_problem to codefor
>3. Animals within words do not count, e.g. 'flying airplanes' - you cannot use the >word fly from this cache. However, 'fly me to the sky' - you can use the word 'fly'
You cant use search for the animal name in the cache name. dog has to be dog, dogs in the dictionary it its worse in some languages dog in swedish could be hund,hunden,hundar,hundarna. And if "Dog walking" is ok then the swedish one word translation hundpromenad, Hundskall, Hundben, Hundparken should be ok. And if "Raining cats and dogs" is ok we get a log more cases rondellhunden, hundgöra, Brukshundklubben, Hundrundan, Hundtricket, hundklubb, hundbad, Hundholmen, Hundcachen, Hundslingan, Hundkullen
and that is from my first page in gsak with swedish caches containg hund
If you make a relaxation of the problem as in pick the first one if case 2 happens a only use a small subset of all possible correct words in 1 and look for the words without any alpha character in front or after you will get a rather easy checker to code.
But It cant say if you didn't make it only if you did
Use a two level dictionary like" dictionary":[["dog",dogs"],["elephant","elephant"],[ ["lion", "lions"]] to have grouping for the words