1KinoSearch1::Analysis::UTsoekrenCBoanttcrhi(b3u)ted PerlKiDnoocSuemaernctha1t:i:oAnnalysis::TokenBatch(3)
2
3
4
5Add many tokens to the batch, by supplying the string to be tokenized, and
6arrays of token starts and token ends (specified in bytes).
7
9 KinoSearch1::Analysis::TokenBatch - a collection of tokens
10
12 while ( $batch->next ) {
13 $batch->set_text( lc( $batch->get_text ) );
14 }
15
17 TokenBatch's API should be considered experimental and is likely to
18 change.
19
21 A TokenBatch is a collection of Tokens which you can add to, then
22 iterate over.
23
25 new
26 my $batch = KinoSearch1::Analysis::TokenBatch->new;
27
28 Constructor.
29
30 append
31 $batch->append( $text, $start_offset, $end_offset, $pos_inc );
32
33 Add a Token to the end of the batch. Accepts either three or four
34 arguments: text, start_offset, end_offset, and an optional position
35 increment which defaults to 1 if not supplied. For a description of
36 what these arguments mean, see the docs for Token.
37
38 next
39 while ( $batch->next ) {
40 # ...
41 }
42
43 Proceed to the next token in the TokenBatch. Returns true if the
44 TokenBatch ends up located at valid token.
45
47 All of TokenBatch's accessor methods affect the current Token. Calling
48 any of these methods when the TokenBatch is not located at a valid
49 Token will trigger an exception.
50
51 set_text get_text
52 Set/get the text of the current Token.
53
54 set_start_offset get_start_offset
55 Set/get the start_offset of the current Token.
56
57 set_end_offset get_end_offset
58 Set/get the end_offset of the current Token.
59
60 set_pos_inc get_pos_inc
61 Set/get the position increment of the current Token.
62
64 Copyright 2005-2010 Marvin Humphrey
65
67 See KinoSearch1 version 1.01.
68
69
70
71perl v5.36.0 2023-01-2K0inoSearch1::Analysis::TokenBatch(3)