Consolidated common query behavior, and implemented queryDBwithSampaforOrthoStrs

1) test queryDBwithSAMPAForOrthoStrs
2) finish interpretPhrase AND TEST
querying db with sampa for ortho works!

next todo:
1) FINISH interpret phrase and test

testing output for queryDBwithSampaForOrthoStrs:

admin@mako:~/Documents/Thesis/OronymCode $ ./testWordBreakdown queryDBwithSampaForOrthoStrs \"naIs
DATABASE SUCCESSFULLY OPENED
TESTING queryDBwithSampaForOrthoStrs; sampa = "naIs

queryDBwithSAMPAForOrthoStrs, sampaStr = "naIs
===Callback for query naIs===
===Callback for query naIs===
"naIs 0:gneiss
"naIs 1:nice

NO TESTS FAILED! :)
admin@mako:~/Documents/Thesis/OronymCode $ ./testWordBreakdown queryDBwithSampaForOrthoStrsDATABASE SUCCESSFULLY OPENED
TESTING queryDBwithSampaForOrthoStrs; sampa = "k{$r@t

queryDBwithSAMPAForOrthoStrs, sampaStr = "k{$r@t
===Callback for query k{r@t===
===Callback for query k{r@t===
===Callback for query k{r@t===
"k{$r@t 0:carat
"k{$r@t 1:caret
"k{$r@t 2:carrot

NO TESTS FAILED! :)
After review, it looks like interpret phrase may already be done.

TODO
1) test interpretPhrase
Created MASTER func "discoverOronymsForPhrase"

1) test discoverOronymsForPhrase.  MOMENT OF TRUTH
---note: this will indirectly test interpretPhrase
Well, discoverOronyms doesn't work.

Got to figure out why.

admin@mako:~/Documents/Thesis/OronymCode $ ./testWordBreakdown discoverOronymsForPhrase "a"
DATABASE SUCCESSFULLY OPENED
TESTING discoverOronymsForPhrase; orthoPhrase = a
FIND ALL PERMUTATIONS

queryDBwithOrthoForSampaStrs, orthoWord = a

