-matchcase programatically does not work (no search output but vector found), cli works though...

8 views
Skip to first unread message

Michael Ruepp

unread,
Jul 30, 2015, 4:48:48 AM7/30/15
to Semantic Vectors
Hi,

I try to construct a query with matchcase to get all terms relevant to a specific doc. But the query is not working programatically, only from cli... Thanks for any Input, Michael

From my code I call:

        ArrayList<String> arguments = new ArrayList<String>();
        arguments.add("-queryvectorfile");
        arguments.add(docvectorfile.toString());
        arguments.add("-searchvectorfile");
        arguments.add(termvectorfile.toString());
        arguments.add("-matchcase");
        arguments.add(theFile.toString());

String[] args = new String[arguments.size()];
        args = arguments.toArray(args);

        for (String aarg : args) {
            logger.debug("The Args: " + aarg);
        }

try {
            logger.debug("Search");
            Search.main(args);
        } catch (IOException e) {
            e.printStackTrace();
        }


I also tried with:

        List<SearchResult> theResult;
        FlagConfig flagConfig;
        try {
            flagConfig = FlagConfig.getFlagConfig(args);
            theResult = Search.runSearch(flagConfig)
        } catch (IllegalArgumentException e) {
            //System.err.println(usageMessage);
            throw e;
        }

and get this output:

(The Args is the list of the String[] which is the args String Array

2015-07-30 10:39:17 DEBUG MainGui:2907 - The Args: -queryvectorfile
2015-07-30 10:39:17 DEBUG MainGui:2907 - The Args: /Volumes/Home/Users/michael/Desktop/complsaTestData/Test2/luceneIndexFiles/bible_chapters/Standard-doc-None.bin
2015-07-30 10:39:17 DEBUG MainGui:2907 - The Args: -searchvectorfile
2015-07-30 10:39:17 DEBUG MainGui:2907 - The Args: /Volumes/Home/Users/michael/Desktop/complsaTestData/Test2/luceneIndexFiles/bible_chapters/Standard-term-None.bin
2015-07-30 10:39:17 DEBUG MainGui:2907 - The Args: -matchcase
2015-07-30 10:39:17 DEBUG MainGui:2907 - The Args: /Volumes/Home/Users/michael/Desktop/complsaTestData/Test2/TopicCorp/bible_chapters/Genesis/Chapter_22-en/0-20-Chapter_22-en.txt
2015-07-30 10:39:17 DEBUG MainGui:2922 - Search
Opening query vector store from file: /Volumes/Home/Users/michael/Desktop/complsaTestData/Test2/luceneIndexFiles/bible_chapters/Standard-doc-None.bin
Opening search vector store from file: /Volumes/Home/Users/michael/Desktop/complsaTestData/Test2/luceneIndexFiles/bible_chapters/Standard-term-None.bin
Searching term vectors, searchtype SUM
Found vector for '/Volumes/Home/Users/michael/Desktop/complsaTestData/Test2/TopicCorp/bible_chapters/Genesis/Chapter_22-en/0-20-Chapter_22-en.txt'
No search output.


When I construct the same search in the shell, following happens:

sunrise:complsaTestData michael$ java -cp ./semanticvectors-5.8.jar pitt.search.semanticvectors.Search -queryvectorfile ./Test2/luceneIndexFiles/bible_chapters/Standard-doc-None.bin -searchvectorfile ./Test2/luceneIndexFiles/bible_chapters/Standard-term-None.bin -matchcase /Volumes/Home/Users/michael/Desktop/complsaTestData/Test2/TopicCorp/bible_chapters/Genesis/Chapter_22-en/0-20-Chapter_22-en.txt 
Opening query vector store from file: ./Test2/luceneIndexFiles/bible_chapters/Standard-doc-None.bin
Opening search vector store from file: ./Test2/luceneIndexFiles/bible_chapters/Standard-term-None.bin
Searching term vectors, searchtype SUM
Found vector for '/Volumes/Home/Users/michael/Desktop/complsaTestData/Test2/TopicCorp/bible_chapters/Genesis/Chapter_22-en/0-20-Chapter_22-en.txt'
Search output follows ...
0,998644:before
0,998572:unto
0,998572:day
0,998543:after
0,998530:out
0,998508:which
0,998507:his
0,998493:them
0,998472:all
0,998421:so
0,998400:when
0,998319:he
0,998296:saying
0,998290:said
0,998277:from
0,998253:him
0,998230:until
0,998213:place
0,998207:one
0,998187:go


I use:
        <dependency>
            <groupId>pitt.search</groupId>
            <artifactId>semanticvectors</artifactId>
            <version>5.8</version>
        </dependency>

Dominic

unread,
Jul 31, 2015, 12:21:22 PM7/31/15
to Semantic Vectors, mru...@gmail.com
Sorry, this is strange and I'm unlikely to have time to investigate for at least a few days.

A couple of things you could try include:
- Compiling from source and running in debug mode with breakpoints (this is what I'll do when I have time).
- Using -searchtype printquery to see if at least the same queryvector is printed out each time. This would at least tell you if the problem is before or after you start looking at the term vectors.

Best wishes,
Dominic
Reply all
Reply to author
Forward
0 new messages