Author: j16sdiz
Date: 2008-12-22 12:37:25 +0000 (Mon, 22 Dec 2008)
New Revision: 24742

Modified:
   trunk/plugins/XMLLibrarian/LibrarianHandler.java
Log:
fix searching (and some optimization too!)

Modified: trunk/plugins/XMLLibrarian/LibrarianHandler.java
===================================================================
--- trunk/plugins/XMLLibrarian/LibrarianHandler.java    2008-12-22 12:23:22 UTC 
(rev 24741)
+++ trunk/plugins/XMLLibrarian/LibrarianHandler.java    2008-12-22 12:37:25 UTC 
(rev 24742)
@@ -28,9 +28,12 @@
                /** file id -> title */
                private HashMap<String, String> titles;
                private List<URIWrapper> fileuris;
+               private String md5;
 
                public LibrarianHandler(String word, List<URIWrapper> fileuris) 
throws Exception {
                        this.fileuris = fileuris;
+                       this.word = word;
+                       md5 = XMLLibrarian.MD5(word);
                }
                public void setDocumentLocator(Locator value) {
 
@@ -56,13 +59,12 @@
                        }
                        if(elt_name.equals("subIndex")){
                                try{
-                                       String md5 = XMLLibrarian.MD5(word);
                                        //here we need to match and see if any 
of the subindices match the required substring of the word.
                                        for(int i=0;i<prefix;i++){
                                                
if((md5.substring(0,prefix-i)).equals(attrs.getValue("key"))){ 
                                                        prefixMatch = 
md5.substring(0, prefix - i);
                                                Logger.normal(this, "match 
found " + prefixMatch);
-                                               Logger.minor(this, "word 
searched = " + word + " prefix matcheed = " + getPrefixMatch());
+                                               Logger.minor(this, "word 
searched = " + word + " prefix matcheed = " + prefixMatch);
                                                        break;
                                                }
                                        }

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to