Skip to content

Instantly share code, notes, and snippets.

Created Apr 4, 2017
Embed
What would you like to do?
some description
#!/bin/bash -x
# directory with txt files
INPUT=./testinput
LOWER=krankenkassen
UPPER=Krankenkassen
mkdir ${INPUT}
# store one lowercase word
echo ${LOWER} > ${INPUT}/lower.txt
# who am i
omindex --version
quest --version
# clean up database 8)
rm -rf testdb
# create omega index, url doesn't matter
omindex --verbose --db=testdb --url=/bla ${INPUT}
# query database for word in Upper and lower case
quest --db=testdb ${UPPER} | tee test-nostem.out
quest --db=testdb ${LOWER} | tee -a test-nostem.out
# should have been fine.
# now ... clean up the database 8)
rm -rf testdb
# create omega index, use german stemmer
omindex --verbose --db=testdb --url=/bla --stemmer=german ${INPUT}
# try again and query database for word in Upper and lower case
quest --db=testdb ${UPPER} | tee test-stem.out
quest --db=testdb ${LOWER} | tee -a test-stem.out
# the 'lower case' one should fail. which is weird.
diff test-nostem.out test-stem.out
@wwwutz

This comment has been minimized.

Copy link

@wwwutz wwwutz commented Apr 4, 2017

And the output:

+ INPUT=./testinput
+ LOWER=krankenkassen
+ UPPER=Krankenkassen
+ mkdir ./testinput
mkdir: cannot create directory ‘./testinput’: File exists
+ echo krankenkassen
+ omindex --version
omindex - xapian-omega 1.4.3
+ quest --version
quest - xapian-core 1.4.3
+ rm -rf testdb
+ omindex --verbose --db=testdb --url=/bla ./testinput
[Entering directory ""]
Indexing "lower.txt" as text/plain ... added
+ quest --db=testdb Krankenkassen
+ tee test-nostem.out
Parsed Query: Query(krankenkassen@1)
MSet:
1: [0.154151]
url=/bla/lower.txt
sample=krankenkassen 
type=text/plain
modtime=1491300443
size=14
+ quest --db=testdb krankenkassen
+ tee -a test-nostem.out
Parsed Query: Query(Zkrankenkassen@1)
MSet:
1: [0.154151]
url=/bla/lower.txt
sample=krankenkassen 
type=text/plain
modtime=1491300443
size=14
+ rm -rf testdb
+ omindex --verbose --db=testdb --url=/bla --stemmer=german ./testinput
[Entering directory ""]
Indexing "lower.txt" as text/plain ... added
+ quest --db=testdb Krankenkassen
+ tee test-stem.out
Parsed Query: Query(krankenkassen@1)
MSet:
1: [0.154151]
url=/bla/lower.txt
sample=krankenkassen 
type=text/plain
modtime=1491300443
size=14
+ quest --db=testdb krankenkassen
+ tee -a test-stem.out
Parsed Query: Query(Zkrankenkassen@1)
MSet:
+ diff test-nostem.out test-stem.out
11,16d10
< 1: [0.154151]
< url=/bla/lower.txt
< sample=krankenkassen 
< type=text/plain
< modtime=1491300443
< size=14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment