Changeset 2252


Ignore:
Timestamp:
2001-04-02T17:52:03+12:00 (23 years ago)
Author:
daven
Message:

added stemming and cas folding options.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/SearchPanel.java

    r2251 r2252  
    6565  JButton searchButton;
    6666  JComboBox collectionList; 
    67   JPanel queryFormulationPanel, resultsPanel, dataPanel;
     67  JPanel queryFormulationPanel, resultsPanel, dataPanel, optionsPanel;
    6868  JPanel collectionListPanel, searchTextFieldPanel, searchButtonPanel;
    6969  JList   resultsList;   
     70    JCheckBox stemCheckBox, caseFoldCheckBox;
    7071  JScrollPane scrollResultsPane;
    7172  JScrollPane scrollDataPane;
     
    138139    searchTextFieldPanel.add(searchTextField);
    139140
     141    optionsPanel = new JPanel();
     142    stemCheckBox = new JCheckBox("Stemming", true);
     143    stemCheckBox.setToolTipText("Strip endings such as '...ing', '...ed'");
     144    caseFoldCheckBox = new JCheckBox("Match case", false);
     145    caseFoldCheckBox.setToolTipText("Only match when the case is the same");
     146    optionsPanel.add(stemCheckBox);
     147    optionsPanel.add(caseFoldCheckBox);
     148
    140149    searchButtonPanel = new JPanel();
    141150    searchButtonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
     151    searchButtonPanel.add(optionsPanel);
    142152    searchButtonPanel.add(searchButton);
    143153
     
    209219      //send query to collection
    210220      NzdlQuery nzdlQuery = new NzdlQuery(queryString);
     221
     222      // set options
     223      nzdlQuery.setStemming((new Boolean(stemCheckBox.isSelected())).toString());
     224      String folding = "false";
     225      if (caseFoldCheckBox.isSelected())
     226                 folding = "true";
     227      // interface reverses underlying logic so negate UI element state
     228      nzdlQuery.setCaseFolding(! caseFoldCheckBox.isSelected());
     229
    211230      // return the first numResults that match
    212231      nzdlQuery.setEndResults( -1 );
    213232      // "-1" means consider all the documents that match
    214233      nzdlQuery.setMaxDocs( -1 );
     234
     235
    215236      NzdlRequest request = new NzdlRequest( nzdlQuery );
    216237      NzdlResponse response = new NzdlResponse();
Note: See TracChangeset for help on using the changeset viewer.