First post!
[beagle.git] / Lucene.Net / Analysis / LowerCaseFilter.cs
blob82a2c70b590c612381cfec1024e8b0076298cc78
1 using System;
3 namespace Lucene.Net.Analysis
5 /* ====================================================================
6 * The Apache Software License, Version 1.1
8 * Copyright (c) 2001 The Apache Software Foundation. All rights
9 * reserved.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in
20 * the documentation and/or other materials provided with the
21 * distribution.
23 * 3. The end-user documentation included with the redistribution,
24 * if any, must include the following acknowledgment:
25 * "This product includes software developed by the
26 * Apache Software Foundation (http://www.apache.org/)."
27 * Alternately, this acknowledgment may appear in the software itself,
28 * if and wherever such third-party acknowledgments normally appear.
30 * 4. The names "Apache" and "Apache Software Foundation" and
31 * "Apache Lucene" must not be used to endorse or promote products
32 * derived from this software without prior written permission. For
33 * written permission, please contact apache@apache.org.
35 * 5. Products derived from this software may not be called "Apache",
36 * "Apache Lucene", nor may "Apache" appear in their name, without
37 * prior written permission of the Apache Software Foundation.
39 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
40 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
41 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
42 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
45 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
46 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
47 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
48 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
49 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50 * SUCH DAMAGE.
51 * ====================================================================
53 * This software consists of voluntary contributions made by many
54 * individuals on behalf of the Apache Software Foundation. For more
55 * information on the Apache Software Foundation, please see
56 * <http://www.apache.org/>.
59 /// <summary>
60 /// Normalizes token text to lower case.
61 /// </summary>
62 /// <version>$Id: LowerCaseFilter.cs,v 1.1.1.1 2004/04/29 22:53:51 trow Exp $</version>
63 public sealed class LowerCaseFilter : TokenFilter
65 public LowerCaseFilter(TokenStream _in) : base(_in)
69 public override Token Next()
71 Token t = input.Next();
73 if (t == null)
74 return null;
76 t.termText = t.termText.ToLower();
78 return t;