Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
IOffsetAttribute.cs
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 using System;
19 using Lucene.Net.Util;
20 
21 namespace Lucene.Net.Analysis.Tokenattributes
22 {
23 
24  /// <summary> The start and end character offset of a Token. </summary>
25  public interface IOffsetAttribute : IAttribute
26  {
27  /// <summary>Returns this Token's starting offset, the position of the first character
28  /// corresponding to this token in the source text.
29  /// Note that the difference between endOffset() and startOffset() may not be
30  /// equal to termText.length(), as the term text may have been altered by a
31  /// stemmer or some other filter.
32  /// </summary>
33  int StartOffset { get; }
34 
35 
36  /// <summary>Set the starting and ending offset.
37  /// See StartOffset() and EndOffset()
38  /// </summary>
39  void SetOffset(int startOffset, int endOffset);
40 
41 
42  /// <summary>Returns this Token's ending offset, one greater than the position of the
43  /// last character corresponding to this token in the source text. The length
44  /// of the token in the source text is (endOffset - startOffset).
45  /// </summary>
46  int EndOffset { get; }
47  }
48 }