1Xapian::TermGenerator(3U)ser Contributed Perl DocumentatiXoanpian::TermGenerator(3)
2
3
4
6 Search::Xapian::TermGenerator - Parses a piece of text and generates
7 terms.
8
10 This module takes a piece of text and parses it to produce words which
11 are then used to generate suitable terms for indexing. The terms
12 generated are suitable for use with Search::Xapian::Query objects
13 produced by the Search::Xapian::QueryParser class.
14
16 use Search::Xapian;
17
18 my $doc = new Search::Xapian::Document();
19 my $tg = new Search::Xapian::TermGenerator();
20 $tg->set_stemmer(new Search::Xapian::Stem("english"));
21 $tg->set_document($doc);
22 $tg->index_text("The cat sat on the mat");
23
25 new TermGenerator constructor.
26
27 set_stemmer <stemmer>
28 Set the Search::Xapian::Stem object to be used for generating
29 stemmed terms.
30
31 set_stopper <stopper>
32 Set the Search::Xapian::Stopper object to be used for identifying
33 stopwords.
34
35 set_document <document>
36 Set the Search::Xapian::Document object to index terms into.
37
38 get_document <document>
39 Get the currently set Search::Xapian::Document object.
40
41 index_text <text> [<weight> [<prefix>]]
42 Indexes the text in string <text>. The optional parameter <weight>
43 sets the wdf increment (default 1). The optional parameter
44 <prefix> sets the term prefix to use (default is no prefix).
45
46 index_text_without_positions <text> [<weight> [<prefix>]]
47 Just like index_text, but no positional information is generated.
48 This means that the database will be significantly smaller, but
49 that phrase searching and NEAR won't be supported.
50
51 increase_termpos [<delta>]
52 Increase the termpos used by index_text by <delta> (default 100).
53
54 This can be used to prevent phrase searches from spanning two
55 unconnected blocks of text (e.g. the title and body text).
56
57 get_termpos
58 Get the current term position.
59
60 set_termpos <termpos>
61 Set the current term position.
62
63 get_description
64 Return a description of this object.
65
67 http://www.xapian.org/docs/sourcedoc/html/classXapian_1_1TermGenerator.html
68
69
70
71perl v5.12.0 2010-04-27 Xapian::TermGenerator(3)