Changeset 14487

Show
Ignore:
Timestamp:
06.09.2007 13:16:34 (12 years ago)
Author:
xiao
Message:

wrapper class split out from MGPPWrapper.java.

Location:
indexers/trunk/mgpp/java/org/greenstone/mgpp
Files:
2 copied

Legend:

Unmodified
Added
Removed
  • indexers/trunk/mgpp/java/org/greenstone/mgpp/MGPPRetrieveWrapper.java

    r13481 r14487  
    1  
     1/* 
     2 *    MGPPRetrieveWrapper.java 
     3 *    Copyright (C) 2002 New Zealand Digital Library, http://www.nzdl.org 
     4 * 
     5 *    This program is free software; you can redistribute it and/or modify 
     6 *    it under the terms of the GNU General Public License as published by 
     7 *    the Free Software Foundation; either version 2 of the License, or 
     8 *    (at your option) any later version. 
     9 * 
     10 *    This program is distributed in the hope that it will be useful, 
     11 *    but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     13 *    GNU General Public License for more details. 
     14 * 
     15 *    You should have received a copy of the GNU General Public License 
     16 *    along with this program; if not, write to the Free Software 
     17 *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
     18 */ 
    219package org.greenstone.mgpp; 
    320 
     
    1330 *@see MGPPQueryResult 
    1431 */ 
    15 public class MGPPWrapper { 
     32public class MGPPRetrieveWrapper { 
    1633   
    1734    /** the query result 
     
    2441 
    2542    static { 
    26     System.loadLibrary("mgppjni"); 
     43    System.loadLibrary("mgppretrievejni"); 
    2744    initIDs(); 
    2845    } 
    2946     
    30     public MGPPWrapper() { 
     47    public MGPPRetrieveWrapper() { 
    3148    mgpp_query_result_ = new MGPPQueryResult(); 
    3249    initCppSide(); 
     
    3552    /** initialises field and method IDs for java side to enable access on 
    3653    C++ side */ 
     54    //these two init methods and the load and unload methods are shared by search and retrieve 
    3755    private static native void initIDs(); 
    3856 
     
    6785 
    6886    // query param methods 
    69  
    70     /** if on=true, sets default stemming on  - its off by default*/ 
    71     public native void setStem(boolean on); 
    72      
    73     /** if on=true, sets default accentfolding on  - its off by default*/ 
    74     public native void setAccentFold(boolean on); 
    75  
    76    /** if on=true, sets default casefolding on - its off by default */ 
    77    public native void setCase(boolean on); 
    78     /** default is 50 */ 
    79     public native void setMaxDocs(int num); 
    80     /** if on=true, sorts by rank, otherwise returns in build order -  
    81     default is on */ 
    82     public native void setSortByRank(boolean on); 
    83     /** if on=true, a query returns term freq info - default is on */ 
    84     public native void setReturnTerms(boolean on); 
    85     /** sets the granularity of the  query  - default 'Document' */ 
    86     public native void setQueryLevel(String level); 
    87     /** sets the granularity of the result - default 'Document' */ 
    88     public native void setReturnLevel(String level); 
    89     /** sets the default boolean operator - AND(=1)/OR(=0) */ 
    90     public native void setMatchMode(int mode); 
    91  
    92     /** sets maxnumeric */ 
    93     public native void setMaxNumeric(int maxnumeric); 
    94     /** returns a string with all the current query param settings */ 
    95     public native String getQueryParams(); 
    96  
    97     /** actually carry out the query. Use the set methods to set any query 
    98     params  
    99     * writes the result to query_result 
    100     */ 
    101     public native void runQuery(String query_string);  
    102  
    103     /** get the result out of the wrapper */ 
    104     public MGPPQueryResult getQueryResult() { 
    105     return mgpp_query_result_; 
    106     } 
    107      
     87// 
     88//    /** if on=true, sets default stemming on  - its off by default*/ 
     89//    public native void setStem(boolean on); 
     90//     
     91//    /** if on=true, sets default accentfolding on  - its off by default*/ 
     92//    public native void setAccentFold(boolean on); 
     93// 
     94//   /** if on=true, sets default casefolding on - its off by default */ 
     95//   public native void setCase(boolean on); 
     96//    /** default is 50 */ 
     97//    public native void setMaxDocs(int num); 
     98//    /** if on=true, sorts by rank, otherwise returns in build order -  
     99//  default is on */ 
     100//    public native void setSortByRank(boolean on); 
     101//    /** if on=true, a query returns term freq info - default is on */ 
     102//    public native void setReturnTerms(boolean on); 
     103//    /** sets the granularity of the  query  - default 'Document' */ 
     104//    public native void setQueryLevel(String level); 
     105//    /** sets the granularity of the result - default 'Document' */ 
     106//    public native void setReturnLevel(String level); 
     107//    /** sets the default boolean operator - AND(=1)/OR(=0) */ 
     108//    public native void setMatchMode(int mode); 
     109// 
     110//    /** sets maxnumeric */ 
     111//    public native void setMaxNumeric(int maxnumeric); 
     112//    /** returns a string with all the current query param settings */ 
     113//    public native String getQueryParams(); 
     114// 
     115//    /** actually carry out the query. Use the set methods to set any query 
     116//  params  
     117//    * writes the result to query_result 
     118//    */ 
     119//    public native void runQuery(String query_string);  
     120// 
     121//    /** get the result out of the wrapper */ 
     122//    public MGPPQueryResult getQueryResult() { 
     123//  return mgpp_query_result_; 
     124//    } 
     125//     
    108126} 
  • indexers/trunk/mgpp/java/org/greenstone/mgpp/MGPPSearchWrapper.java

    r13481 r14487  
    1  
     1/* 
     2 *    MGPPSearchWrapper.java 
     3 *    Copyright (C) 2002 New Zealand Digital Library, http://www.nzdl.org 
     4 * 
     5 *    This program is free software; you can redistribute it and/or modify 
     6 *    it under the terms of the GNU General Public License as published by 
     7 *    the Free Software Foundation; either version 2 of the License, or 
     8 *    (at your option) any later version. 
     9 * 
     10 *    This program is distributed in the hope that it will be useful, 
     11 *    but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     13 *    GNU General Public License for more details. 
     14 * 
     15 *    You should have received a copy of the GNU General Public License 
     16 *    along with this program; if not, write to the Free Software 
     17 *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
     18 */ 
    219package org.greenstone.mgpp; 
    320 
     
    1330 *@see MGPPQueryResult 
    1431 */ 
    15 public class MGPPWrapper { 
     32public class MGPPSearchWrapper { 
    1633   
    1734    /** the query result 
     
    2441 
    2542    static { 
    26     System.loadLibrary("mgppjni"); 
     43    System.loadLibrary("mgppsearchjni"); 
    2744    initIDs(); 
    2845    } 
    2946     
    30     public MGPPWrapper() { 
     47    public MGPPSearchWrapper() { 
    3148    mgpp_query_result_ = new MGPPQueryResult(); 
    3249    initCppSide(); 
     
    4562     * returns the doc in utf-8 
    4663     */ 
    47     public native String getDocument(String text_path, 
    48                      String level, 
    49                      long docnum ); 
     64    //only this method is for search purpose 
     65//    public native String getDocument(String text_path, 
     66//                   String level, 
     67//                   long docnum ); 
    5068 
    5169    /** the public method - converts between utf-8 and unicode