craigsapp / humextra

C++ programs and library for processing Humdrum data files. Best to install from https://github.com/humdrum-tools/humdrum-tools . See https://github.com/craigsapp/humlib for modernized Humdrum file parsing library.
http://extras.humdrum.org
25 stars 8 forks source link

themax pitch wildcard problem #15

Closed jacekiwaszko1 closed 5 years ago

jacekiwaszko1 commented 5 years ago

.? does not work.

**kern
8aL
8fJ
8bL
8fJ
8ccL
8fJ
8ccL
8fJ
*-

This search works: themax -p "a . b . c . c" data4.tindex output:

data4.krn::1    ZC= JA F B F C F C F    M

This one doesn't: themax -p "a .? b .? c .? c" data4.tindex

craigsapp commented 5 years ago

Should now work:

$ bin/themax -p "a . b . c . c" data4.tindex 
z.krn::1    ZC= JA F B F C F C F    M
$ bin/themax -p "a .? b .? c .? c" data4.tindex
z.krn::1    ZC= JA F B F C F C F    M

The problem was that the expansion into a regular express had a space remove which should not have been. The themax --cleaned option can be used to examined the final regular expression that will be used to search the data:

Now it is correct:

Final Regular Expression: J[^\t]*(?:A) (?:[A-G][#-]* )?(?:B) (?:[A-G][#-]* )?(?:C) (?:[A-G][#-]* )?(?:C)[ \t]

Here is what it used to be:

Final Regular Expression: J[^\t]*(?:A) (?:[A-G][#-]*)?(?:B) (?:[A-G][#-]*)?(?:C) (?:[A-G][#-]*)?(?:C)[ \t]