You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ar...@apache.org on 2007/05/01 20:45:35 UTC
svn commit: r534192 [2/19] - in /incubator/lucene.net/trunk/C#: ./ src/
src/Demo/ src/Demo/DeleteFiles/ src/Demo/DemoLib/ src/Demo/DemoLib/HTML/
src/Demo/IndexFiles/ src/Demo/IndexHtml/ src/Demo/SearchFiles/
src/Lucene.Net/ src/Lucene.Net/Analysis/ src...
Modified: incubator/lucene.net/trunk/C#/src/Demo/DemoLib/HTMLDocument.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Demo/DemoLib/HTMLDocument.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Demo/DemoLib/HTMLDocument.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Demo/DemoLib/HTMLDocument.cs Tue May 1 11:45:26 2007
@@ -16,6 +16,7 @@
*/
using System;
+
using HTMLParser = Lucene.Net.Demo.Html.HTMLParser;
using Lucene.Net.Documents;
@@ -34,7 +35,7 @@
// sorting gives the same results as a walk of the file hierarchy. Thus
// null (\u0000) is used both to separate directory components and to
// separate the path from the date.
- return f.FullName.Replace(dirSep, '\u0000') + "\u0000" + DateTools.TimeToString(((f.LastWriteTime.Ticks - 621355968000000000) / 10000), DateTools.Resolution.SECOND);
+ return f.FullName.Replace(dirSep, '\u0000') + "\u0000" + DateTools.TimeToString(f.LastWriteTime.Millisecond, DateTools.Resolution.SECOND);
}
public static System.String Uid2url(System.String uid)
@@ -55,7 +56,7 @@
// Add the last modified date of the file a field named "modified".
// Use a field that is indexed (i.e. searchable), but don't tokenize
// the field into words.
- doc.Add(new Field("modified", DateTools.TimeToString(((f.LastWriteTime.Ticks - 621355968000000000) / 10000), DateTools.Resolution.MINUTE), Field.Store.YES, Field.Index.UN_TOKENIZED));
+ doc.Add(new Field("modified", DateTools.TimeToString(f.LastWriteTime.Millisecond, DateTools.Resolution.MINUTE), Field.Store.YES, Field.Index.UN_TOKENIZED));
// Add the uid as a field, so that index can be incrementally maintained.
// This field is not stored with document, it is indexed, but it is not
Modified: incubator/lucene.net/trunk/C#/src/Demo/IndexFiles/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Demo/IndexFiles/AssemblyInfo.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Demo/IndexFiles/AssemblyInfo.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Demo/IndexFiles/AssemblyInfo.cs Tue May 1 11:45:26 2007
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
using System.Reflection;
using System.Runtime.CompilerServices;
@@ -16,7 +33,7 @@
[assembly: AssemblyDefaultAlias("Lucene.Net")]
[assembly: AssemblyCulture("")]
-[assembly: AssemblyInformationalVersionAttribute("2.0")]
+[assembly: AssemblyInformationalVersionAttribute("2.1")]
//
// Version information for an assembly consists of the following four values:
@@ -29,7 +46,7 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("2.0.0.003")]
+[assembly: AssemblyVersion("2.1.0.001")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
Added: incubator/lucene.net/trunk/C#/src/Demo/IndexFiles/IndexFiles-VS2005.csproj
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Demo/IndexFiles/IndexFiles-VS2005.csproj?view=auto&rev=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Demo/IndexFiles/IndexFiles-VS2005.csproj (added)
+++ incubator/lucene.net/trunk/C#/src/Demo/IndexFiles/IndexFiles-VS2005.csproj Tue May 1 11:45:26 2007
@@ -0,0 +1,110 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectType>Local</ProjectType>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{3E561192-4292-4998-BC67-8C1B82A56108}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ApplicationIcon>App.ico</ApplicationIcon>
+ <AssemblyKeyContainerName>
+ </AssemblyKeyContainerName>
+ <AssemblyName>IndexFiles</AssemblyName>
+ <AssemblyOriginatorKeyFile>
+ </AssemblyOriginatorKeyFile>
+ <DefaultClientScript>JScript</DefaultClientScript>
+ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
+ <DefaultTargetSchema>IE50</DefaultTargetSchema>
+ <DelaySign>false</DelaySign>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>IndexFiles</RootNamespace>
+ <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
+ <StartupObject>
+ </StartupObject>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <OutputPath>bin\Debug\</OutputPath>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <BaseAddress>285212672</BaseAddress>
+ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DocumentationFile>
+ </DocumentationFile>
+ <DebugSymbols>true</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <NoStdLib>false</NoStdLib>
+ <NoWarn>
+ </NoWarn>
+ <Optimize>false</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>full</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <OutputPath>bin\Release\</OutputPath>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <BaseAddress>285212672</BaseAddress>
+ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>TRACE</DefineConstants>
+ <DocumentationFile>IndexFiles.xml</DocumentationFile>
+ <DebugSymbols>false</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <NoStdLib>false</NoStdLib>
+ <NoWarn>
+ </NoWarn>
+ <Optimize>true</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>none</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Lucene.Net">
+ <Name>Lucene.Net</Name>
+ <HintPath>..\..\Lucene.Net\bin\Debug\Lucene.Net.dll</HintPath>
+ </Reference>
+ <Reference Include="System">
+ <Name>System</Name>
+ </Reference>
+ <Reference Include="System.Data">
+ <Name>System.Data</Name>
+ </Reference>
+ <Reference Include="System.Xml">
+ <Name>System.XML</Name>
+ </Reference>
+ <ProjectReference Include="..\DemoLib\DemoLib-VS2005.csproj">
+ <Name>DemoLib-VS2005</Name>
+ <Project>{F04CA2F4-E182-46A8-B914-F46AF5319E83}</Project>
+ <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="App.ico" />
+ <Compile Include="AssemblyInfo.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="IndexFiles.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PreBuildEvent>
+ </PreBuildEvent>
+ <PostBuildEvent>
+ </PostBuildEvent>
+ </PropertyGroup>
+</Project>
\ No newline at end of file
Modified: incubator/lucene.net/trunk/C#/src/Demo/IndexFiles/IndexFiles.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Demo/IndexFiles/IndexFiles.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Demo/IndexFiles/IndexFiles.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Demo/IndexFiles/IndexFiles.cs Tue May 1 11:45:26 2007
@@ -16,6 +16,7 @@
*/
using System;
+
using StandardAnalyzer = Lucene.Net.Analysis.Standard.StandardAnalyzer;
using IndexWriter = Lucene.Net.Index.IndexWriter;
@@ -77,7 +78,7 @@
writer.Close();
System.DateTime end = System.DateTime.Now;
- System.Console.Out.WriteLine(end.Ticks - start.Ticks + " total milliseconds");
+ System.Console.Out.WriteLine(end.Millisecond - start.Millisecond + " total milliseconds");
}
catch (System.IO.IOException e)
{
Modified: incubator/lucene.net/trunk/C#/src/Demo/IndexHtml/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Demo/IndexHtml/AssemblyInfo.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Demo/IndexHtml/AssemblyInfo.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Demo/IndexHtml/AssemblyInfo.cs Tue May 1 11:45:26 2007
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
using System.Reflection;
using System.Runtime.CompilerServices;
@@ -16,7 +33,7 @@
[assembly: AssemblyDefaultAlias("Lucene.Net")]
[assembly: AssemblyCulture("")]
-[assembly: AssemblyInformationalVersionAttribute("2.0")]
+[assembly: AssemblyInformationalVersionAttribute("2.1")]
//
// Version information for an assembly consists of the following four values:
@@ -29,7 +46,7 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("2.0.0.003")]
+[assembly: AssemblyVersion("2.1.0.001")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
Added: incubator/lucene.net/trunk/C#/src/Demo/IndexHtml/IndexHtml-VS2005.csproj
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Demo/IndexHtml/IndexHtml-VS2005.csproj?view=auto&rev=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Demo/IndexHtml/IndexHtml-VS2005.csproj (added)
+++ incubator/lucene.net/trunk/C#/src/Demo/IndexHtml/IndexHtml-VS2005.csproj Tue May 1 11:45:26 2007
@@ -0,0 +1,110 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectType>Local</ProjectType>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{2B86751C-0D3A-486E-A176-E995C63EB653}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ApplicationIcon>App.ico</ApplicationIcon>
+ <AssemblyKeyContainerName>
+ </AssemblyKeyContainerName>
+ <AssemblyName>IndexHtml</AssemblyName>
+ <AssemblyOriginatorKeyFile>
+ </AssemblyOriginatorKeyFile>
+ <DefaultClientScript>JScript</DefaultClientScript>
+ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
+ <DefaultTargetSchema>IE50</DefaultTargetSchema>
+ <DelaySign>false</DelaySign>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>IndexHtml</RootNamespace>
+ <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
+ <StartupObject>
+ </StartupObject>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <OutputPath>bin\Debug\</OutputPath>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <BaseAddress>285212672</BaseAddress>
+ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DocumentationFile>
+ </DocumentationFile>
+ <DebugSymbols>true</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <NoStdLib>false</NoStdLib>
+ <NoWarn>
+ </NoWarn>
+ <Optimize>false</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>full</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <OutputPath>bin\Release\</OutputPath>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <BaseAddress>285212672</BaseAddress>
+ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>TRACE</DefineConstants>
+ <DocumentationFile>IndexHtml.xml</DocumentationFile>
+ <DebugSymbols>false</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <NoStdLib>false</NoStdLib>
+ <NoWarn>
+ </NoWarn>
+ <Optimize>true</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>none</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Lucene.Net">
+ <Name>Lucene.Net</Name>
+ <HintPath>..\..\Lucene.Net\bin\Debug\Lucene.Net.dll</HintPath>
+ </Reference>
+ <Reference Include="System">
+ <Name>System</Name>
+ </Reference>
+ <Reference Include="System.Data">
+ <Name>System.Data</Name>
+ </Reference>
+ <Reference Include="System.Xml">
+ <Name>System.XML</Name>
+ </Reference>
+ <ProjectReference Include="..\DemoLib\DemoLib-VS2005.csproj">
+ <Name>DemoLib-VS2005</Name>
+ <Project>{F04CA2F4-E182-46A8-B914-F46AF5319E83}</Project>
+ <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="App.ico" />
+ <Compile Include="AssemblyInfo.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="IndexHtml.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PreBuildEvent>
+ </PreBuildEvent>
+ <PostBuildEvent>
+ </PostBuildEvent>
+ </PropertyGroup>
+</Project>
\ No newline at end of file
Modified: incubator/lucene.net/trunk/C#/src/Demo/IndexHtml/IndexHtml.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Demo/IndexHtml/IndexHtml.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Demo/IndexHtml/IndexHtml.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Demo/IndexHtml/IndexHtml.cs Tue May 1 11:45:26 2007
@@ -16,6 +16,7 @@
*/
using System;
+
using StandardAnalyzer = Lucene.Net.Analysis.Standard.StandardAnalyzer;
using Document = Lucene.Net.Documents.Document;
using IndexReader = Lucene.Net.Index.IndexReader;
@@ -95,7 +96,7 @@
System.DateTime end = System.DateTime.Now;
- System.Console.Out.Write(end.Ticks - start.Ticks);
+ System.Console.Out.Write(end.Millisecond - start.Millisecond);
System.Console.Out.WriteLine(" total milliseconds");
}
catch (System.Exception e)
Modified: incubator/lucene.net/trunk/C#/src/Demo/SearchFiles/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Demo/SearchFiles/AssemblyInfo.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Demo/SearchFiles/AssemblyInfo.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Demo/SearchFiles/AssemblyInfo.cs Tue May 1 11:45:26 2007
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
using System.Reflection;
using System.Runtime.CompilerServices;
@@ -16,7 +33,7 @@
[assembly: AssemblyDefaultAlias("Lucene.Net")]
[assembly: AssemblyCulture("")]
-[assembly: AssemblyInformationalVersionAttribute("2.0")]
+[assembly: AssemblyInformationalVersionAttribute("2.1")]
//
// Version information for an assembly consists of the following four values:
@@ -29,7 +46,7 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("2.0.0.003")]
+[assembly: AssemblyVersion("2.1.0.001")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
Added: incubator/lucene.net/trunk/C#/src/Demo/SearchFiles/SearchFiles-VS2005.csproj
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Demo/SearchFiles/SearchFiles-VS2005.csproj?view=auto&rev=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Demo/SearchFiles/SearchFiles-VS2005.csproj (added)
+++ incubator/lucene.net/trunk/C#/src/Demo/SearchFiles/SearchFiles-VS2005.csproj Tue May 1 11:45:26 2007
@@ -0,0 +1,110 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectType>Local</ProjectType>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{5CF56C9F-F8DF-471E-B73A-C736464948C0}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ApplicationIcon>App.ico</ApplicationIcon>
+ <AssemblyKeyContainerName>
+ </AssemblyKeyContainerName>
+ <AssemblyName>SearchFiles</AssemblyName>
+ <AssemblyOriginatorKeyFile>
+ </AssemblyOriginatorKeyFile>
+ <DefaultClientScript>JScript</DefaultClientScript>
+ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
+ <DefaultTargetSchema>IE50</DefaultTargetSchema>
+ <DelaySign>false</DelaySign>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>SearchFiles</RootNamespace>
+ <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
+ <StartupObject>
+ </StartupObject>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <OutputPath>bin\Debug\</OutputPath>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <BaseAddress>285212672</BaseAddress>
+ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DocumentationFile>
+ </DocumentationFile>
+ <DebugSymbols>true</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <NoStdLib>false</NoStdLib>
+ <NoWarn>
+ </NoWarn>
+ <Optimize>false</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>full</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <OutputPath>bin\Release\</OutputPath>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <BaseAddress>285212672</BaseAddress>
+ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>TRACE</DefineConstants>
+ <DocumentationFile>SearchFiles.xml</DocumentationFile>
+ <DebugSymbols>false</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <NoStdLib>false</NoStdLib>
+ <NoWarn>
+ </NoWarn>
+ <Optimize>true</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>none</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Lucene.Net">
+ <Name>Lucene.Net</Name>
+ <HintPath>..\..\Lucene.Net\bin\Debug\Lucene.Net.dll</HintPath>
+ </Reference>
+ <Reference Include="System">
+ <Name>System</Name>
+ </Reference>
+ <Reference Include="System.Data">
+ <Name>System.Data</Name>
+ </Reference>
+ <Reference Include="System.Xml">
+ <Name>System.XML</Name>
+ </Reference>
+ <ProjectReference Include="..\DemoLib\DemoLib-VS2005.csproj">
+ <Name>DemoLib-VS2005</Name>
+ <Project>{F04CA2F4-E182-46A8-B914-F46AF5319E83}</Project>
+ <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="App.ico" />
+ <Compile Include="AssemblyInfo.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="SearchFiles.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PreBuildEvent>
+ </PreBuildEvent>
+ <PostBuildEvent>
+ </PostBuildEvent>
+ </PropertyGroup>
+</Project>
\ No newline at end of file
Modified: incubator/lucene.net/trunk/C#/src/Demo/SearchFiles/SearchFiles.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Demo/SearchFiles/SearchFiles.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Demo/SearchFiles/SearchFiles.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Demo/SearchFiles/SearchFiles.cs Tue May 1 11:45:26 2007
@@ -16,6 +16,7 @@
*/
using System;
+
using Analyzer = Lucene.Net.Analysis.Analyzer;
using StandardAnalyzer = Lucene.Net.Analysis.Standard.StandardAnalyzer;
using Document = Lucene.Net.Documents.Document;
@@ -153,7 +154,7 @@
hits = searcher.Search(query);
}
System.DateTime end = System.DateTime.Now;
- System.Console.Out.WriteLine("Time: " + (end.Ticks - start.Ticks) + "ms");
+ System.Console.Out.WriteLine("Time: " + (end.Millisecond - start.Millisecond) + "ms");
}
System.Console.Out.WriteLine(hits.Length() + " total matching documents");
Modified: incubator/lucene.net/trunk/C#/src/HISTORY.txt
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/HISTORY.txt?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/HISTORY.txt (original)
+++ incubator/lucene.net/trunk/C#/src/HISTORY.txt Tue May 1 11:45:26 2007
@@ -2,6 +2,13 @@
-------------------------
+01May07:
+ - Dev Release: Apache Lucene.Net.2.1 build 001 "early-Alpha"
+ - Issues: Optimizing an index will cause an exception.
+ - Issues: The "Test" code has not yet be ported for this release.
+ - Issues: Code in "contrib" have not been validated to work with this release.
+
+
30Apr07:
- Patch: Apache Lucene.Net.2.0 build 005 "final"
- Fix: LUCENENET-37 "Exception while search in Lucene.Net and Index prepared by Lucene Java"
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/Analyzer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Analysis/Analyzer.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/Analyzer.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/Analyzer.cs Tue May 1 11:45:26 2007
@@ -41,17 +41,17 @@
public abstract TokenStream TokenStream(System.String fieldName, System.IO.TextReader reader);
- /// <summary> Invoked before indexing a Field instance if
+ /// <summary> Invoked before indexing a Fieldable instance if
/// terms have already been added to that field. This allows custom
/// analyzers to place an automatic position increment gap between
- /// Field instances using the same field name. The default value
+ /// Fieldable instances using the same field name. The default value
/// position increment gap is 0. With a 0 position increment gap and
/// the typical default token position increment of 1, all terms in a field,
- /// including across Field instances, are in successive positions, allowing
- /// exact PhraseQuery matches, for instance, across Field instance boundaries.
+ /// including across Fieldable instances, are in successive positions, allowing
+ /// exact PhraseQuery matches, for instance, across Fieldable instance boundaries.
///
/// </summary>
- /// <param name="fieldName">Field name being indexed.
+ /// <param name="fieldName">Fieldable name being indexed.
/// </param>
/// <returns> position increment gap, added to the next token emitted from {@link #TokenStream(String,Reader)}
/// </returns>
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/CharTokenizer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Analysis/CharTokenizer.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/CharTokenizer.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/CharTokenizer.cs Tue May 1 11:45:26 2007
@@ -20,81 +20,81 @@
namespace Lucene.Net.Analysis
{
- /// <summary>An abstract base class for simple, character-oriented tokenizers.</summary>
- public abstract class CharTokenizer : Tokenizer
- {
- public CharTokenizer(System.IO.TextReader input) : base(input)
- {
- }
+ /// <summary>An abstract base class for simple, character-oriented tokenizers.</summary>
+ public abstract class CharTokenizer : Tokenizer
+ {
+ public CharTokenizer(System.IO.TextReader input) : base(input)
+ {
+ }
- private int offset = 0, bufferIndex = 0, dataLen = 0;
- private const int MAX_WORD_LEN = 255;
- private const int IO_BUFFER_SIZE = 1024;
- private char[] buffer = new char[MAX_WORD_LEN];
- private char[] ioBuffer = new char[IO_BUFFER_SIZE];
+ private int offset = 0, bufferIndex = 0, dataLen = 0;
+ private const int MAX_WORD_LEN = 255;
+ private const int IO_BUFFER_SIZE = 1024;
+ private char[] buffer = new char[MAX_WORD_LEN];
+ private char[] ioBuffer = new char[IO_BUFFER_SIZE];
- /// <summary>Returns true iff a character should be included in a token. This
- /// tokenizer generates as tokens adjacent sequences of characters which
- /// satisfy this predicate. Characters for which this is false are used to
- /// define token boundaries and are not included in tokens.
- /// </summary>
- protected internal abstract bool IsTokenChar(char c);
+ /// <summary>Returns true iff a character should be included in a token. This
+ /// tokenizer generates as tokens adjacent sequences of characters which
+ /// satisfy this predicate. Characters for which this is false are used to
+ /// define token boundaries and are not included in tokens.
+ /// </summary>
+ protected internal abstract bool IsTokenChar(char c);
- /// <summary>Called on each token character to normalize it before it is added to the
- /// token. The default implementation does nothing. Subclasses may use this
- /// to, e.g., lowercase tokens.
- /// </summary>
- protected internal virtual char Normalize(char c)
- {
- return c;
- }
+ /// <summary>Called on each token character to normalize it before it is added to the
+ /// token. The default implementation does nothing. Subclasses may use this
+ /// to, e.g., lowercase tokens.
+ /// </summary>
+ protected internal virtual char Normalize(char c)
+ {
+ return c;
+ }
- /// <summary>Returns the next token in the stream, or null at EOS. </summary>
- public override Token Next()
- {
- int length = 0;
- int start = offset;
- while (true)
- {
- char c;
+ /// <summary>Returns the next token in the stream, or null at EOS. </summary>
+ public override Token Next()
+ {
+ int length = 0;
+ int start = offset;
+ while (true)
+ {
+ char c;
- offset++;
- if (bufferIndex >= dataLen)
- {
- dataLen = input.Read((System.Char[]) ioBuffer, 0, ioBuffer.Length);
- bufferIndex = 0;
- }
- ;
- if (dataLen <= 0)
- {
- if (length > 0)
- break;
- else
- return null;
- }
- else
- c = ioBuffer[bufferIndex++];
+ offset++;
+ if (bufferIndex >= dataLen)
+ {
+ dataLen = input.Read((System.Char[]) ioBuffer, 0, ioBuffer.Length);
+ bufferIndex = 0;
+ }
+ ;
+ if (dataLen <= 0)
+ {
+ if (length > 0)
+ break;
+ else
+ return null;
+ }
+ else
+ c = ioBuffer[bufferIndex++];
- if (IsTokenChar(c))
- {
- // if it's a token char
+ if (IsTokenChar(c))
+ {
+ // if it's a token char
- if (length == 0)
- // start of token
- start = offset - 1;
+ if (length == 0)
+ // start of token
+ start = offset - 1;
- buffer[length++] = Normalize(c); // buffer it, normalized
+ buffer[length++] = Normalize(c); // buffer it, normalized
- if (length == MAX_WORD_LEN)
- // buffer overflow!
- break;
- }
- else if (length > 0)
- // at non-Letter w/ chars
- break; // return 'em
- }
+ if (length == MAX_WORD_LEN)
+ // buffer overflow!
+ break;
+ }
+ else if (length > 0)
+ // at non-Letter w/ chars
+ break; // return 'em
+ }
- return new Token(new System.String(buffer, 0, length), start, start + length);
- }
- }
+ return new Token(new System.String(buffer, 0, length), start, start + length);
+ }
+ }
}
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/ISOLatin1AccentFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Analysis/ISOLatin1AccentFilter.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/ISOLatin1AccentFilter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/ISOLatin1AccentFilter.cs Tue May 1 11:45:26 2007
@@ -20,185 +20,184 @@
namespace Lucene.Net.Analysis
{
- /// <summary> A filter that replaces accented characters in the ISO Latin 1 character set
- /// (ISO-8859-1) by their unaccented equivalent. The case will not be altered.
- /// <p>
- /// For instance, 'à' will be replaced by 'a'.
- /// <p>
- /// </summary>
- public class ISOLatin1AccentFilter : TokenFilter
- {
- public ISOLatin1AccentFilter(TokenStream input) : base(input)
- {
- }
+ /// <summary> A filter that replaces accented characters in the ISO Latin 1 character set
+ /// (ISO-8859-1) by their unaccented equivalent. The case will not be altered.
+ /// <p>
+ /// For instance, 'à' will be replaced by 'a'.
+ /// <p>
+ /// </summary>
+ public class ISOLatin1AccentFilter : TokenFilter
+ {
+ public ISOLatin1AccentFilter(TokenStream input) : base(input)
+ {
+ }
public override Token Next()
{
Token t = input.Next();
- if (t == null)
- return null;
- // Return a token with filtered characters.
- return new Token(RemoveAccents(t.TermText()), t.StartOffset(), t.EndOffset(), t.Type());
+ if (t != null)
+ t.SetTermText(RemoveAccents(t.TermText()));
+ return t;
}
- /// <summary> To replace accented characters in a String by unaccented equivalents.</summary>
- public static System.String RemoveAccents(System.String input)
- {
- System.Text.StringBuilder output = new System.Text.StringBuilder();
- for (int i = 0; i < input.Length; i++)
- {
+ /// <summary> To replace accented characters in a String by unaccented equivalents.</summary>
+ public static System.String RemoveAccents(System.String input)
+ {
+ System.Text.StringBuilder output = new System.Text.StringBuilder();
+ for (int i = 0; i < input.Length; i++)
+ {
long val = input[i];
- switch (input[i])
- {
+ switch (input[i])
+ {
- case '\u00C0': // Ãâ¬
- case '\u00C1': // Ã?
- case '\u00C2': // Ãâ
- case '\u00C3': // ÃÆ
- case '\u00C4': // Ãâ
- case '\u00C5': // Ãâ¦
- output.Append("A");
- break;
-
- case '\u00C6': // Ãâ
- output.Append("AE");
- break;
-
- case '\u00C7': // Ãâ¡
- output.Append("C");
- break;
-
- case '\u00C8': // ÃË
- case '\u00C9': // Ãâ°
- case '\u00CA': // ÃÅ
- case '\u00CB': // Ãâ¹
- output.Append("E");
- break;
-
- case '\u00CC': // ÃÅ
- case '\u00CD': // Ã?
- case '\u00CE': // ÃŽ
- case '\u00CF': // Ã?
- output.Append("I");
- break;
-
- case '\u00D0': // Ã?
- output.Append("D");
- break;
-
- case '\u00D1': // Ãâ
- output.Append("N");
- break;
-
- case '\u00D2': // Ãâ
- case '\u00D3': // Ãâ
- case '\u00D4': // Ãâ
- case '\u00D5': // Ãâ¢
- case '\u00D6': // Ãâ
- case '\u00D8': // ÃË
- output.Append("O");
- break;
-
- case '\u0152': // Ã
â
- output.Append("OE");
- break;
-
- case '\u00DE': // Þ
- output.Append("TH");
- break;
-
- case '\u00D9': // Ãâ¢
- case '\u00DA': // ÃÅ¡
- case '\u00DB': // Ãâº
- case '\u00DC': // ÃÅ
- output.Append("U");
- break;
-
- case '\u00DD': // Ã?
- case '\u0178': // Ã
¸
- output.Append("Y");
- break;
-
- case '\u00E0': // ÃÂ
- case '\u00E1': // á
- case '\u00E2': // â
- case '\u00E3': // ã
- case '\u00E4': // ä
- case '\u00E5': // ÃÂ¥
- output.Append("a");
- break;
-
- case '\u00E6': // æ
- output.Append("ae");
- break;
-
- case '\u00E7': // ç
- output.Append("c");
- break;
-
- case '\u00E8': // è
- case '\u00E9': // é
- case '\u00EA': // ê
- case '\u00EB': // ë
- output.Append("e");
- break;
-
- case '\u00EC': // ì
- case '\u00ED': // ÃÂ
- case '\u00EE': // î
- case '\u00EF': // ï
- output.Append("i");
- break;
-
- case '\u00F0': // ð
- output.Append("d");
- break;
-
- case '\u00F1': // ñ
- output.Append("n");
- break;
-
- case '\u00F2': // ò
- case '\u00F3': // ó
- case '\u00F4': // ô
- case '\u00F5': // õ
- case '\u00F6': // ö
- case '\u00F8': // ø
- output.Append("o");
- break;
-
- case '\u0153': // Ã
â
- output.Append("oe");
- break;
-
- case '\u00DF': // ß
- output.Append("ss");
- break;
-
- case '\u00FE': // þ
- output.Append("th");
- break;
-
- case '\u00F9': // ù
- case '\u00FA': // ú
- case '\u00FB': // û
- case '\u00FC': // ü
- output.Append("u");
- break;
-
- case '\u00FD': // ý
- case '\u00FF': // ÿ
- output.Append("y");
- break;
-
- default:
- output.Append(input[i]);
- break;
-
- }
- }
- return output.ToString();
- }
- }
+ case '\u00C0': // Ãâ¬
+ case '\u00C1': // Ã?
+ case '\u00C2': // Ãâ
+ case '\u00C3': // ÃÆ
+ case '\u00C4': // Ãâ
+ case '\u00C5': // Ãâ¦
+ output.Append("A");
+ break;
+
+ case '\u00C6': // Ãâ
+ output.Append("AE");
+ break;
+
+ case '\u00C7': // Ãâ¡
+ output.Append("C");
+ break;
+
+ case '\u00C8': // ÃË
+ case '\u00C9': // Ãâ°
+ case '\u00CA': // ÃÅ
+ case '\u00CB': // Ãâ¹
+ output.Append("E");
+ break;
+
+ case '\u00CC': // ÃÅ
+ case '\u00CD': // Ã?
+ case '\u00CE': // ÃŽ
+ case '\u00CF': // Ã?
+ output.Append("I");
+ break;
+
+ case '\u00D0': // Ã?
+ output.Append("D");
+ break;
+
+ case '\u00D1': // Ãâ
+ output.Append("N");
+ break;
+
+ case '\u00D2': // Ãâ
+ case '\u00D3': // Ãâ
+ case '\u00D4': // Ãâ
+ case '\u00D5': // Ãâ¢
+ case '\u00D6': // Ãâ
+ case '\u00D8': // ÃË
+ output.Append("O");
+ break;
+
+ case '\u0152': // Ã
â
+ output.Append("OE");
+ break;
+
+ case '\u00DE': // Þ
+ output.Append("TH");
+ break;
+
+ case '\u00D9': // Ãâ¢
+ case '\u00DA': // ÃÅ¡
+ case '\u00DB': // Ãâº
+ case '\u00DC': // ÃÅ
+ output.Append("U");
+ break;
+
+ case '\u00DD': // Ã?
+ case '\u0178': // Ã
¸
+ output.Append("Y");
+ break;
+
+ case '\u00E0': // ÃÂ
+ case '\u00E1': // á
+ case '\u00E2': // â
+ case '\u00E3': // ã
+ case '\u00E4': // ä
+ case '\u00E5': // ÃÂ¥
+ output.Append("a");
+ break;
+
+ case '\u00E6': // æ
+ output.Append("ae");
+ break;
+
+ case '\u00E7': // ç
+ output.Append("c");
+ break;
+
+ case '\u00E8': // è
+ case '\u00E9': // é
+ case '\u00EA': // ê
+ case '\u00EB': // ë
+ output.Append("e");
+ break;
+
+ case '\u00EC': // ì
+ case '\u00ED': // ÃÂ
+ case '\u00EE': // î
+ case '\u00EF': // ï
+ output.Append("i");
+ break;
+
+ case '\u00F0': // ð
+ output.Append("d");
+ break;
+
+ case '\u00F1': // ñ
+ output.Append("n");
+ break;
+
+ case '\u00F2': // ò
+ case '\u00F3': // ó
+ case '\u00F4': // ô
+ case '\u00F5': // õ
+ case '\u00F6': // ö
+ case '\u00F8': // ø
+ output.Append("o");
+ break;
+
+ case '\u0153': // Ã
â
+ output.Append("oe");
+ break;
+
+ case '\u00DF': // ß
+ output.Append("ss");
+ break;
+
+ case '\u00FE': // þ
+ output.Append("th");
+ break;
+
+ case '\u00F9': // ù
+ case '\u00FA': // ú
+ case '\u00FB': // û
+ case '\u00FC': // ü
+ output.Append("u");
+ break;
+
+ case '\u00FD': // ý
+ case '\u00FF': // ÿ
+ output.Append("y");
+ break;
+
+ default:
+ output.Append(input[i]);
+ break;
+
+ }
+ }
+ return output.ToString();
+ }
+ }
}
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/KeywordAnalyzer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Analysis/KeywordAnalyzer.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/KeywordAnalyzer.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/KeywordAnalyzer.cs Tue May 1 11:45:26 2007
@@ -20,14 +20,14 @@
namespace Lucene.Net.Analysis
{
- /// <summary> "Tokenizes" the entire stream as a single token. This is useful
- /// for data like zip codes, ids, and some product names.
- /// </summary>
- public class KeywordAnalyzer : Analyzer
- {
- public override TokenStream TokenStream(System.String fieldName, System.IO.TextReader reader)
- {
- return new KeywordTokenizer(reader);
- }
- }
+ /// <summary> "Tokenizes" the entire stream as a single token. This is useful
+ /// for data like zip codes, ids, and some product names.
+ /// </summary>
+ public class KeywordAnalyzer : Analyzer
+ {
+ public override TokenStream TokenStream(System.String fieldName, System.IO.TextReader reader)
+ {
+ return new KeywordTokenizer(reader);
+ }
+ }
}
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/KeywordTokenizer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Analysis/KeywordTokenizer.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/KeywordTokenizer.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/KeywordTokenizer.cs Tue May 1 11:45:26 2007
@@ -20,44 +20,44 @@
namespace Lucene.Net.Analysis
{
- /// <summary> Emits the entire input as a single token.</summary>
- public class KeywordTokenizer : Tokenizer
- {
+ /// <summary> Emits the entire input as a single token.</summary>
+ public class KeywordTokenizer : Tokenizer
+ {
- private const int DEFAULT_BUFFER_SIZE = 256;
+ private const int DEFAULT_BUFFER_SIZE = 256;
- private bool done;
- private char[] buffer;
+ private bool done;
+ private char[] buffer;
- public KeywordTokenizer(System.IO.TextReader input) : this(input, DEFAULT_BUFFER_SIZE)
- {
- }
+ public KeywordTokenizer(System.IO.TextReader input) : this(input, DEFAULT_BUFFER_SIZE)
+ {
+ }
- public KeywordTokenizer(System.IO.TextReader input, int bufferSize) : base(input)
- {
- this.buffer = new char[bufferSize];
- this.done = false;
- }
+ public KeywordTokenizer(System.IO.TextReader input, int bufferSize) : base(input)
+ {
+ this.buffer = new char[bufferSize];
+ this.done = false;
+ }
- public override Token Next()
- {
- if (!done)
- {
- done = true;
- System.Text.StringBuilder buffer = new System.Text.StringBuilder();
- int length;
- while (true)
- {
- length = input.Read((System.Char[]) this.buffer, 0, this.buffer.Length);
- if (length <= 0)
- break;
+ public override Token Next()
+ {
+ if (!done)
+ {
+ done = true;
+ System.Text.StringBuilder buffer = new System.Text.StringBuilder();
+ int length;
+ while (true)
+ {
+ length = input.Read((System.Char[]) this.buffer, 0, this.buffer.Length);
+ if (length <= 0)
+ break;
- buffer.Append(this.buffer, 0, length);
- }
- System.String text = buffer.ToString();
- return new Token(text, 0, text.Length);
- }
- return null;
- }
- }
+ buffer.Append(this.buffer, 0, length);
+ }
+ System.String text = buffer.ToString();
+ return new Token(text, 0, text.Length);
+ }
+ return null;
+ }
+ }
}
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/LengthFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Analysis/LengthFilter.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/LengthFilter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/LengthFilter.cs Tue May 1 11:45:26 2007
@@ -20,43 +20,43 @@
namespace Lucene.Net.Analysis
{
- /// <summary> Removes words that are too long and too short from the stream.
- ///
- /// </summary>
- /// <author> David Spencer
- /// </author>
- /// <version> $Id: LengthFilter.java 347992 2005-11-21 21:41:43Z dnaber $
- /// </version>
- public sealed class LengthFilter : TokenFilter
- {
+ /// <summary> Removes words that are too long and too short from the stream.
+ ///
+ /// </summary>
+ /// <author> David Spencer
+ /// </author>
+ /// <version> $Id: LengthFilter.java 347992 2005-11-21 21:41:43Z dnaber $
+ /// </version>
+ public sealed class LengthFilter : TokenFilter
+ {
- internal int min;
- internal int max;
+ internal int min;
+ internal int max;
- /// <summary> Build a filter that removes words that are too long or too
- /// short from the text.
- /// </summary>
- public LengthFilter(TokenStream in_Renamed, int min, int max) : base(in_Renamed)
- {
- this.min = min;
- this.max = max;
- }
+ /// <summary> Build a filter that removes words that are too long or too
+ /// short from the text.
+ /// </summary>
+ public LengthFilter(TokenStream in_Renamed, int min, int max) : base(in_Renamed)
+ {
+ this.min = min;
+ this.max = max;
+ }
- /// <summary> Returns the next input Token whose termText() is the right len</summary>
- public override Token Next()
- {
- // return the first non-stop word found
- for (Token token = input.Next(); token != null; token = input.Next())
- {
- int len = token.TermText().Length;
- if (len >= min && len <= max)
- {
- return token;
- }
- // note: else we ignore it but should we index each part of it?
- }
- // reached EOS -- return null
- return null;
- }
- }
+ /// <summary> Returns the next input Token whose termText() is the right len</summary>
+ public override Token Next()
+ {
+ // return the first non-stop word found
+ for (Token token = input.Next(); token != null; token = input.Next())
+ {
+ int len = token.TermText().Length;
+ if (len >= min && len <= max)
+ {
+ return token;
+ }
+ // note: else we ignore it but should we index each part of it?
+ }
+ // reached EOS -- return null
+ return null;
+ }
+ }
}
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/LetterTokenizer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Analysis/LetterTokenizer.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/LetterTokenizer.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/LetterTokenizer.cs Tue May 1 11:45:26 2007
@@ -20,26 +20,26 @@
namespace Lucene.Net.Analysis
{
- /// <summary>A LetterTokenizer is a tokenizer that divides text at non-letters. That's
- /// to say, it defines tokens as maximal strings of adjacent letters, as defined
- /// by java.lang.Character.isLetter() predicate.
- /// Note: this does a decent job for most European languages, but does a terrible
- /// job for some Asian languages, where words are not separated by spaces.
- /// </summary>
+ /// <summary>A LetterTokenizer is a tokenizer that divides text at non-letters. That's
+ /// to say, it defines tokens as maximal strings of adjacent letters, as defined
+ /// by java.lang.Character.isLetter() predicate.
+ /// Note: this does a decent job for most European languages, but does a terrible
+ /// job for some Asian languages, where words are not separated by spaces.
+ /// </summary>
- public class LetterTokenizer : CharTokenizer
- {
- /// <summary>Construct a new LetterTokenizer. </summary>
- public LetterTokenizer(System.IO.TextReader in_Renamed) : base(in_Renamed)
- {
- }
+ public class LetterTokenizer : CharTokenizer
+ {
+ /// <summary>Construct a new LetterTokenizer. </summary>
+ public LetterTokenizer(System.IO.TextReader in_Renamed) : base(in_Renamed)
+ {
+ }
- /// <summary>Collects only characters which satisfy
- /// {@link Character#isLetter(char)}.
- /// </summary>
- protected internal override bool IsTokenChar(char c)
- {
- return System.Char.IsLetter(c);
- }
- }
+ /// <summary>Collects only characters which satisfy
+ /// {@link Character#isLetter(char)}.
+ /// </summary>
+ protected internal override bool IsTokenChar(char c)
+ {
+ return System.Char.IsLetter(c);
+ }
+ }
}
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/LowerCaseFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Analysis/LowerCaseFilter.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/LowerCaseFilter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/LowerCaseFilter.cs Tue May 1 11:45:26 2007
@@ -20,27 +20,27 @@
namespace Lucene.Net.Analysis
{
- /// <summary> Normalizes token text to lower case.
- ///
- /// </summary>
- /// <version> $Id: LowerCaseFilter.java 150259 2004-03-29 22:48:07Z cutting $
- /// </version>
- public sealed class LowerCaseFilter : TokenFilter
- {
- public LowerCaseFilter(TokenStream in_Renamed) : base(in_Renamed)
- {
- }
+ /// <summary> Normalizes token text to lower case.
+ ///
+ /// </summary>
+ /// <version> $Id: LowerCaseFilter.java 150259 2004-03-29 22:48:07Z cutting $
+ /// </version>
+ public sealed class LowerCaseFilter : TokenFilter
+ {
+ public LowerCaseFilter(TokenStream in_Renamed) : base(in_Renamed)
+ {
+ }
- public override Token Next()
- {
- Token t = input.Next();
+ public override Token Next()
+ {
+ Token t = input.Next();
- if (t == null)
- return null;
+ if (t == null)
+ return null;
- t.termText = t.termText.ToLower();
+ t.termText = t.termText.ToLower();
- return t;
- }
- }
+ return t;
+ }
+ }
}
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/LowerCaseTokenizer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Analysis/LowerCaseTokenizer.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/LowerCaseTokenizer.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/LowerCaseTokenizer.cs Tue May 1 11:45:26 2007
@@ -20,28 +20,28 @@
namespace Lucene.Net.Analysis
{
- /// <summary> LowerCaseTokenizer performs the function of LetterTokenizer
- /// and LowerCaseFilter together. It divides text at non-letters and converts
- /// them to lower case. While it is functionally equivalent to the combination
- /// of LetterTokenizer and LowerCaseFilter, there is a performance advantage
- /// to doing the two tasks at once, hence this (redundant) implementation.
- /// <P>
- /// Note: this does a decent job for most European languages, but does a terrible
- /// job for some Asian languages, where words are not separated by spaces.
- /// </summary>
- public sealed class LowerCaseTokenizer : LetterTokenizer
- {
- /// <summary>Construct a new LowerCaseTokenizer. </summary>
- public LowerCaseTokenizer(System.IO.TextReader in_Renamed) : base(in_Renamed)
- {
- }
+ /// <summary> LowerCaseTokenizer performs the function of LetterTokenizer
+ /// and LowerCaseFilter together. It divides text at non-letters and converts
+ /// them to lower case. While it is functionally equivalent to the combination
+ /// of LetterTokenizer and LowerCaseFilter, there is a performance advantage
+ /// to doing the two tasks at once, hence this (redundant) implementation.
+ /// <P>
+ /// Note: this does a decent job for most European languages, but does a terrible
+ /// job for some Asian languages, where words are not separated by spaces.
+ /// </summary>
+ public sealed class LowerCaseTokenizer : LetterTokenizer
+ {
+ /// <summary>Construct a new LowerCaseTokenizer. </summary>
+ public LowerCaseTokenizer(System.IO.TextReader in_Renamed) : base(in_Renamed)
+ {
+ }
- /// <summary>Collects only characters which satisfy
- /// {@link Character#isLetter(char)}.
- /// </summary>
- protected internal override char Normalize(char c)
- {
- return System.Char.ToLower(c);
- }
- }
+ /// <summary>Collects only characters which satisfy
+ /// {@link Character#isLetter(char)}.
+ /// </summary>
+ protected internal override char Normalize(char c)
+ {
+ return System.Char.ToLower(c);
+ }
+ }
}
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/Package.html
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Analysis/Package.html?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/Package.html (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/Package.html Tue May 1 11:45:26 2007
@@ -1,10 +1,10 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="Doug Cutting">
-</head>
-<body>
-API and code to convert text into indexable tokens.
-</body>
-</html>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Doug Cutting">
+</head>
+<body>
+API and code to convert text into indexable tokens.
+</body>
+</html>
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/PerFieldAnalyzerWrapper.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Analysis/PerFieldAnalyzerWrapper.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/PerFieldAnalyzerWrapper.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/PerFieldAnalyzerWrapper.cs Tue May 1 11:45:26 2007
@@ -20,69 +20,78 @@
namespace Lucene.Net.Analysis
{
- /// <summary> This analyzer is used to facilitate scenarios where different
- /// fields require different analysis techniques. Use {@link #addAnalyzer}
- /// to add a non-default analyzer on a field name basis.
- ///
- /// <p>Example usage:
- ///
- /// <pre>
- /// PerFieldAnalyzerWrapper aWrapper =
- /// new PerFieldAnalyzerWrapper(new StandardAnalyzer());
- /// aWrapper.addAnalyzer("firstname", new KeywordAnalyzer());
- /// aWrapper.addAnalyzer("lastname", new KeywordAnalyzer());
- /// </pre>
- ///
- /// <p>In this example, StandardAnalyzer will be used for all fields except "firstname"
- /// and "lastname", for which KeywordAnalyzer will be used.
- ///
- /// <p>A PerFieldAnalyzerWrapper can be used like any other analyzer, for both indexing
- /// and query parsing.
- /// </summary>
- public class PerFieldAnalyzerWrapper:Analyzer
- {
- private Analyzer defaultAnalyzer;
- private System.Collections.IDictionary analyzerMap = new System.Collections.Hashtable();
-
-
- /// <summary> Constructs with default analyzer.
- ///
- /// </summary>
- /// <param name="defaultAnalyzer">Any fields not specifically
- /// defined to use a different analyzer will use the one provided here.
- /// </param>
- public PerFieldAnalyzerWrapper(Analyzer defaultAnalyzer)
- {
- this.defaultAnalyzer = defaultAnalyzer;
- }
-
- /// <summary> Defines an analyzer to use for the specified field.
- ///
- /// </summary>
- /// <param name="fieldName">field name requiring a non-default analyzer
- /// </param>
- /// <param name="analyzer">non-default analyzer to use for field
- /// </param>
- public virtual void AddAnalyzer(System.String fieldName, Analyzer analyzer)
- {
- analyzerMap[fieldName] = analyzer;
- }
-
- public override TokenStream TokenStream(System.String fieldName, System.IO.TextReader reader)
- {
- Analyzer analyzer = (Analyzer) analyzerMap[fieldName];
- if (analyzer == null)
- {
- analyzer = defaultAnalyzer;
- }
+ /// <summary> This analyzer is used to facilitate scenarios where different
+ /// fields require different analysis techniques. Use {@link #addAnalyzer}
+ /// to add a non-default analyzer on a field name basis.
+ ///
+ /// <p>Example usage:
+ ///
+ /// <pre>
+ /// PerFieldAnalyzerWrapper aWrapper =
+ /// new PerFieldAnalyzerWrapper(new StandardAnalyzer());
+ /// aWrapper.addAnalyzer("firstname", new KeywordAnalyzer());
+ /// aWrapper.addAnalyzer("lastname", new KeywordAnalyzer());
+ /// </pre>
+ ///
+ /// <p>In this example, StandardAnalyzer will be used for all fields except "firstname"
+ /// and "lastname", for which KeywordAnalyzer will be used.
+ ///
+ /// <p>A PerFieldAnalyzerWrapper can be used like any other analyzer, for both indexing
+ /// and query parsing.
+ /// </summary>
+ public class PerFieldAnalyzerWrapper:Analyzer
+ {
+ private Analyzer defaultAnalyzer;
+ private System.Collections.IDictionary analyzerMap = new System.Collections.Hashtable();
+
+
+ /// <summary> Constructs with default analyzer.
+ ///
+ /// </summary>
+ /// <param name="defaultAnalyzer">Any fields not specifically
+ /// defined to use a different analyzer will use the one provided here.
+ /// </param>
+ public PerFieldAnalyzerWrapper(Analyzer defaultAnalyzer)
+ {
+ this.defaultAnalyzer = defaultAnalyzer;
+ }
+
+ /// <summary> Defines an analyzer to use for the specified field.
+ ///
+ /// </summary>
+ /// <param name="fieldName">field name requiring a non-default analyzer
+ /// </param>
+ /// <param name="analyzer">non-default analyzer to use for field
+ /// </param>
+ public virtual void AddAnalyzer(System.String fieldName, Analyzer analyzer)
+ {
+ analyzerMap[fieldName] = analyzer;
+ }
+
+ public override TokenStream TokenStream(System.String fieldName, System.IO.TextReader reader)
+ {
+ Analyzer analyzer = (Analyzer) analyzerMap[fieldName];
+ if (analyzer == null)
+ {
+ analyzer = defaultAnalyzer;
+ }
- return analyzer.TokenStream(fieldName, reader);
- }
+ return analyzer.TokenStream(fieldName, reader);
+ }
+
+ /// <summary>Return the positionIncrementGap from the analyzer assigned to fieldName </summary>
+ public override int GetPositionIncrementGap(System.String fieldName)
+ {
+ Analyzer analyzer = (Analyzer) analyzerMap[fieldName];
+ if (analyzer == null)
+ analyzer = defaultAnalyzer;
+ return analyzer.GetPositionIncrementGap(fieldName);
+ }
- public override System.String ToString()
- {
- // {{Aroush-1.9}} 'analyzerMap.ToString()' may return a different value then Java.
- return "PerFieldAnalyzerWrapper(" + analyzerMap.ToString() + ", default=" + defaultAnalyzer + ")";
- }
- }
+ public override System.String ToString()
+ {
+ // {{Aroush-1.9}} 'analyzerMap.ToString()' may return a different value then Java.
+ return "PerFieldAnalyzerWrapper(" + analyzerMap.ToString() + ", default=" + defaultAnalyzer + ")";
+ }
+ }
}
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/PorterStemFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Analysis/PorterStemFilter.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/PorterStemFilter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/PorterStemFilter.cs Tue May 1 11:45:26 2007
@@ -20,47 +20,47 @@
namespace Lucene.Net.Analysis
{
- /// <summary>Transforms the token stream as per the Porter stemming algorithm.
- /// Note: the input to the stemming filter must already be in lower case,
- /// so you will need to use LowerCaseFilter or LowerCaseTokenizer farther
- /// down the Tokenizer chain in order for this to work properly!
- /// <P>
- /// To use this filter with other analyzers, you'll want to write an
- /// Analyzer class that sets up the TokenStream chain as you want it.
- /// To use this with LowerCaseTokenizer, for example, you'd write an
- /// analyzer like this:
- /// <P>
- /// <PRE>
- /// class MyAnalyzer extends Analyzer {
- /// public final TokenStream tokenStream(String fieldName, Reader reader) {
- /// return new PorterStemFilter(new LowerCaseTokenizer(reader));
- /// }
- /// }
- /// </PRE>
- /// </summary>
- public sealed class PorterStemFilter : TokenFilter
- {
- private PorterStemmer stemmer;
+ /// <summary>Transforms the token stream as per the Porter stemming algorithm.
+ /// Note: the input to the stemming filter must already be in lower case,
+ /// so you will need to use LowerCaseFilter or LowerCaseTokenizer farther
+ /// down the Tokenizer chain in order for this to work properly!
+ /// <P>
+ /// To use this filter with other analyzers, you'll want to write an
+ /// Analyzer class that sets up the TokenStream chain as you want it.
+ /// To use this with LowerCaseTokenizer, for example, you'd write an
+ /// analyzer like this:
+ /// <P>
+ /// <PRE>
+ /// class MyAnalyzer extends Analyzer {
+ /// public final TokenStream tokenStream(String fieldName, Reader reader) {
+ /// return new PorterStemFilter(new LowerCaseTokenizer(reader));
+ /// }
+ /// }
+ /// </PRE>
+ /// </summary>
+ public sealed class PorterStemFilter : TokenFilter
+ {
+ private PorterStemmer stemmer;
- public PorterStemFilter(TokenStream in_Renamed) : base(in_Renamed)
- {
- stemmer = new PorterStemmer();
- }
+ public PorterStemFilter(TokenStream in_Renamed) : base(in_Renamed)
+ {
+ stemmer = new PorterStemmer();
+ }
- /// <summary>Returns the next input Token, after being stemmed </summary>
- public override Token Next()
- {
- Token token = input.Next();
- if (token == null)
- return null;
- else
- {
- System.String s = stemmer.Stem(token.termText);
- if ((System.Object) s != (System.Object) token.termText)
- // Yes, I mean object reference comparison here
- token.termText = s;
- return token;
- }
- }
- }
+ /// <summary>Returns the next input Token, after being stemmed </summary>
+ public override Token Next()
+ {
+ Token token = input.Next();
+ if (token == null)
+ return null;
+ else
+ {
+ System.String s = stemmer.Stem(token.termText);
+ if ((System.Object) s != (System.Object) token.termText)
+ // Yes, I mean object reference comparison here
+ token.termText = s;
+ return token;
+ }
+ }
+ }
}