mas01mc@340: #! /bin/bash mas01mc@340: mas01mc@340: . ../test-utils.sh mas01mc@340: mas01mc@340: if [ -f testdb ]; then rm -f testdb; fi mas01mc@340: mas01mc@340: ${AUDIODB} -d testdb -N mas01mc@340: mas01mc@340: intstring 2 > testfeature mas01mc@340: floatstring 0 1 >> testfeature mas01mc@340: floatstring 1 0 >> testfeature mas01mc@340: floatstring 1 0 >> testfeature mas01mc@340: floatstring 0 1 >> testfeature mas01mc@340: mas01mc@340: intstring 1 > testpower mas01mc@340: floatstring -0.5 >> testpower mas01mc@340: floatstring -1 >> testpower mas01mc@340: floatstring -1 >> testpower mas01mc@340: floatstring -0.5 >> testpower mas01mc@340: mas01mc@340: expect_clean_error_exit ${AUDIODB} -d testdb -I -f testfeature -w testpower mas01mc@340: ${AUDIODB} -d testdb -P mas01mc@340: expect_clean_error_exit ${AUDIODB} -d testdb -I -f testfeature mas01mc@340: ${AUDIODB} -d testdb -I -f testfeature -w testpower -k testfeature1 mas01mc@340: mas01mc@340: # sequence queries require L2NORM mas01mc@340: ${AUDIODB} -d testdb -L mas01mc@340: mas01mc@340: echo "query points (0.0,0.5),(0.0,0.5),(0.5,0.0)" mas01mc@340: intstring 2 > testquery mas01mc@340: floatstring 0 0.5 >> testquery mas01mc@340: floatstring 0 0.5 >> testquery mas01mc@340: floatstring 0.5 0 >> testquery mas01mc@340: mas01mc@340: # LSH Indexing tests mas01mc@340: mas01mc@340: # Indexing requires a radius (-R) mas01mc@340: expect_clean_error_exit ${AUDIODB} -d testdb -X -l 1 mas01mc@340: mas01mc@340: # Merged index mas01mc@340: ${AUDIODB} -d testdb -I -f testfeature -w testpower -k testfeature2 mas01mc@340: mas01mc@340: if [ -f testdb.lsh* ]; then mas01mc@340: rm testdb.lsh* mas01mc@340: fi mas01mc@340: mas01mc@340: ${AUDIODB} -d testdb -X -l 1 -R 1 --lsh_b 1 mas01mc@340: mas01mc@340: # Add a new track mas01mc@340: ${AUDIODB} -d testdb -I -f testfeature -w testpower -k testfeature3 mas01mc@340: mas01mc@340: # index using same paramters as previous index (merge new data) mas01mc@340: ${AUDIODB} -d testdb -X -l 1 -R 1 mas01mc@340: mas01mc@340: ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testpower -R 1 > testoutput mas01mc@340: echo testfeature1 1 > test-expected-output mas01mc@340: echo testfeature2 1 >> test-expected-output mas01mc@340: echo testfeature3 1 >> test-expected-output mas01mc@340: cmp testoutput test-expected-output mas01mc@340: mas01mc@340: ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testpower -p 0 -R 1 > testoutput mas01mc@340: echo testfeature1 1 > test-expected-output mas01mc@340: echo testfeature2 1 >> test-expected-output mas01mc@340: echo testfeature3 1 >> test-expected-output mas01mc@340: cmp testoutput test-expected-output mas01mc@340: mas01mc@340: ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testpower -p 1 -R 1 > testoutput mas01mc@340: echo testfeature1 1 > test-expected-output mas01mc@340: echo testfeature2 1 >> test-expected-output mas01mc@340: echo testfeature3 1 >> test-expected-output mas01mc@340: cmp testoutput test-expected-output mas01mc@340: mas01mc@340: ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testpower -e -R 1 > testoutput mas01mc@340: echo testfeature1 3 > test-expected-output mas01mc@340: echo testfeature2 3 >> test-expected-output mas01mc@340: echo testfeature3 3 >> test-expected-output mas01mc@340: cmp testoutput test-expected-output mas01mc@340: mas01mc@340: ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testpower -e -R 1 --lsh_exact > testoutput mas01mc@340: echo testfeature1 3 > test-expected-output mas01mc@340: echo testfeature2 3 >> test-expected-output mas01mc@340: echo testfeature3 3 >> test-expected-output mas01mc@340: cmp testoutput test-expected-output mas01mc@340: mas01mc@340: mas01mc@340: exit 104