source: gsdl/trunk/trunk/mg/java/org/greenstone/mg/MGTermInfo.java@ 16583

Last change on this file since 16583 was 16583, checked in by davidb, 16 years ago

Undoing change commited in r16582

  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1/*
2 * MGTermInfo.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 */
19package org.greenstone.mg;
20
21
22import java.util.Vector;
23
24
25/** TermInfo 'struct' class for a search result from mg
26 * used by MGQueryResult
27 *
28 * @see MGQueryResult
29 */
30public class MGTermInfo
31{
32 /** the term itself */
33 public String term_ = null;
34
35 /** the stem and casefold method used
36 0 = none
37 1 = casefold only
38 2 = stem only
39 3 = casefold and stem */
40 public int stem_method_ = 0;
41
42 /** list of stemmed and casefolded equivalent terms - if stem_method_ is non-zero
43 - Vector of Strings */
44 public Vector equiv_terms_ = null;
45
46
47 public MGTermInfo()
48 {
49 equiv_terms_ = new Vector();
50 }
51
52
53 public void addEquivTerm(String equivTerm, long match, long freq)
54 {
55 equiv_terms_.add(new MGEquivTermInfo(equivTerm, match, freq));
56 }
57
58
59 /** output the class as a string */
60 public String toString()
61 {
62 String result = "\"" + term_ + "\"";
63 result += " stem(" + stem_method_ + ")";
64 result += " equiv terms(";
65 for (int i = 0; i < equiv_terms_.size(); i++) {
66 if (i > 0) result += ", ";
67 result += equiv_terms_.elementAt(i);
68 }
69 result += ")";
70 return result;
71 }
72}
Note: See TracBrowser for help on using the repository browser.