queryDBwithOrthoForSampaStrs, orthoWord = a
Phonetic interpretation 0 ("e)
INTERPRET PHRASE for "e

queryDBwithSAMPAForOrthoStrs, sampaStr = e
INTERPRET PHRASE for "
~~>aDEADBEEF
Phonetic interpretation 1 (@)
INTERPRET PHRASE for @

queryDBwithSAMPAForOrthoStrs, sampaStr = @
INTERPRET PHRASE for
INTERPRET PHRASE for
~~>a
~~>o'
Phonetic interpretation 2 ("A)
INTERPRET PHRASE for "A

queryDBwithSAMPAForOrthoStrs, sampaStr = A
INTERPRET PHRASE for "
~~>aDEADBEEF
!Discovered 4 oronyms:
0: 'aDEADBEEF'
1: 'a'
2: 'o''
3: 'aDEADBEEF'
NO TESTS FAILED! :)
It works for some cases now. I need to make it more patient.

Right now, it's only looking in the database for exact matches,
not prefix matches. I need for it to look for prefix matches too,
or it will end too early.  I think that's what needs to happen, anyway

Heres the test runs:

admin@mako:~/Documents/Thesis/OronymCode $ ./testWordBreakdown discoverOronymsForPhrase "a"DATABASE SUCCESSFULLY OPENED
TESTING discoverOronymsForPhrase; orthoPhrase = a
FIND ALL PERMUTATIONS

queryDBwithOrthoForSampaStrs, orthoWord = a

queryDBwithOrthoForSampaStrs, orthoWord = a
Phonetic interpretation 0 ("e)
INTERPRET PHRASE for e

queryDBwithSAMPAForOrthoStrs, sampaStr = e
INTERPRET PHRASE for
INTERPRET PHRASE for
INTERPRET PHRASE for
0~~>a
0~~>eh
0~~>et
Phonetic interpretation 1 (@)
INTERPRET PHRASE for @

queryDBwithSAMPAForOrthoStrs, sampaStr = @
INTERPRET PHRASE for
INTERPRET PHRASE for
1~~>a
1~~>o'
Phonetic interpretation 2 ("A)
INTERPRET PHRASE for A

queryDBwithSAMPAForOrthoStrs, sampaStr = A
INTERPRET PHRASE for
INTERPRET PHRASE for
2~~>a
2~~>ah
!Discovered 7 oronyms:
0: 'a'
1: 'eh'
2: 'et'
3: 'a'
4: 'o''
5: 'a'
6: 'ah'
NO TESTS FAILED! :)
admin@mako:~/Documents/Thesis/OronymCode $ ./testWordBreakdown discoverOronymsForPhrase "a Nice"
DATABASE SUCCESSFULLY OPENED
TESTING discoverOronymsForPhrase; orthoPhrase = a Nice
FIND ALL PERMUTATIONS

queryDBwithOrthoForSampaStrs, orthoWord = a

queryDBwithOrthoForSampaStrs, orthoWord = a

queryDBwithOrthoForSampaStrs, orthoWord = Nice

queryDBwithOrthoForSampaStrs, orthoWord = Nice
   numFullPhrases = 3
      nextWordSAMPAPhoneSeqs.size() = 2
      0***sampa phrase after append  _"__e__"__n__aI__s_
      1***sampa phrase after append  _@__"__n__aI__s_
      2***sampa phrase after append  _"__A__"__n__aI__s_
      3***sampa phrase after append  _"__e__"__n__i__s_
      4***sampa phrase after append  _@__"__n__i__s_
      5***sampa phrase after append  _"__A__"__n__i__s_
      Phonetic interpretation 0 ("e"naIs)
      INTERPRET PHRASE for enaIs

      queryDBwithSAMPAForOrthoStrs, sampaStr = e
      INTERPRET PHRASE for
      INTERPRET PHRASE for
      INTERPRET PHRASE for

      queryDBwithSAMPAForOrthoStrs, sampaStr = en

      0~~>a
      0~~>eh
      0~~>et
      0~~>DEADBEEF
      Phonetic interpretation 1 (@"naIs)
      INTERPRET PHRASE for @naIs

      queryDBwithSAMPAForOrthoStrs, sampaStr = @
      INTERPRET PHRASE for
      INTERPRET PHRASE for

      queryDBwithSAMPAForOrthoStrs, sampaStr = @n
      INTERPRET PHRASE for @

      queryDBwithSAMPAForOrthoStrs, sampaStr = @
      INTERPRET PHRASE for
      INTERPRET PHRASE for
      INTERPRET PHRASE for @

      queryDBwithSAMPAForOrthoStrs, sampaStr = @
      INTERPRET PHRASE for
      INTERPRET PHRASE for

      queryDBwithSAMPAForOrthoStrs, sampaStr = @naI

      1~~>a
      1~~>o'
      1~~>ana
      1~~>ano'
      1~~>'n'a
      1~~>'n'o'
      1~~>DEADBEEF
      Phonetic interpretation 2 ("A"naIs)
      INTERPRET PHRASE for AnaIs

      queryDBwithSAMPAForOrthoStrs, sampaStr = A
      INTERPRET PHRASE for
      INTERPRET PHRASE for

      queryDBwithSAMPAForOrthoStrs, sampaStr = An
      INTERPRET PHRASE for A

      queryDBwithSAMPAForOrthoStrs, sampaStr = A
      INTERPRET PHRASE for
      INTERPRET PHRASE for

      queryDBwithSAMPAForOrthoStrs, sampaStr = AnaI

      2~~>a
      2~~>ah
      2~~>ona
      2~~>onah
      2~~>DEADBEEF
      Phonetic interpretation 3 ("e"nis)
      INTERPRET PHRASE for enis

      queryDBwithSAMPAForOrthoStrs, sampaStr = e
      INTERPRET PHRASE for
      INTERPRET PHRASE for
      INTERPRET PHRASE for

      queryDBwithSAMPAForOrthoStrs, sampaStr = en

      3~~>a
      3~~>eh
      3~~>et
      3~~>DEADBEEF
      Phonetic interpretation 4 (@"nis)
      INTERPRET PHRASE for @nis

      queryDBwithSAMPAForOrthoStrs, sampaStr = @
      INTERPRET PHRASE for
      INTERPRET PHRASE for

      queryDBwithSAMPAForOrthoStrs, sampaStr = @n
      INTERPRET PHRASE for @

      queryDBwithSAMPAForOrthoStrs, sampaStr = @
      INTERPRET PHRASE for
      INTERPRET PHRASE for
      INTERPRET PHRASE for @

      queryDBwithSAMPAForOrthoStrs, sampaStr = @
      INTERPRET PHRASE for
      INTERPRET PHRASE for

      queryDBwithSAMPAForOrthoStrs, sampaStr = @ni

      4~~>a
      4~~>o'
      4~~>ana
      4~~>ano'
      4~~>'n'a
      4~~>'n'o'
      4~~>DEADBEEF
      Phonetic interpretation 5 ("A"nis)
      INTERPRET PHRASE for Anis

      queryDBwithSAMPAForOrthoStrs, sampaStr = A
      INTERPRET PHRASE for
      INTERPRET PHRASE for

      queryDBwithSAMPAForOrthoStrs, sampaStr = An
      INTERPRET PHRASE for A

      queryDBwithSAMPAForOrthoStrs, sampaStr = A
      INTERPRET PHRASE for
      INTERPRET PHRASE for

      queryDBwithSAMPAForOrthoStrs, sampaStr = Ani

      5~~>a
      5~~>ah
      5~~>ona
      5~~>onah
      5~~>DEADBEEF
      !Discovered 32 oronyms:
      0: 'a'
      1: 'eh'
      2: 'et'
      3: 'DEADBEEF'
      4: 'a'
      5: 'o''
      6: 'ana'
      7: 'ano''
      8: ''n'a'
      9: ''n'o''
      10: 'DEADBEEF'
      11: 'a'
      12: 'ah'
      13: 'ona'
      14: 'onah'
      15: 'DEADBEEF'
      16: 'a'
      17: 'eh'
      18: 'et'
      19: 'DEADBEEF'
      20: 'a'
      21: 'o''
      22: 'ana'
      23: 'ano''
      24: ''n'a'
      25: ''n'o''
      26: 'DEADBEEF'
      27: 'a'
      28: 'ah'
      29: 'ona'
      30: 'onah'
      31: 'DEADBEEF'
      NO TESTS FAILED! :)