[jsword-svn] r1751 - in trunk: bibledesktop/src/main/resources/xsl/cswing jsword/src/main/java/org/crosswire/jsword/index/lucene

dmsmith at www.crosswire.org dmsmith at www.crosswire.org
Wed Feb 6 19:00:55 MST 2008


Author: dmsmith
Date: 2008-02-06 19:00:54 -0700 (Wed, 06 Feb 2008)
New Revision: 1751

Modified:
   trunk/bibledesktop/src/main/resources/xsl/cswing/simple.xsl
   trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/IndexMetadata.properties
   trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/LuceneIndex.java
Log:
Added prefixed wild-card search
Show Strong's Numbers and Morphology directly.

Modified: trunk/bibledesktop/src/main/resources/xsl/cswing/simple.xsl
===================================================================
--- trunk/bibledesktop/src/main/resources/xsl/cswing/simple.xsl	2008-02-05 17:48:31 UTC (rev 1750)
+++ trunk/bibledesktop/src/main/resources/xsl/cswing/simple.xsl	2008-02-07 02:00:54 UTC (rev 1751)
@@ -594,10 +594,12 @@
     </xsl:variable>
     <xsl:choose>
       <xsl:when test="$separator = ''">
-        <sub class="strongs"><a href="{$protocol}{$orig-lemma}">S<xsl:number level="any" from="/osis//verse" format="1"/><xsl:number value="$sub" format="a"/></a></sub>
+        <!-- <sub class="strongs"><a href="{$protocol}{$orig-lemma}">S<xsl:number level="any" from="/osis//verse" format="1"/><xsl:number value="$sub" format="a"/></a></sub> -->
+        <sub class="strongs"><a href="{$protocol}{$orig-lemma}"><xsl:value-of select="format-number(substring($orig-lemma,2),'#')"/></a></sub>
       </xsl:when>
       <xsl:otherwise>
-        <sub class="strongs"><a href="{$protocol}{substring-before($orig-lemma, $separator)}">S<xsl:number level="single" from="/osis//verse" format="1"/><xsl:number value="$sub" format="a"/></a>, </sub>
+        <!-- <sub class="strongs"><a href="{$protocol}{substring-before($orig-lemma, $separator)}">S<xsl:number level="single" from="/osis//verse" format="1"/><xsl:number value="$sub" format="a"/></a>, </sub> -->
+        <sub class="strongs"><a href="{$protocol}{substring-before($orig-lemma, $separator)}"><xsl:value-of select="format-number(substring(substring-before($orig-lemma, $separator),2),'#')"/></a>, </sub>
         <xsl:call-template name="lemma">
           <xsl:with-param name="lemma" select="substring-after($lemma, $separator)"/>
           <xsl:with-param name="part">
@@ -652,10 +654,12 @@
     </xsl:variable>
     <xsl:choose>
       <xsl:when test="$separator = ''">
-        <sub class="morph"><a href="{$protocol}{$orig-morph}">M<xsl:number level="any" from="/osis//verse" format="1"/><xsl:number value="$sub" format="a"/></a></sub>
+        <!-- <sub class="morph"><a href="{$protocol}{$orig-morph}">M<xsl:number level="any" from="/osis//verse" format="1"/><xsl:number value="$sub" format="a"/></a></sub> -->
+        <sub class="morph"><a href="{$protocol}{$orig-morph}"><xsl:value-of select="$orig-morph"/></a></sub>
       </xsl:when>
       <xsl:otherwise>
-        <sub class="morph"><a href="{$protocol}{substring-before($orig-morph, $separator)}">M<xsl:number level="single" from="/osis//verse" format="1"/><xsl:number value="$sub" format="a"/></a>, </sub>
+        <!-- <sub class="morph"><a href="{$protocol}{substring-before($orig-morph, $separator)}">M<xsl:number level="single" from="/osis//verse" format="1"/><xsl:number value="$sub" format="a"/></a>, </sub> -->
+        <sub class="morph"><a href="{$protocol}{substring-before($orig-morph, $separator)}"><xsl:value-of select="substring-before($orig-morph, $separator)"/></a>, </sub>
         <xsl:call-template name="morph">
           <xsl:with-param name="morph" select="substring-after($morph, $separator)"/>
           <xsl:with-param name="part">

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/IndexMetadata.properties
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/IndexMetadata.properties	2008-02-05 17:48:31 UTC (rev 1750)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/IndexMetadata.properties	2008-02-07 02:00:54 UTC (rev 1751)
@@ -1,18 +1,4 @@
-# Format Description: Each key is a meta-data about the LuceneIndex
-#    All version numbers should be one decimal precision floats
 
-# Index Version History/Details:
-#   1.0 : Original index format. Uses: fields = key,content; Analyzer = SimpleAnalyzer
-#   1.1 : Added field = strong, heading, xref, note
-#   1.2 : Added natural language analysis (Stemming, CJK tokenization, optionally Stopword) for field = content
-#         Uses AnalyzerFactory.properties to configure Analyzers
-
-# Index Version that is installed
 Installed.Index.Version=1.1
-
-#Not used right now
 Latest.Index.Version=1.2
-
-#Not used right now
-Lucene.Version=2.2
-
+Lucene.Version=2.3

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/LuceneIndex.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/LuceneIndex.java	2008-02-05 17:48:31 UTC (rev 1750)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/LuceneIndex.java	2008-02-07 02:00:54 UTC (rev 1751)
@@ -211,6 +211,7 @@
                 Analyzer analyzer = new LuceneAnalyzer(bookLang);
 
                 QueryParser parser = new QueryParser(LuceneIndex.FIELD_BODY, analyzer);
+                parser.setAllowLeadingWildcard(true);
                 Query query = parser.parse(search);
                 log.info("ParsedQuery-" + query.toString()); //$NON-NLS-1$
                 Hits hits = searcher.search(query);




More information about the jsword-svn mailing list