You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2017/04/17 13:55:26 UTC
[1/7] lucenenet git commit: Lucene.Net + Lucene.Net.Tests (csproj):
added FEATURE_CONCURRENTMERGESCHEDULER to constants (to sync up with
project.json)
Repository: lucenenet
Updated Branches:
refs/heads/api-work 422d4f1a5 -> 077b57fae
Lucene.Net + Lucene.Net.Tests (csproj): added FEATURE_CONCURRENTMERGESCHEDULER to constants (to sync up with project.json)
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/ddc93f12
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/ddc93f12
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/ddc93f12
Branch: refs/heads/api-work
Commit: ddc93f12b9edc3e5e7b6b071708171cce9b2a3ff
Parents: 422d4f1
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Sun Apr 16 20:50:13 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Sun Apr 16 20:50:13 2017 +0700
----------------------------------------------------------------------
src/Lucene.Net.Tests/Lucene.Net.Tests.csproj | 2 +-
src/Lucene.Net/Lucene.Net.csproj | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddc93f12/src/Lucene.Net.Tests/Lucene.Net.Tests.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Lucene.Net.Tests.csproj b/src/Lucene.Net.Tests/Lucene.Net.Tests.csproj
index 392f90d..a7d79bc 100644
--- a/src/Lucene.Net.Tests/Lucene.Net.Tests.csproj
+++ b/src/Lucene.Net.Tests/Lucene.Net.Tests.csproj
@@ -34,7 +34,7 @@
</PropertyGroup>
<PropertyGroup>
<RootNamespace>Lucene.Net.Tests</RootNamespace>
- <DefineConstants>$(DefineConstants);FEATURE_BREAKITERATOR;FEATURE_SERIALIZABLE</DefineConstants>
+ <DefineConstants>$(DefineConstants);FEATURE_BREAKITERATOR;FEATURE_CONCURRENTMERGESCHEDULER;FEATURE_SERIALIZABLE</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddc93f12/src/Lucene.Net/Lucene.Net.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Lucene.Net.csproj b/src/Lucene.Net/Lucene.Net.csproj
index bdc228d..d2afed0 100644
--- a/src/Lucene.Net/Lucene.Net.csproj
+++ b/src/Lucene.Net/Lucene.Net.csproj
@@ -33,7 +33,7 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
- <DefineConstants>$(DefineConstants);FEATURE_BREAKITERATOR;FEATURE_CLONEABLE;FEATURE_SERIALIZABLE;FEATURE_THREADPOOL_UNSAFEQUEUEWORKITEM</DefineConstants>
+ <DefineConstants>$(DefineConstants);FEATURE_BREAKITERATOR;FEATURE_CLONEABLE;FEATURE_CONCURRENTMERGESCHEDULER;FEATURE_SERIALIZABLE;FEATURE_THREADPOOL_UNSAFEQUEUEWORKITEM</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
[5/7] lucenenet git commit: SWEEP: Moved BreakIterator-dependent
functionality to a common Lucene.Net.Icu library so we can manage the icu.net
dependency from one place and not make the majority of the users deal with it
when they don't need to
Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Tests.Highlighter/TestBreakIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Highlighter/TestBreakIterator.cs b/src/Lucene.Net.Tests.Highlighter/TestBreakIterator.cs
deleted file mode 100644
index 07fe932..0000000
--- a/src/Lucene.Net.Tests.Highlighter/TestBreakIterator.cs
+++ /dev/null
@@ -1,421 +0,0 @@
-\ufeff#if FEATURE_BREAKITERATOR
-using Lucene.Net.Support;
-using Lucene.Net.Util;
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace Lucene.Net.Search
-{
- /*
- * 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.
- */
-
- public class TestBreakIterator : LuceneTestCase
- {
- static readonly String TEXT =
- "Apache Lucene(TM) is a high-performance, full-featured text search engine library written entirely in Java.";
-
- static readonly String SENTENCE_TEXT =
- "Apache Lucene(TM) is a high-performance, full-featured text search engine library written entirely in Java. " +
- "It is a technology suitable for nearly any application that requires" +
- "full-text search, especially cross-platform. Apache Lucene is an open source project available for free download. " +
- "Lucene makes finding things easy. Lucene is powerful. Lucene is exciting. Lucene is cool. Where be Lucene now?";
-
- private BreakIterator GetWordInstance(CultureInfo locale)
- {
- //return new WordBreakIterator(locale);
- return new IcuBreakIterator(Icu.BreakIterator.UBreakIteratorType.WORD, locale) { EnableHacks = true };
- }
-
- private BreakIterator GetSentenceInstance(CultureInfo locale)
- {
- return new IcuBreakIterator(Icu.BreakIterator.UBreakIteratorType.SENTENCE, locale);
- }
-
- [Test]
- public void TestWordIteration()
- {
- BreakIterator bi = GetWordInstance(CultureInfo.InvariantCulture);
- bi.SetText(TEXT);
-
- int temp;
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(0, temp);
-
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(6, temp);
-
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(6, temp);
-
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(7, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(7, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(13, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(13, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(14, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(16, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(17, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(17, temp);
-
- temp = bi.Previous();
- Console.WriteLine(temp);
- assertEquals(16, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(16, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(17, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(17, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(18, temp);
-
- temp = bi.Last();
- Console.WriteLine(temp);
- assertEquals(107, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(107, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(-1, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(107, temp);
- temp = bi.Previous();
- Console.WriteLine(temp);
- assertEquals(106, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(106, temp);
- temp = bi.Previous();
- Console.WriteLine(temp);
- assertEquals(102, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(102, temp);
- temp = bi.Previous();
- Console.WriteLine(temp);
- assertEquals(101, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(101, temp);
- }
-
- [Test]
- public void TestWordFollowing()
- {
- BreakIterator bi = GetWordInstance(CultureInfo.InvariantCulture);
- bi.SetText(TEXT);
-
- int temp;
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(0, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(6, temp);
-
-
- temp = bi.Following(70);
- Console.WriteLine(temp);
- assertEquals(73, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(73, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(74, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(74, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(81, temp);
- temp = bi.Following(107); // Test the final boundary
- Console.WriteLine(temp);
- assertEquals(-1, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(-1, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(107, temp);
-
- temp = bi.Following(66); // Test exactly on a boundary position
- Console.WriteLine(temp);
- assertEquals(67, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(73, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(73, temp);
-
- temp = bi.Following(0); // Test the first boundary
- Console.WriteLine(temp);
- assertEquals(6, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(7, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(7, temp);
-
- }
-
- [Test]
- public void TestWordPreceding()
- {
- BreakIterator bi = GetWordInstance(CultureInfo.InvariantCulture);
- bi.SetText(TEXT);
-
- int temp;
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(0, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(6, temp);
-
-
- temp = bi.Preceding(70);
- Console.WriteLine(temp);
- assertEquals(67, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(67, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(73, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(73, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(74, temp);
- temp = bi.Preceding(107); // Test the final boundary
- Console.WriteLine(temp);
- assertEquals(106, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(107, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(107, temp);
-
- temp = bi.Preceding(66); // Test exactly on a boundary position
- Console.WriteLine(temp);
- assertEquals(60, temp);
- temp = bi.Previous();
- Console.WriteLine(temp);
- assertEquals(59, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(59, temp);
-
- temp = bi.Preceding(0); // Test the first boundary
- Console.WriteLine(temp);
- assertEquals(-1, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(0, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(6, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(6, temp);
-
- }
-
- [Test]
- public void TestWordNextWithInt()
- {
- BreakIterator bi = GetWordInstance(CultureInfo.InvariantCulture);
- bi.SetText(TEXT);
-
- int temp;
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(0, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(6, temp);
-
-
- temp = bi.Next(10);
- Console.WriteLine(temp);
- assertEquals(23, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(23, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(39, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(39, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(40, temp);
- temp = bi.Next(-8); // Test going backward
- Console.WriteLine(temp);
- assertEquals(16, temp); // Magically, this is correct (from position 28 back 8 places) in Java, even though its start position is wrong
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(17, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(17, temp);
-
-
- temp = bi.Next(107); // Go past the last boundary
- Console.WriteLine(temp);
- assertEquals(-1, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(107, temp);
- temp = bi.Next(-107); // Go past the first boundary
- Console.WriteLine(temp);
- assertEquals(-1, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(0, temp);
-
- }
-
- [Test]
- public void TestSentenceIteration()
- {
- BreakIterator bi = GetSentenceInstance(CultureInfo.InvariantCulture);
- bi.SetText(SENTENCE_TEXT);
-
- int temp;
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(0, temp);
-
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(108, temp);
-
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(108, temp);
-
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(221, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(221, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(290, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(290, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(324, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(344, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(364, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(364, temp);
-
- temp = bi.Previous();
- Console.WriteLine(temp);
- assertEquals(344, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(344, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(364, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(364, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(380, temp);
-
- temp = bi.First();
- Console.WriteLine(temp);
- assertEquals(0, temp);
-
- temp = bi.Last();
- Console.WriteLine(temp);
- assertEquals(400, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(400, temp);
- temp = bi.Next();
- Console.WriteLine(temp);
- assertEquals(-1, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(400, temp);
- temp = bi.Previous();
- Console.WriteLine(temp);
- assertEquals(380, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(380, temp);
- temp = bi.Previous();
- Console.WriteLine(temp);
- assertEquals(364, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(364, temp);
- temp = bi.Previous();
- Console.WriteLine(temp);
- assertEquals(344, temp);
- temp = bi.Current;
- Console.WriteLine(temp);
- assertEquals(344, temp);
- }
- }
-}
-#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Tests.Highlighter/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Highlighter/project.json b/src/Lucene.Net.Tests.Highlighter/project.json
index 6caafe2..4e380ba 100644
--- a/src/Lucene.Net.Tests.Highlighter/project.json
+++ b/src/Lucene.Net.Tests.Highlighter/project.json
@@ -10,6 +10,7 @@
"testRunner": "nunit",
"frameworks": {
"netcoreapp1.0": {
+ "imports": "dnxcore50",
"buildOptions": {
"debugType": "portable",
"define": [ "NETSTANDARD" ],
@@ -33,8 +34,7 @@
"version": "1.0.1"
},
"System.Xml.XmlDocument": "4.0.1"
- },
- "imports": "dnxcore50"
+ }
},
"net451": {
"buildOptions": {
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Tests.Icu/Lucene.Net.Tests.Icu.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Icu/Lucene.Net.Tests.Icu.csproj b/src/Lucene.Net.Tests.Icu/Lucene.Net.Tests.Icu.csproj
new file mode 100644
index 0000000..355ae92
--- /dev/null
+++ b/src/Lucene.Net.Tests.Icu/Lucene.Net.Tests.Icu.csproj
@@ -0,0 +1,121 @@
+\ufeff<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{D5AA1A22-1B28-4DF6-BFDA-02519A189839}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Lucene.Net</RootNamespace>
+ <AssemblyName>Lucene.Net.Tests.Icu</AssemblyName>
+ <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup>
+ <DefineConstants>$(DefineConstants);FEATURE_BREAKITERATOR;FEATURE_SERIALIZABLE</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\Lucene.Net.Tests.Analysis.Common\Analysis\Th\TestThaiAnalyzer.cs">
+ <Link>Analysis\Th\TestThaiAnalyzer.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Tests.Analysis.Common\Analysis\Th\TestThaiTokenizerFactory.cs">
+ <Link>Analysis\Th\TestThaiTokenizerFactory.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Tests.Analysis.Common\Analysis\Th\TestThaiWordFilterFactory.cs">
+ <Link>Analysis\Th\TestThaiWordFilterFactory.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Tests.Analysis.Common\Analysis\Util\TestCharArrayIterator.cs">
+ <Link>Analysis\Util\TestCharArrayIterator.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Tests.Analysis.Common\Analysis\Util\TestSegmentingTokenizerBase.cs">
+ <Link>Analysis\Util\TestSegmentingTokenizerBase.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Tests.Highlighter\PostingsHighlight\TestMultiTermHighlighting.cs">
+ <Link>Search\PostingsHighlight\TestMultiTermHighlighting.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Tests.Highlighter\PostingsHighlight\TestPostingsHighlighter.cs">
+ <Link>Search\PostingsHighlight\TestPostingsHighlighter.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Tests.Highlighter\PostingsHighlight\TestPostingsHighlighterRanking.cs">
+ <Link>Search\PostingsHighlight\TestPostingsHighlighterRanking.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Tests.Highlighter\PostingsHighlight\TestWholeBreakIterator.cs">
+ <Link>Search\PostingsHighlight\TestWholeBreakIterator.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Tests.Highlighter\VectorHighlight\BreakIteratorBoundaryScannerTest.cs">
+ <Link>Search\VectorHighlight\BreakIteratorBoundaryScannerTest.cs</Link>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Support\TestApiConsistency.cs" />
+ <Compile Include="Support\TestExceptionSerialization.cs" />
+ <Compile Include="Support\TestIcuBreakIterator.cs" />
+ <Compile Include="..\CommonAssemblyInfo.cs">
+ <Link>Properties\CommonAssemblyInfo.cs</Link>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Lucene.Net.Analysis.Common\Lucene.Net.Analysis.Common.csproj">
+ <Project>{4add0bbc-b900-4715-9526-d871de8eea64}</Project>
+ <Name>Lucene.Net.Analysis.Common</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Lucene.Net.Highlighter\Lucene.Net.Highlighter.csproj">
+ <Project>{e9e769ea-8504-44bc-8dc9-ccf958765f8f}</Project>
+ <Name>Lucene.Net.Highlighter</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Lucene.Net.Icu\Lucene.Net.Icu.csproj">
+ <Project>{349cb7c9-7534-4e1d-9b0a-5521441af0ae}</Project>
+ <Name>Lucene.Net.Icu</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Lucene.Net.TestFramework\Lucene.Net.TestFramework.csproj">
+ <Project>{b2c0d749-ce34-4f62-a15e-00cb2ff5ddb3}</Project>
+ <Name>Lucene.Net.TestFramework</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Lucene.Net.Tests.Analysis.Common\Lucene.Net.Tests.Analysis.Common.csproj">
+ <Project>{c54fe8fa-7986-4c94-b872-d5bff7c6c74e}</Project>
+ <Name>Lucene.Net.Tests.Analysis.Common</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Lucene.Net\Lucene.Net.csproj">
+ <Project>{5d4ad9be-1ffb-41ab-9943-25737971bf57}</Project>
+ <Name>Lucene.Net</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Lucene.Net.Tests.Icu.project.json" />
+ <EmbeddedResource Include="Search\PostingsHighlight\CambridgeMA.utf8" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Tests.Icu/Lucene.Net.Tests.Icu.project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Icu/Lucene.Net.Tests.Icu.project.json b/src/Lucene.Net.Tests.Icu/Lucene.Net.Tests.Icu.project.json
new file mode 100644
index 0000000..2a96d5b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Icu/Lucene.Net.Tests.Icu.project.json
@@ -0,0 +1,12 @@
+\ufeff{
+ "runtimes": {
+ "win": {}
+ },
+ "dependencies": {
+ "NUnit": "3.5.0",
+ "icu.net": "54.1.1-alpha"
+ },
+ "frameworks": {
+ "net451": {}
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Tests.Icu/Lucene.Net.Tests.Icu.xproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Icu/Lucene.Net.Tests.Icu.xproj b/src/Lucene.Net.Tests.Icu/Lucene.Net.Tests.Icu.xproj
new file mode 100644
index 0000000..8892b87
--- /dev/null
+++ b/src/Lucene.Net.Tests.Icu/Lucene.Net.Tests.Icu.xproj
@@ -0,0 +1,22 @@
+\ufeff<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+ </PropertyGroup>
+ <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>32fd3471-e862-4055-b969-79c12a656366</ProjectGuid>
+ <RootNamespace>Lucene.Net.Search</RootNamespace>
+ <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
+ <OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
+ <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup>
+ <SchemaVersion>2.0</SchemaVersion>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
+ </ItemGroup>
+ <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Tests.Icu/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Icu/Properties/AssemblyInfo.cs b/src/Lucene.Net.Tests.Icu/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..2313bd8
--- /dev/null
+++ b/src/Lucene.Net.Tests.Icu/Properties/AssemblyInfo.cs
@@ -0,0 +1,21 @@
+\ufeffusing System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Lucene.Net.Tests.Icu")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("d5aa1a22-1b28-4df6-bfda-02519a189839")]
+
+// NOTE: Version information is in CommonAssemblyInfo.cs
[7/7] lucenenet git commit: SWEEP: Added dotnet-test-nunit-teamcity
NuGet package
Posted by ni...@apache.org.
SWEEP: Added dotnet-test-nunit-teamcity NuGet package
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/077b57fa
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/077b57fa
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/077b57fa
Branch: refs/heads/api-work
Commit: 077b57fae84113a636382cfff76f95c3d1db15c9
Parents: b1fdcca
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Mon Apr 17 20:54:51 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Mon Apr 17 20:54:51 2017 +0700
----------------------------------------------------------------------
src/Lucene.Net.Tests.Analysis.Common/project.json | 1 +
src/Lucene.Net.Tests.Analysis.Stempel/project.json | 3 ++-
src/Lucene.Net.Tests.Classification/project.json | 3 ++-
src/Lucene.Net.Tests.Codecs/project.json | 7 ++++---
src/Lucene.Net.Tests.Expressions/project.json | 3 ++-
src/Lucene.Net.Tests.Facet/project.json | 3 ++-
src/Lucene.Net.Tests.Grouping/project.json | 3 ++-
src/Lucene.Net.Tests.Highlighter/project.json | 3 ++-
src/Lucene.Net.Tests.Icu/project.json | 3 ++-
src/Lucene.Net.Tests.Join/project.json | 3 ++-
src/Lucene.Net.Tests.Memory/project.json | 1 +
src/Lucene.Net.Tests.Misc/project.json | 1 +
src/Lucene.Net.Tests.Queries/project.json | 3 ++-
src/Lucene.Net.Tests.QueryParser/project.json | 1 +
src/Lucene.Net.Tests.Sandbox/project.json | 3 ++-
src/Lucene.Net.Tests.Spatial/project.json | 1 +
src/Lucene.Net.Tests.Suggest/project.json | 1 +
src/Lucene.Net.Tests/project.json | 3 ++-
18 files changed, 32 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests.Analysis.Common/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/project.json b/src/Lucene.Net.Tests.Analysis.Common/project.json
index 55e945d..48774c7 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/project.json
+++ b/src/Lucene.Net.Tests.Analysis.Common/project.json
@@ -2,6 +2,7 @@
"version": "4.8.0",
"dependencies": {
"dotnet-test-nunit": "3.4.0-beta-3",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
"Lucene.Net.Analysis.Common": "4.8.0",
"Lucene.Net.TestFramework": "4.8.0",
"NETStandard.Library": "1.6.0",
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests.Analysis.Stempel/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Stempel/project.json b/src/Lucene.Net.Tests.Analysis.Stempel/project.json
index e1831d6..03cae31 100644
--- a/src/Lucene.Net.Tests.Analysis.Stempel/project.json
+++ b/src/Lucene.Net.Tests.Analysis.Stempel/project.json
@@ -1,7 +1,8 @@
-\ufeff{
+{
"version": "4.8.0",
"dependencies": {
"dotnet-test-nunit": "3.4.0-beta-3",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
"Lucene.Net.Analysis.Stempel": "4.8.0",
"Lucene.Net.TestFramework": "4.8.0",
"NUnit": "3.5.0"
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests.Classification/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Classification/project.json b/src/Lucene.Net.Tests.Classification/project.json
index 2e6375a..786cd73 100644
--- a/src/Lucene.Net.Tests.Classification/project.json
+++ b/src/Lucene.Net.Tests.Classification/project.json
@@ -1,7 +1,8 @@
-\ufeff{
+{
"version": "4.8.0",
"dependencies": {
"dotnet-test-nunit": "3.4.0-beta-3",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
"Lucene.Net.Analysis.Common": "4.8.0",
"Lucene.Net.Classification": "4.8.0",
"Lucene.Net.TestFramework": "4.8.0",
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests.Codecs/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Codecs/project.json b/src/Lucene.Net.Tests.Codecs/project.json
index 80c02c1..9202ff4 100644
--- a/src/Lucene.Net.Tests.Codecs/project.json
+++ b/src/Lucene.Net.Tests.Codecs/project.json
@@ -1,11 +1,12 @@
-\ufeff{
+{
"version": "4.8.0",
"dependencies": {
- "dotnet-test-nunit": "3.4.0-beta-3",
"NUnit": "3.5.0",
"Lucene.Net.Analysis.Common": "4.8.0",
"Lucene.Net.Codecs": "4.8.0",
- "Lucene.Net.TestFramework": "4.8.0"
+ "Lucene.Net.TestFramework": "4.8.0",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
+ "dotnet-test-nunit": "3.4.0-beta-3"
},
"testRunner": "nunit",
"frameworks": {
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests.Expressions/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Expressions/project.json b/src/Lucene.Net.Tests.Expressions/project.json
index 8b4ba79..e15234d 100644
--- a/src/Lucene.Net.Tests.Expressions/project.json
+++ b/src/Lucene.Net.Tests.Expressions/project.json
@@ -1,7 +1,8 @@
-\ufeff{
+{
"version": "4.8.0",
"dependencies": {
"dotnet-test-nunit": "3.4.0-beta-3",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
"Lucene.Net.Expressions": "4.8.0",
"Lucene.Net.Queries": "4.8.0",
"Lucene.Net.TestFramework": "4.8.0",
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests.Facet/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/project.json b/src/Lucene.Net.Tests.Facet/project.json
index 329d8cc..a98b578 100644
--- a/src/Lucene.Net.Tests.Facet/project.json
+++ b/src/Lucene.Net.Tests.Facet/project.json
@@ -1,7 +1,8 @@
-\ufeff{
+{
"version": "4.8.0",
"dependencies": {
"dotnet-test-nunit": "3.4.0-beta-3",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
"Lucene.Net.Facet": "4.8.0",
"Lucene.Net.Queries": "4.8.0",
"Lucene.Net.TestFramework": "4.8.0",
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests.Grouping/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Grouping/project.json b/src/Lucene.Net.Tests.Grouping/project.json
index e082ad1..1a21242 100644
--- a/src/Lucene.Net.Tests.Grouping/project.json
+++ b/src/Lucene.Net.Tests.Grouping/project.json
@@ -1,7 +1,8 @@
-\ufeff{
+{
"version": "4.8.0",
"dependencies": {
"dotnet-test-nunit": "3.4.0-beta-3",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
"Lucene.Net.Grouping": "4.8.0",
"Lucene.Net.Queries": "4.8.0",
"Lucene.Net.TestFramework": "4.8.0",
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests.Highlighter/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Highlighter/project.json b/src/Lucene.Net.Tests.Highlighter/project.json
index 4e380ba..2b1e42b 100644
--- a/src/Lucene.Net.Tests.Highlighter/project.json
+++ b/src/Lucene.Net.Tests.Highlighter/project.json
@@ -1,7 +1,8 @@
-\ufeff{
+{
"version": "4.8.0",
"dependencies": {
"dotnet-test-nunit": "3.4.0-beta-3",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
"Lucene.Net.Highlighter": "4.8.0",
"Lucene.Net.Queries": "4.8.0",
"Lucene.Net.TestFramework": "4.8.0",
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests.Icu/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Icu/project.json b/src/Lucene.Net.Tests.Icu/project.json
index f9b0fe3..a1f6506 100644
--- a/src/Lucene.Net.Tests.Icu/project.json
+++ b/src/Lucene.Net.Tests.Icu/project.json
@@ -1,7 +1,8 @@
-\ufeff{
+{
"version": "4.8.0",
"dependencies": {
"dotnet-test-nunit": "3.4.0-beta-3",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
"Lucene.Net": "4.8.0",
"Lucene.Net.Analysis.Common": "4.8.0",
"Lucene.Net.Highlighter": "4.8.0",
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests.Join/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Join/project.json b/src/Lucene.Net.Tests.Join/project.json
index 9b7ca68..e7c0c73 100644
--- a/src/Lucene.Net.Tests.Join/project.json
+++ b/src/Lucene.Net.Tests.Join/project.json
@@ -1,8 +1,9 @@
-\ufeff{
+{
"version": "4.8.0",
"dependencies": {
"dotnet-test-nunit": "3.4.0-beta-3",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
"Lucene.Net.Grouping": "4.8.0",
"Lucene.Net.Join": "4.8.0",
"Lucene.Net.TestFramework": "4.8.0",
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests.Memory/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Memory/project.json b/src/Lucene.Net.Tests.Memory/project.json
index 55ce7e9..3bcc4eb 100644
--- a/src/Lucene.Net.Tests.Memory/project.json
+++ b/src/Lucene.Net.Tests.Memory/project.json
@@ -2,6 +2,7 @@
"version": "4.8.0",
"dependencies": {
"dotnet-test-nunit": "3.4.0-beta-3",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
"Lucene.Net.Memory": "4.8.0",
"Lucene.Net.QueryParser": "4.8.0",
"Lucene.Net.TestFramework": "4.8.0",
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests.Misc/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Misc/project.json b/src/Lucene.Net.Tests.Misc/project.json
index 5efd538..2380475 100644
--- a/src/Lucene.Net.Tests.Misc/project.json
+++ b/src/Lucene.Net.Tests.Misc/project.json
@@ -2,6 +2,7 @@
"version": "4.8.0",
"dependencies": {
"dotnet-test-nunit": "3.4.0-beta-3",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
"Lucene.Net.Misc": "4.8.0",
"Lucene.Net.TestFramework": "4.8.0",
"NUnit": "3.5.0"
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests.Queries/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/project.json b/src/Lucene.Net.Tests.Queries/project.json
index 8912bfe..63bef00 100644
--- a/src/Lucene.Net.Tests.Queries/project.json
+++ b/src/Lucene.Net.Tests.Queries/project.json
@@ -1,7 +1,8 @@
-\ufeff{
+{
"version": "4.8.0",
"dependencies": {
"dotnet-test-nunit": "3.4.0-beta-3",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
"Lucene.Net.Queries": "4.8.0",
"Lucene.Net.TestFramework": "4.8.0",
"NUnit": "3.5.0"
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests.QueryParser/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/project.json b/src/Lucene.Net.Tests.QueryParser/project.json
index 75efe48..b14a9ae 100644
--- a/src/Lucene.Net.Tests.QueryParser/project.json
+++ b/src/Lucene.Net.Tests.QueryParser/project.json
@@ -2,6 +2,7 @@
"version": "4.8.0",
"dependencies": {
"dotnet-test-nunit": "3.4.0-beta-3",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
"Lucene.Net.Analysis.Common": "4.8.0",
"Lucene.Net.QueryParser": "4.8.0",
"Lucene.Net.TestFramework": "4.8.0",
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests.Sandbox/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Sandbox/project.json b/src/Lucene.Net.Tests.Sandbox/project.json
index 6a853eb..d0689cb 100644
--- a/src/Lucene.Net.Tests.Sandbox/project.json
+++ b/src/Lucene.Net.Tests.Sandbox/project.json
@@ -1,7 +1,8 @@
-\ufeff{
+{
"version": "4.8.0",
"dependencies": {
"dotnet-test-nunit": "3.4.0-beta-3",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
"Lucene.Net.Codecs": "4.8.0",
"Lucene.Net.Sandbox": "4.8.0",
"Lucene.Net.TestFramework": "4.8.0",
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests.Spatial/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Spatial/project.json b/src/Lucene.Net.Tests.Spatial/project.json
index 8703804..93abd1d 100644
--- a/src/Lucene.Net.Tests.Spatial/project.json
+++ b/src/Lucene.Net.Tests.Spatial/project.json
@@ -2,6 +2,7 @@
"version": "4.8.0",
"dependencies": {
"dotnet-test-nunit": "3.4.0-beta-3",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
"Lucene.Net.Spatial": "4.8.0",
"Lucene.Net.TestFramework": "4.8.0",
"NETStandard.Library": "1.6.0",
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests.Suggest/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Suggest/project.json b/src/Lucene.Net.Tests.Suggest/project.json
index 891f399..851c064 100644
--- a/src/Lucene.Net.Tests.Suggest/project.json
+++ b/src/Lucene.Net.Tests.Suggest/project.json
@@ -2,6 +2,7 @@
"version": "4.8.0",
"dependencies": {
"dotnet-test-nunit": "3.4.0-beta-3",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
"Lucene.Net.Analysis.Common": "4.8.0",
"Lucene.Net.Queries": "4.8.0",
"Lucene.Net.Suggest": "4.8.0",
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/077b57fa/src/Lucene.Net.Tests/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/project.json b/src/Lucene.Net.Tests/project.json
index b838d2b..1c24983 100644
--- a/src/Lucene.Net.Tests/project.json
+++ b/src/Lucene.Net.Tests/project.json
@@ -1,7 +1,8 @@
-\ufeff{
+{
"version": "4.8.0",
"dependencies": {
"dotnet-test-nunit": "3.4.0-beta-3",
+ "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
"Lucene.Net.Codecs": "4.8.0",
"Lucene.Net.Facet": "4.8.0",
"Lucene.Net.Queries": "4.8.0",
[6/7] lucenenet git commit: SWEEP: Moved BreakIterator-dependent
functionality to a common Lucene.Net.Icu library so we can manage the icu.net
dependency from one place and not make the majority of the users deal with it
when they don't need to
Posted by ni...@apache.org.
SWEEP: Moved BreakIterator-dependent functionality to a common Lucene.Net.Icu library so we can manage the icu.net dependency from one place and not make the majority of the users deal with it when they don't need to
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/b1fdcca3
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/b1fdcca3
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/b1fdcca3
Branch: refs/heads/api-work
Commit: b1fdcca3b3c3f418dfe37aafeda6f4dab75fb6d4
Parents: 63c599e
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Mon Apr 17 01:38:10 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Mon Apr 17 01:38:10 2017 +0700
----------------------------------------------------------------------
Lucene.Net.Portable.sln | 20 +
Lucene.Net.sln | 52 +++
NuGet.config | 1 +
src/IcuBreakIterator.cs | 394 -----------------
.../Analysis/Th/ThaiAnalyzer.cs | 2 +-
.../Lucene.Net.Analysis.Common.csproj | 3 -
src/Lucene.Net.Analysis.Common/project.json | 6 +-
.../Lucene.Net.Highlighter.csproj | 5 +-
.../DefaultPassageFormatter.cs | 4 +-
.../PostingsHighlight/MultiTermHighlighting.cs | 4 +-
.../PostingsHighlight/Passage.cs | 4 +-
.../PostingsHighlight/PassageFormatter.cs | 4 +-
.../PostingsHighlight/PassageScorer.cs | 4 +-
.../Properties/AssemblyInfo.cs | 2 +
src/Lucene.Net.Highlighter/project.json | 6 +-
src/Lucene.Net.Icu/Analysis/Th/stopwords.txt | 119 ++++++
src/Lucene.Net.Icu/Lucene.Net.Icu.csproj | 124 ++++++
src/Lucene.Net.Icu/Lucene.Net.Icu.project.json | 11 +
src/Lucene.Net.Icu/Lucene.Net.Icu.xproj | 19 +
src/Lucene.Net.Icu/Properties/AssemblyInfo.cs | 31 ++
src/Lucene.Net.Icu/Support/BreakIterator.cs | 231 ++++++++++
src/Lucene.Net.Icu/Support/CharacterIterator.cs | 50 +++
src/Lucene.Net.Icu/Support/IcuBreakIterator.cs | 394 +++++++++++++++++
.../Support/StringCharacterIterator.cs | 232 ++++++++++
src/Lucene.Net.Icu/project.json | 63 +++
.../Lucene.Net.Tests.Highlighter.csproj | 3 +-
.../TestBreakIterator.cs | 421 -------------------
src/Lucene.Net.Tests.Highlighter/project.json | 4 +-
.../Lucene.Net.Tests.Icu.csproj | 121 ++++++
.../Lucene.Net.Tests.Icu.project.json | 12 +
.../Lucene.Net.Tests.Icu.xproj | 22 +
.../Properties/AssemblyInfo.cs | 21 +
.../Search/PostingsHighlight/CambridgeMA.utf8 | 1 +
.../Support/TestApiConsistency.cs | 126 ++++++
.../Support/TestExceptionSerialization.cs | 54 +++
.../Support/TestIcuBreakIterator.cs | 421 +++++++++++++++++++
src/Lucene.Net.Tests.Icu/project.json | 67 +++
src/Lucene.Net/Lucene.Net.csproj | 3 -
src/Lucene.Net/Properties/AssemblyInfo.cs | 2 +
src/Lucene.Net/Support/BreakIterator.cs | 231 ----------
src/Lucene.Net/Support/CharacterIterator.cs | 50 ---
.../Support/StringCharacterIterator.cs | 232 ----------
42 files changed, 2220 insertions(+), 1356 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/Lucene.Net.Portable.sln
----------------------------------------------------------------------
diff --git a/Lucene.Net.Portable.sln b/Lucene.Net.Portable.sln
index 8044aed..7f4edad 100644
--- a/Lucene.Net.Portable.sln
+++ b/Lucene.Net.Portable.sln
@@ -79,6 +79,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{EFA10A77
build\build.ps1 = build\build.ps1
EndProjectSection
EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Lucene.Net.Icu", "src\Lucene.Net.Icu\Lucene.Net.Icu.xproj", "{44A5341B-0F52-429D-977A-C35E10ECCADF}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Lucene.Net.Tests.Icu", "src\Lucene.Net.Tests.Icu\Lucene.Net.Tests.Icu.xproj", "{32FD3471-E862-4055-B969-79C12A656366}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -367,6 +371,22 @@ Global
{C708701D-4318-469F-9822-49A80386CFEA}.Release|Any CPU.Build.0 = Release|Any CPU
{C708701D-4318-469F-9822-49A80386CFEA}.Release|x86.ActiveCfg = Release|Any CPU
{C708701D-4318-469F-9822-49A80386CFEA}.Release|x86.Build.0 = Release|Any CPU
+ {44A5341B-0F52-429D-977A-C35E10ECCADF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {44A5341B-0F52-429D-977A-C35E10ECCADF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {44A5341B-0F52-429D-977A-C35E10ECCADF}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {44A5341B-0F52-429D-977A-C35E10ECCADF}.Debug|x86.Build.0 = Debug|Any CPU
+ {44A5341B-0F52-429D-977A-C35E10ECCADF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {44A5341B-0F52-429D-977A-C35E10ECCADF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {44A5341B-0F52-429D-977A-C35E10ECCADF}.Release|x86.ActiveCfg = Release|Any CPU
+ {44A5341B-0F52-429D-977A-C35E10ECCADF}.Release|x86.Build.0 = Release|Any CPU
+ {32FD3471-E862-4055-B969-79C12A656366}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {32FD3471-E862-4055-B969-79C12A656366}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {32FD3471-E862-4055-B969-79C12A656366}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {32FD3471-E862-4055-B969-79C12A656366}.Debug|x86.Build.0 = Debug|Any CPU
+ {32FD3471-E862-4055-B969-79C12A656366}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {32FD3471-E862-4055-B969-79C12A656366}.Release|Any CPU.Build.0 = Release|Any CPU
+ {32FD3471-E862-4055-B969-79C12A656366}.Release|x86.ActiveCfg = Release|Any CPU
+ {32FD3471-E862-4055-B969-79C12A656366}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/Lucene.Net.sln
----------------------------------------------------------------------
diff --git a/Lucene.Net.sln b/Lucene.Net.sln
index b218f0d..66e91a6 100644
--- a/Lucene.Net.sln
+++ b/Lucene.Net.sln
@@ -88,6 +88,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{9811D53E
build\build.ps1 = build\build.ps1
EndProjectSection
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lucene.Net.Icu", "src\Lucene.Net.Icu\Lucene.Net.Icu.csproj", "{349CB7C9-7534-4E1D-9B0A-5521441AF0AE}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lucene.Net.Tests.Icu", "src\Lucene.Net.Tests.Icu\Lucene.Net.Tests.Icu.csproj", "{D5AA1A22-1B28-4DF6-BFDA-02519A189839}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -849,6 +853,54 @@ Global
{FBCD6AFE-0A5C-4399-8044-99C58D2912D1}.Release35|Mixed Platforms.Build.0 = Release|Any CPU
{FBCD6AFE-0A5C-4399-8044-99C58D2912D1}.Release35|x86.ActiveCfg = Release|Any CPU
{FBCD6AFE-0A5C-4399-8044-99C58D2912D1}.Release35|x86.Build.0 = Release|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Debug|x86.Build.0 = Debug|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Debug35|Any CPU.ActiveCfg = Debug|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Debug35|Any CPU.Build.0 = Debug|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Debug35|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Debug35|Mixed Platforms.Build.0 = Debug|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Debug35|x86.ActiveCfg = Debug|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Debug35|x86.Build.0 = Debug|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Release|Any CPU.Build.0 = Release|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Release|x86.ActiveCfg = Release|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Release|x86.Build.0 = Release|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Release35|Any CPU.ActiveCfg = Release|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Release35|Any CPU.Build.0 = Release|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Release35|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Release35|Mixed Platforms.Build.0 = Release|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Release35|x86.ActiveCfg = Release|Any CPU
+ {349CB7C9-7534-4E1D-9B0A-5521441AF0AE}.Release35|x86.Build.0 = Release|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Debug|x86.Build.0 = Debug|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Debug35|Any CPU.ActiveCfg = Debug|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Debug35|Any CPU.Build.0 = Debug|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Debug35|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Debug35|Mixed Platforms.Build.0 = Debug|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Debug35|x86.ActiveCfg = Debug|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Debug35|x86.Build.0 = Debug|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Release|x86.ActiveCfg = Release|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Release|x86.Build.0 = Release|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Release35|Any CPU.ActiveCfg = Release|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Release35|Any CPU.Build.0 = Release|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Release35|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Release35|Mixed Platforms.Build.0 = Release|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Release35|x86.ActiveCfg = Release|Any CPU
+ {D5AA1A22-1B28-4DF6-BFDA-02519A189839}.Release35|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/NuGet.config
----------------------------------------------------------------------
diff --git a/NuGet.config b/NuGet.config
index 8df6c0f..e0c6211 100644
--- a/NuGet.config
+++ b/NuGet.config
@@ -2,6 +2,7 @@
<configuration>
<packageSources>
<clear />
+ <add key="icunet" value="https://www.myget.org/F/icu-dotnet/api/v2" />
<add key="dotnet-cat" value="https://www.myget.org/F/dotnetcat/api/v2" />
<add key="spatial4n" value="https://www.myget.org/F/spatial4n/api/v2" />
<add key="nugetorg" value="https://www.nuget.org/api/v2" />
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/IcuBreakIterator.cs
----------------------------------------------------------------------
diff --git a/src/IcuBreakIterator.cs b/src/IcuBreakIterator.cs
deleted file mode 100644
index cc0f7cd..0000000
--- a/src/IcuBreakIterator.cs
+++ /dev/null
@@ -1,394 +0,0 @@
-\ufeff#if FEATURE_BREAKITERATOR
-using Lucene.Net.Support;
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-using System.Text;
-
-namespace Lucene.Net
-{
- /*
- * 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.
- */
-
- /// <summary>
- /// A <see cref="BreakIterator"/> implementation that encapsulates the functionality
- /// of icu.net's <see cref="Icu.BreakIterator"/> static class. A <see cref="BreakIterator"/>
- /// provides methods to move forward, reverse, and randomly through a set of text breaks
- /// defined by the <see cref="Icu.BreakIterator.UBreakIteratorType"/> enumeration.
- /// </summary>
- // LUCENENET specific type
- internal class IcuBreakIterator : BreakIterator
- {
- private readonly Icu.Locale locale;
- private readonly Icu.BreakIterator.UBreakIteratorType type;
-
- private List<int> boundaries = new List<int>();
- private int currentBoundaryIndex; // Index (not the value) of the current boundary in boundaries
- private string text;
-
- /// <summary>
- /// The start offset for the string, if supplied by a <see cref="CharacterIterator"/>
- /// </summary>
- protected int m_start;
-
- /// <summary>
- /// The end offset for the string, if supplied by a <see cref="CharacterIterator"/>
- /// </summary>
- protected int m_end;
-
- private bool enableHacks = false;
-
- public IcuBreakIterator(Icu.BreakIterator.UBreakIteratorType type)
- : this(type, CultureInfo.CurrentCulture)
- {
- }
-
- public IcuBreakIterator(Icu.BreakIterator.UBreakIteratorType type, CultureInfo locale)
- {
- if (locale == null)
- throw new ArgumentNullException("locale");
- this.locale = new Icu.Locale(locale.Name);
- this.type = type;
- }
-
-
- public virtual bool EnableHacks
- {
- get { return enableHacks; }
- set { enableHacks = value; }
- }
-
- /// <summary>
- /// Sets the current iteration position to the beginning of the text.
- /// </summary>
- /// <returns>The offset of the beginning of the text.</returns>
- public override int First()
- {
- currentBoundaryIndex = 0;
- return ReturnCurrent();
- }
-
- /// <summary>
- /// Sets the current iteration position to the end of the text.
- /// </summary>
- /// <returns>The text's past-the-end offset.</returns>
- public override int Last()
- {
- currentBoundaryIndex = boundaries.Count - 1;
- return ReturnCurrent();
- }
-
- /// <summary>
- /// Advances the iterator either forward or backward the specified number of steps.
- /// Negative values move backward, and positive values move forward. This is
- /// equivalent to repeatedly calling <see cref="Next()"/> or <see cref="Previous()"/>.
- /// </summary>
- /// <param name="n">The number of steps to move. The sign indicates the direction
- /// (negative is backwards, and positive is forwards).</param>
- /// <returns>The character offset of the boundary position n boundaries away from
- /// the current one.</returns>
- public override int Next(int n)
- {
- int result = Current;
- while (n > 0)
- {
- result = Next();
- --n;
- }
- while (n < 0)
- {
- result = Previous();
- ++n;
- }
- return result;
- }
-
- /// <summary>
- /// Advances the iterator to the next boundary position.
- /// </summary>
- /// <returns>The position of the first boundary after this one.</returns>
- public override int Next()
- {
- if (currentBoundaryIndex >= boundaries.Count - 1 || boundaries.Count == 0)
- {
- return DONE;
- }
- currentBoundaryIndex++;
- return ReturnCurrent();
- }
-
- /// <summary>
- /// Advances the iterator backwards, to the last boundary preceding this one.
- /// </summary>
- /// <returns>The position of the last boundary position preceding this one.</returns>
- public override int Previous()
- {
- if (currentBoundaryIndex == 0 || boundaries.Count == 0)
- {
- return DONE;
- }
- currentBoundaryIndex--;
- return ReturnCurrent();
- }
-
- /// <summary>
- /// Throw <see cref="ArgumentException"/> unless begin <= offset < end.
- /// </summary>
- /// <param name="offset"></param>
- private void CheckOffset(int offset)
- {
- if (offset < m_start || offset > m_end)
- {
- throw new ArgumentException("offset out of bounds");
- }
- }
-
- /// <summary>
- /// Sets the iterator to refer to the first boundary position following
- /// the specified position.
- /// </summary>
- /// <param name="offset">The position from which to begin searching for a break position.</param>
- /// <returns>The position of the first break after the current position.</returns>
- public override int Following(int offset)
- {
- CheckOffset(offset);
-
- if (boundaries.Count == 0)
- {
- return DONE;
- }
-
- int following = GetLowestIndexGreaterThan(offset);
- if (following == -1)
- {
- currentBoundaryIndex = boundaries.Count - 1;
- return DONE;
- }
- else
- {
- currentBoundaryIndex = following;
- }
- return ReturnCurrent();
- }
-
- private int GetLowestIndexGreaterThan(int offset)
- {
- int index = boundaries.BinarySearch(offset);
- if (index < 0)
- {
- return ~index;
- }
- else if (index + 1 < boundaries.Count)
- {
- return index + 1;
- }
-
- return -1;
- }
-
- /// <summary>
- /// Sets the iterator to refer to the last boundary position before the
- /// specified position.
- /// </summary>
- /// <param name="offset">The position to begin searching for a break from.</param>
- /// <returns>The position of the last boundary before the starting position.</returns>
- public override int Preceding(int offset)
- {
- CheckOffset(offset);
-
- if (boundaries.Count == 0)
- {
- return DONE;
- }
-
- int preceeding = GetHighestIndexLessThan(offset);
- if (preceeding == -1)
- {
- currentBoundaryIndex = 0;
- return DONE;
- }
- else
- {
- currentBoundaryIndex = preceeding;
- }
- return ReturnCurrent();
- }
-
- private int GetHighestIndexLessThan(int offset)
- {
- int index = boundaries.BinarySearch(offset);
- if (index < 0)
- {
- return ~index - 1;
- }
- else
- {
- // NOTE: This is intentionally allowed to return -1 in the case
- // where index == 0. This state indicates we are before the first boundary.
- return index - 1;
- }
- }
-
- /// <summary>
- /// Returns the current iteration position.
- /// </summary>
- public override int Current
- {
- get { return ReturnCurrent(); }
- }
-
- /// <summary>
- /// Gets the text being analyzed.
- /// </summary>
- public override string Text
- {
- get
- {
- return text;
- }
- }
-
- /// <summary>
- /// Set the iterator to analyze a new piece of text. This function resets
- /// the current iteration position to the beginning of the text.
- /// </summary>
- /// <param name="newText">The text to analyze.</param>
- public override void SetText(string newText)
- {
- text = newText;
- currentBoundaryIndex = 0;
- m_start = 0;
- m_end = newText.Length;
-
- LoadBoundaries(m_start, m_end);
- }
-
- public override void SetText(CharacterIterator newText)
- {
- text = newText.GetTextAsString();
- currentBoundaryIndex = 0;
- m_start = newText.BeginIndex;
- m_end = newText.EndIndex;
-
- LoadBoundaries(m_start, m_end);
- }
-
- private void LoadBoundaries(int start, int end)
- {
- IEnumerable<Icu.Boundary> icuBoundaries;
- string offsetText = text.Substring(start, end - start);
-
-#if !NETSTANDARD
- try
- {
-#endif
- if (type == Icu.BreakIterator.UBreakIteratorType.WORD)
- {
- if (enableHacks)
- {
- // LUCENENET TODO: HACK - replacing hyphen with "a" so hyphenated words aren't broken
- offsetText = offsetText.Replace("-", "a");
- }
-
- icuBoundaries = Icu.BreakIterator.GetWordBoundaries(locale, offsetText, true);
- }
- else
- {
- if (enableHacks && type == Icu.BreakIterator.UBreakIteratorType.SENTENCE)
- {
- // LUCENENET TODO: HACK - newline character causes incorrect sentence breaking.
- offsetText = offsetText.Replace("\n", " ");
- // LUCENENET TODO: HACK - the ICU sentence logic doesn't work (in English anyway) when sentences don't
- // begin with capital letters.
- offsetText = CapitalizeFirst(offsetText);
- }
-
- icuBoundaries = Icu.BreakIterator.GetBoundaries(type, locale, offsetText);
- }
-#if !NETSTANDARD
- }
- catch (AccessViolationException ace)
- {
- // LUCENENET TODO: Find a reliable way to reproduce and report the
- // AccessViolationException that happens here to the icu-dotnet project team
- throw new Exception("Hit AccessViolationException: " + ace.ToString(), ace);
- }
-#endif
-
- boundaries = icuBoundaries
- .Select(t => new[] { t.Start + start, t.End + start })
- .SelectMany(b => b)
- .Distinct()
- .ToList();
- }
-
- /// <summary>
- /// Returns true if the specified character offset is a text boundary.
- /// </summary>
- /// <param name="offset">the character offset to check.</param>
- /// <returns><c>true</c> if "offset" is a boundary position, <c>false</c> otherwise.</returns>
- public override bool IsBoundary(int offset)
- {
- CheckOffset(offset);
- return boundaries.Contains(offset);
- }
-
- private int ReturnCurrent()
- {
- if (boundaries.Count > 0)
- {
- return currentBoundaryIndex < boundaries.Count && currentBoundaryIndex > -1
- ? boundaries[currentBoundaryIndex]
- : DONE;
- }
-
- // If there are no boundaries, we must return the start offset
- return m_start;
- }
-
- /// <summary>
- /// LUCENENET TODO: This is a temporary workaround for an issue with icu-dotnet
- /// where it doesn't correctly break sentences unless they begin with a capital letter.
- /// If/when ICU is fixed, this method should be deleted and the IcuBreakIterator
- /// code changed to remove calls to this method.
- /// </summary>
- public static string CapitalizeFirst(string s)
- {
- bool isNewSentence = true;
- var result = new StringBuilder(s.Length);
- for (int i = 0; i < s.Length; i++)
- {
- if (isNewSentence && char.IsLetter(s[i]))
- {
- result.Append(char.ToUpper(s[i]));
- isNewSentence = false;
- }
- else
- result.Append(s[i]);
-
- if (s[i] == '!' || s[i] == '?' || s[i] == '.')
- {
- isNewSentence = true;
- }
- }
-
- return result.ToString();
- }
- }
-}
-#endif
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiAnalyzer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiAnalyzer.cs
index aa6e1d7..0885069 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiAnalyzer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiAnalyzer.cs
@@ -111,7 +111,7 @@ namespace Lucene.Net.Analysis.Th
/// built from a <see cref="StandardTokenizer"/> filtered with
/// <see cref="StandardFilter"/>, <see cref="LowerCaseFilter"/>, <see cref="ThaiWordFilter"/>, and
/// <see cref="StopFilter"/> </returns>
- protected override TokenStreamComponents CreateComponents(string fieldName, TextReader reader)
+ protected internal override TokenStreamComponents CreateComponents(string fieldName, TextReader reader)
{
if (m_matchVersion.OnOrAfter(LuceneVersion.LUCENE_48))
{
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj b/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj
index fb403aa..02545b2 100644
--- a/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj
+++ b/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj
@@ -41,9 +41,6 @@
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
- <Compile Include="..\IcuBreakIterator.cs">
- <Link>IcuBreakIterator.cs</Link>
- </Compile>
<Compile Include="Analysis\Bg\BulgarianAnalyzer.cs" />
<Compile Include="Analysis\Bg\BulgarianStemFilter.cs" />
<Compile Include="Analysis\Bg\BulgarianStemFilterFactory.cs" />
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Analysis.Common/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/project.json b/src/Lucene.Net.Analysis.Common/project.json
index ca771a3..556a89e 100644
--- a/src/Lucene.Net.Analysis.Common/project.json
+++ b/src/Lucene.Net.Analysis.Common/project.json
@@ -26,8 +26,7 @@
"define": [ "NETSTANDARD" ],
"compile": {
"includeFiles": [
- "../CommonAssemblyInfo.cs",
- "../IcuBreakIterator.cs"
+ "../CommonAssemblyInfo.cs"
]
},
"embed": {
@@ -52,8 +51,7 @@
"define": [ "FEATURE_CLONEABLE", "FEATURE_DTD_PROCESSING", "FEATURE_SERIALIZABLE" ],
"compile": {
"includeFiles": [
- "../CommonAssemblyInfo.cs",
- "../IcuBreakIterator.cs"
+ "../CommonAssemblyInfo.cs"
]
},
"embed": {
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj b/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj
index 31ac251..9c885d4 100644
--- a/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj
+++ b/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj
@@ -44,9 +44,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
- <Compile Include="..\IcuBreakIterator.cs">
- <Link>IcuBreakIterator.cs</Link>
- </Compile>
<Compile Include="Highlight\DefaultEncoder.cs" />
<Compile Include="Highlight\GradientFormatter.cs" />
<Compile Include="Highlight\Highlighter.cs" />
@@ -101,7 +98,7 @@
<Compile Include="VectorHighlight\SingleFragListBuilder.cs" />
<Compile Include="VectorHighlight\WeightedFieldFragList.cs" />
<Compile Include="VectorHighlight\WeightedFragListBuilder.cs" />
- <Compile Include="..\CommonAssemblyInfo.cs">
+ <Compile Include="..\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
</ItemGroup>
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Highlighter/PostingsHighlight/DefaultPassageFormatter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Highlighter/PostingsHighlight/DefaultPassageFormatter.cs b/src/Lucene.Net.Highlighter/PostingsHighlight/DefaultPassageFormatter.cs
index 4538d46..6a38bec 100644
--- a/src/Lucene.Net.Highlighter/PostingsHighlight/DefaultPassageFormatter.cs
+++ b/src/Lucene.Net.Highlighter/PostingsHighlight/DefaultPassageFormatter.cs
@@ -1,4 +1,5 @@
-\ufeffusing System;
+\ufeff#if FEATURE_BREAKITERATOR
+using System;
using System.Text;
namespace Lucene.Net.Search.PostingsHighlight
@@ -161,3 +162,4 @@ namespace Lucene.Net.Search.PostingsHighlight
}
}
}
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs b/src/Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs
index e5a5bcd..bd79c80 100644
--- a/src/Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs
+++ b/src/Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs
@@ -1,4 +1,5 @@
-\ufeffusing Lucene.Net.Analysis;
+\ufeff#if FEATURE_BREAKITERATOR
+using Lucene.Net.Analysis;
using Lucene.Net.Analysis.TokenAttributes;
using Lucene.Net.Index;
using Lucene.Net.Search.Spans;
@@ -344,3 +345,4 @@ namespace Lucene.Net.Search.PostingsHighlight
}
}
}
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Highlighter/PostingsHighlight/Passage.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Highlighter/PostingsHighlight/Passage.cs b/src/Lucene.Net.Highlighter/PostingsHighlight/Passage.cs
index 54a2446..b9a664f 100644
--- a/src/Lucene.Net.Highlighter/PostingsHighlight/Passage.cs
+++ b/src/Lucene.Net.Highlighter/PostingsHighlight/Passage.cs
@@ -1,4 +1,5 @@
-\ufeffusing Lucene.Net.Util;
+\ufeff#if FEATURE_BREAKITERATOR
+using Lucene.Net.Util;
using System.Collections.Generic;
using System.Diagnostics;
@@ -183,3 +184,4 @@ namespace Lucene.Net.Search.PostingsHighlight
}
}
}
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Highlighter/PostingsHighlight/PassageFormatter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Highlighter/PostingsHighlight/PassageFormatter.cs b/src/Lucene.Net.Highlighter/PostingsHighlight/PassageFormatter.cs
index ce367a6..770a6fa 100644
--- a/src/Lucene.Net.Highlighter/PostingsHighlight/PassageFormatter.cs
+++ b/src/Lucene.Net.Highlighter/PostingsHighlight/PassageFormatter.cs
@@ -1,4 +1,5 @@
-\ufeffnamespace Lucene.Net.Search.PostingsHighlight
+\ufeff#if FEATURE_BREAKITERATOR
+namespace Lucene.Net.Search.PostingsHighlight
{
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -42,3 +43,4 @@
public abstract object Format(Passage[] passages, string content); // LUCENENET TODO: Make return type generic?
}
}
+#endif
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Highlighter/PostingsHighlight/PassageScorer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Highlighter/PostingsHighlight/PassageScorer.cs b/src/Lucene.Net.Highlighter/PostingsHighlight/PassageScorer.cs
index af398da..de0fd45 100644
--- a/src/Lucene.Net.Highlighter/PostingsHighlight/PassageScorer.cs
+++ b/src/Lucene.Net.Highlighter/PostingsHighlight/PassageScorer.cs
@@ -1,4 +1,5 @@
-\ufeffusing System;
+\ufeff#if FEATURE_BREAKITERATOR
+using System;
namespace Lucene.Net.Search.PostingsHighlight
{
@@ -110,3 +111,4 @@ namespace Lucene.Net.Search.PostingsHighlight
}
}
}
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Highlighter/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Highlighter/Properties/AssemblyInfo.cs b/src/Lucene.Net.Highlighter/Properties/AssemblyInfo.cs
index 6d2eedf..8969ff6 100644
--- a/src/Lucene.Net.Highlighter/Properties/AssemblyInfo.cs
+++ b/src/Lucene.Net.Highlighter/Properties/AssemblyInfo.cs
@@ -24,7 +24,9 @@ using System.Runtime.InteropServices;
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e9e769ea-8504-44bc-8dc9-ccf958765f8f")]
+[assembly: InternalsVisibleTo("Lucene.Net.Icu")]
// for testing
[assembly: InternalsVisibleTo("Lucene.Net.Tests.Highlighter")]
+[assembly: InternalsVisibleTo("Lucene.Net.Tests.Icu")]
// NOTE: Version information is in CommonAssemblyInfo.cs
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Highlighter/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Highlighter/project.json b/src/Lucene.Net.Highlighter/project.json
index 5016f93..ce4b726 100644
--- a/src/Lucene.Net.Highlighter/project.json
+++ b/src/Lucene.Net.Highlighter/project.json
@@ -25,8 +25,7 @@
"define": [ "NETSTANDARD" ],
"compile": {
"includeFiles": [
- "../CommonAssemblyInfo.cs",
- "../IcuBreakIterator.cs"
+ "../CommonAssemblyInfo.cs"
]
}
},
@@ -40,8 +39,7 @@
"define": [ "FEATURE_SERIALIZABLE" ],
"compile": {
"includeFiles": [
- "../CommonAssemblyInfo.cs",
- "../IcuBreakIterator.cs"
+ "../CommonAssemblyInfo.cs"
]
}
}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Icu/Analysis/Th/stopwords.txt
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Icu/Analysis/Th/stopwords.txt b/src/Lucene.Net.Icu/Analysis/Th/stopwords.txt
new file mode 100644
index 0000000..07f0fab
--- /dev/null
+++ b/src/Lucene.Net.Icu/Analysis/Th/stopwords.txt
@@ -0,0 +1,119 @@
+# Thai stopwords from:
+# "Opinion Detection in Thai Political News Columns
+# Based on Subjectivity Analysis"
+# Khampol Sukhum, Supot Nitsuwat, and Choochart Haruechaiyasak
+\u0e44\u0e27\u0e49
+\u0e44\u0e21\u0e48
+\u0e44\u0e1b
+\u0e44\u0e14\u0e49
+\u0e43\u0e2b\u0e49
+\u0e43\u0e19
+\u0e42\u0e14\u0e22
+\u0e41\u0e2b\u0e48\u0e07
+\u0e41\u0e25\u0e49\u0e27
+\u0e41\u0e25\u0e30
+\u0e41\u0e23\u0e01
+\u0e41\u0e1a\u0e1a
+\u0e41\u0e15\u0e48
+\u0e40\u0e2d\u0e07
+\u0e40\u0e2b\u0e47\u0e19
+\u0e40\u0e25\u0e22
+\u0e40\u0e23\u0e34\u0e48\u0e21
+\u0e40\u0e23\u0e32
+\u0e40\u0e21\u0e37\u0e48\u0e2d
+\u0e40\u0e1e\u0e37\u0e48\u0e2d
+\u0e40\u0e1e\u0e23\u0e32\u0e30
+\u0e40\u0e1b\u0e47\u0e19\u0e01\u0e32\u0e23
+\u0e40\u0e1b\u0e47\u0e19
+\u0e40\u0e1b\u0e34\u0e14\u0e40\u0e1c\u0e22
+\u0e40\u0e1b\u0e34\u0e14
+\u0e40\u0e19\u0e37\u0e48\u0e2d\u0e07\u0e08\u0e32\u0e01
+\u0e40\u0e14\u0e35\u0e22\u0e27\u0e01\u0e31\u0e19
+\u0e40\u0e14\u0e35\u0e22\u0e27
+\u0e40\u0e0a\u0e48\u0e19
+\u0e40\u0e09\u0e1e\u0e32\u0e30
+\u0e40\u0e04\u0e22
+\u0e40\u0e02\u0e49\u0e32
+\u0e40\u0e02\u0e32
+\u0e2d\u0e35\u0e01
+\u0e2d\u0e32\u0e08
+\u0e2d\u0e30\u0e44\u0e23
+\u0e2d\u0e2d\u0e01
+\u0e2d\u0e22\u0e48\u0e32\u0e07
+\u0e2d\u0e22\u0e39\u0e48
+\u0e2d\u0e22\u0e32\u0e01
+\u0e2b\u0e32\u0e01
+\u0e2b\u0e25\u0e32\u0e22
+\u0e2b\u0e25\u0e31\u0e07\u0e08\u0e32\u0e01
+\u0e2b\u0e25\u0e31\u0e07
+\u0e2b\u0e23\u0e37\u0e2d
+\u0e2b\u0e19\u0e36\u0e48\u0e07
+\u0e2a\u0e48\u0e27\u0e19
+\u0e2a\u0e48\u0e07
+\u0e2a\u0e38\u0e14
+\u0e2a\u0e4d\u0e32\u0e2b\u0e23\u0e31\u0e1a
+\u0e27\u0e48\u0e32
+\u0e27\u0e31\u0e19
+\u0e25\u0e07
+\u0e23\u0e48\u0e27\u0e21
+\u0e23\u0e32\u0e22
+\u0e23\u0e31\u0e1a
+\u0e23\u0e30\u0e2b\u0e27\u0e48\u0e32\u0e07
+\u0e23\u0e27\u0e21
+\u0e22\u0e31\u0e07
+\u0e21\u0e35
+\u0e21\u0e32\u0e01
+\u0e21\u0e32
+\u0e1e\u0e23\u0e49\u0e2d\u0e21
+\u0e1e\u0e1a
+\u0e1c\u0e48\u0e32\u0e19
+\u0e1c\u0e25
+\u0e1a\u0e32\u0e07
+\u0e19\u0e48\u0e32
+\u0e19\u0e35\u0e49
+\u0e19\u0e4d\u0e32
+\u0e19\u0e31\u0e49\u0e19
+\u0e19\u0e31\u0e01
+\u0e19\u0e2d\u0e01\u0e08\u0e32\u0e01
+\u0e17\u0e38\u0e01
+\u0e17\u0e35\u0e48\u0e2a\u0e38\u0e14
+\u0e17\u0e35\u0e48
+\u0e17\u0e4d\u0e32\u0e43\u0e2b\u0e49
+\u0e17\u0e4d\u0e32
+\u0e17\u0e32\u0e07
+\u0e17\u0e31\u0e49\u0e07\u0e19\u0e35\u0e49
+\u0e17\u0e31\u0e49\u0e07
+\u0e16\u0e49\u0e32
+\u0e16\u0e39\u0e01
+\u0e16\u0e36\u0e07
+\u0e15\u0e49\u0e2d\u0e07
+\u0e15\u0e48\u0e32\u0e07\u0e46
+\u0e15\u0e48\u0e32\u0e07
+\u0e15\u0e48\u0e2d
+\u0e15\u0e32\u0e21
+\u0e15\u0e31\u0e49\u0e07\u0e41\u0e15\u0e48
+\u0e15\u0e31\u0e49\u0e07
+\u0e14\u0e49\u0e32\u0e19
+\u0e14\u0e49\u0e27\u0e22
+\u0e14\u0e31\u0e07
+\u0e0b\u0e36\u0e48\u0e07
+\u0e0a\u0e48\u0e27\u0e07
+\u0e08\u0e36\u0e07
+\u0e08\u0e32\u0e01
+\u0e08\u0e31\u0e14
+\u0e08\u0e30
+\u0e04\u0e37\u0e2d
+\u0e04\u0e27\u0e32\u0e21
+\u0e04\u0e23\u0e31\u0e49\u0e07
+\u0e04\u0e07
+\u0e02\u0e36\u0e49\u0e19
+\u0e02\u0e2d\u0e07
+\u0e02\u0e2d
+\u0e02\u0e13\u0e30
+\u0e01\u0e48\u0e2d\u0e19
+\u0e01\u0e47
+\u0e01\u0e32\u0e23
+\u0e01\u0e31\u0e1a
+\u0e01\u0e31\u0e19
+\u0e01\u0e27\u0e48\u0e32
+\u0e01\u0e25\u0e48\u0e32\u0e27
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Icu/Lucene.Net.Icu.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Icu/Lucene.Net.Icu.csproj b/src/Lucene.Net.Icu/Lucene.Net.Icu.csproj
new file mode 100644
index 0000000..267132e
--- /dev/null
+++ b/src/Lucene.Net.Icu/Lucene.Net.Icu.csproj
@@ -0,0 +1,124 @@
+\ufeff<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{349CB7C9-7534-4E1D-9B0A-5521441AF0AE}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Lucene.Net</RootNamespace>
+ <AssemblyName>Lucene.Net.Icu</AssemblyName>
+ <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup>
+ <DefineConstants>$(DefineConstants);FEATURE_BREAKITERATOR;FEATURE_SERIALIZABLE</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\Lucene.Net.Analysis.Common\Analysis\Th\ThaiAnalyzer.cs">
+ <Link>Analysis\Th\ThaiAnalyzer.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Analysis.Common\Analysis\Th\ThaiTokenizer.cs">
+ <Link>Analysis\Th\ThaiTokenizer.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Analysis.Common\Analysis\Th\ThaiTokenizerFactory.cs">
+ <Link>Analysis\Th\ThaiTokenizerFactory.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Analysis.Common\Analysis\Th\ThaiWordFilter.cs">
+ <Link>Analysis\Th\ThaiWordFilter.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Analysis.Common\Analysis\Th\ThaiWordFilterFactory.cs">
+ <Link>Analysis\Th\ThaiWordFilterFactory.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Analysis.Common\Analysis\Util\CharArrayIterator.cs">
+ <Link>Analysis\Util\CharArrayIterator.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Analysis.Common\Analysis\Util\SegmentingTokenizerBase.cs">
+ <Link>Analysis\Util\SegmentingTokenizerBase.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Highlighter\PostingsHighlight\DefaultPassageFormatter.cs">
+ <Link>Search\PostingsHighlight\DefaultPassageFormatter.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Highlighter\PostingsHighlight\MultiTermHighlighting.cs">
+ <Link>Search\PostingsHighlight\MultiTermHighlighting.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Highlighter\PostingsHighlight\Passage.cs">
+ <Link>Search\PostingsHighlight\Passage.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Highlighter\PostingsHighlight\PassageFormatter.cs">
+ <Link>Search\PostingsHighlight\PassageFormatter.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Highlighter\PostingsHighlight\PassageScorer.cs">
+ <Link>Search\PostingsHighlight\PassageScorer.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Highlighter\PostingsHighlight\PostingsHighlighter.cs">
+ <Link>Search\PostingsHighlight\PostingsHighlighter.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Highlighter\PostingsHighlight\WholeBreakIterator.cs">
+ <Link>Search\PostingsHighlight\WholeBreakIterator.cs</Link>
+ </Compile>
+ <Compile Include="..\Lucene.Net.Highlighter\VectorHighlight\BreakIteratorBoundaryScanner.cs">
+ <Link>Search\VectorHighlight\BreakIteratorBoundaryScanner.cs</Link>
+ </Compile>
+ <Compile Include="Support\BreakIterator.cs" />
+ <Compile Include="Support\CharacterIterator.cs" />
+ <Compile Include="Support\IcuBreakIterator.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="..\CommonAssemblyInfo.cs">
+ <Link>Properties\CommonAssemblyInfo.cs</Link>
+ </Compile>
+ <Compile Include="Support\StringCharacterIterator.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Lucene.Net.Analysis.Common\Lucene.Net.Analysis.Common.csproj">
+ <Project>{4add0bbc-b900-4715-9526-d871de8eea64}</Project>
+ <Name>Lucene.Net.Analysis.Common</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Lucene.Net.Highlighter\Lucene.Net.Highlighter.csproj">
+ <Project>{e9e769ea-8504-44bc-8dc9-ccf958765f8f}</Project>
+ <Name>Lucene.Net.Highlighter</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Lucene.Net\Lucene.Net.csproj">
+ <Project>{5d4ad9be-1ffb-41ab-9943-25737971bf57}</Project>
+ <Name>Lucene.Net</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Lucene.Net.Icu.project.json" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Analysis\Th\stopwords.txt" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Icu/Lucene.Net.Icu.project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Icu/Lucene.Net.Icu.project.json b/src/Lucene.Net.Icu/Lucene.Net.Icu.project.json
new file mode 100644
index 0000000..af28fc8
--- /dev/null
+++ b/src/Lucene.Net.Icu/Lucene.Net.Icu.project.json
@@ -0,0 +1,11 @@
+\ufeff{
+ "runtimes": {
+ "win": {}
+ },
+ "dependencies": {
+ "icu.net": "54.1.1-alpha"
+ },
+ "frameworks": {
+ "net451": {}
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Icu/Lucene.Net.Icu.xproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Icu/Lucene.Net.Icu.xproj b/src/Lucene.Net.Icu/Lucene.Net.Icu.xproj
new file mode 100644
index 0000000..dd48901
--- /dev/null
+++ b/src/Lucene.Net.Icu/Lucene.Net.Icu.xproj
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+ </PropertyGroup>
+ <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>44a5341b-0f52-429d-977a-c35e10eccadf</ProjectGuid>
+ <RootNamespace>Lucene.Net.Search</RootNamespace>
+ <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
+ <OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
+ <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup>
+ <SchemaVersion>2.0</SchemaVersion>
+ </PropertyGroup>
+ <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Icu/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Icu/Properties/AssemblyInfo.cs b/src/Lucene.Net.Icu/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..3cdd9b2
--- /dev/null
+++ b/src/Lucene.Net.Icu/Properties/AssemblyInfo.cs
@@ -0,0 +1,31 @@
+\ufeffusing System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Lucene.Net.Icu")]
+[assembly: AssemblyDescription(
+ "International Components for Unicode-based features including Thai analyzer support, " +
+ "an international postings highlighter, and BreakIterator support for the vector highlighter in Lucene.Net.Highlighter " +
+ "for the Lucene.Net full-text search engine library from The Apache Software Foundation.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyDefaultAlias("Lucene.Net.Icu")]
+[assembly: AssemblyCulture("")]
+
+[assembly: CLSCompliant(true)]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("349cb7c9-7534-4e1d-9b0a-5521441af0ae")]
+
+// for testing
+[assembly: InternalsVisibleTo("Lucene.Net.Tests.Icu")]
+
+// NOTE: Version information is in CommonAssemblyInfo.cs
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Icu/Support/BreakIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Icu/Support/BreakIterator.cs b/src/Lucene.Net.Icu/Support/BreakIterator.cs
new file mode 100644
index 0000000..ded1c9c
--- /dev/null
+++ b/src/Lucene.Net.Icu/Support/BreakIterator.cs
@@ -0,0 +1,231 @@
+\ufeff#if FEATURE_BREAKITERATOR
+using System;
+
+namespace Lucene.Net.Support
+{
+ /// <summary>
+ /// The <code>BreakIterator</code> class implements methods for finding
+ /// the location of boundaries in text. Instances of <code>BreakIterator</code>
+ /// maintain a current position and scan over text
+ /// returning the index of characters where boundaries occur.
+ /// </summary>
+ public abstract class BreakIterator
+#if FEATURE_CLONEABLE
+ : ICloneable
+#endif
+ {
+ /// <summary>
+ /// Constructor. BreakIterator is stateless and has no default behavior.
+ /// </summary>
+ protected BreakIterator()
+ {
+ }
+
+ /// <summary>
+ /// Create a copy of this iterator
+ /// </summary>
+ /// <returns>A member-wise copy of this</returns>
+ public object Clone()
+ {
+ return MemberwiseClone();
+ }
+
+ /// <summary>
+ /// DONE is returned by Previous(), Next(), Next(int), Preceding(int)
+ /// and Following(int) when either the first or last text boundary has been
+ /// reached.
+ /// </summary>
+ public static readonly int DONE = -1;
+
+ /// <summary>
+ /// Returns the first boundary. The iterator's current position is set
+ /// to the first text boundary.
+ /// </summary>
+ /// <returns>The character index of the first text boundary</returns>
+ public abstract int First();
+
+ /// <summary>
+ /// Returns the last boundary. The iterator's current position is set
+ /// to the last text boundary.
+ /// </summary>
+ /// <returns>The character index of the last text boundary.</returns>
+ public abstract int Last();
+
+ /// <summary>
+ /// Returns the nth boundary from the current boundary. If either
+ /// the first or last text boundary has been reached, it returns
+ /// <see cref="BreakIterator.DONE"/> and the current position is set to either
+ /// the first or last text boundary depending on which one is reached. Otherwise,
+ /// the iterator's current position is set to the new boundary.
+ /// For example, if the iterator's current position is the mth text boundary
+ /// and three more boundaries exist from the current boundary to the last text
+ /// boundary, the Next(2) call will return m + 2. The new text position is set
+ /// to the (m + 2)th text boundary. A Next(4) call would return
+ /// <see cref="BreakIterator.DONE"/> and the last text boundary would become the
+ /// new text position.
+ /// </summary>
+ /// <param name="n">
+ /// which boundary to return. A value of 0
+ /// does nothing. Negative values move to previous boundaries
+ /// and positive values move to later boundaries.
+ /// </param>
+ /// <returns>
+ /// The character index of the nth boundary from the current position
+ /// or <see cref="BreakIterator.DONE"/> if either first or last text boundary
+ /// has been reached.
+ /// </returns>
+ public abstract int Next(int n);
+
+ /// <summary>
+ /// Returns the boundary following the current boundary. If the current boundary
+ /// is the last text boundary, it returns <c>BreakIterator.DONE</c> and
+ /// the iterator's current position is unchanged. Otherwise, the iterator's
+ /// current position is set to the boundary following the current boundary.
+ /// </summary>
+ /// <returns>
+ /// The character index of the next text boundary or
+ /// <see cref="BreakIterator.DONE"/> if the current boundary is the last text
+ /// boundary.
+ /// Equivalent to Next(1).
+ /// </returns>
+ /// <seealso cref="Next(int)"/>
+ public abstract int Next();
+
+ /// <summary>
+ /// Returns the boundary preceding the current boundary. If the current boundary
+ /// is the first text boundary, it returns <code>BreakIterator.DONE</code> and
+ /// the iterator's current position is unchanged. Otherwise, the iterator's
+ /// current position is set to the boundary preceding the current boundary.
+ /// </summary>
+ /// <returns>
+ /// The character index of the previous text boundary or
+ /// <see cref="BreakIterator.DONE"/> if the current boundary is the first text
+ /// boundary.
+ /// </returns>
+ public abstract int Previous();
+
+ /// <summary>
+ /// Returns the first boundary following the specified character offset. If the
+ /// specified offset equals to the last text boundary, it returns
+ /// <see cref="BreakIterator.DONE"/> and the iterator's current position is unchanged.
+ /// Otherwise, the iterator's current position is set to the returned boundary.
+ /// The value returned is always greater than the offset or the value
+ /// <see cref="BreakIterator.DONE"/>.
+ /// </summary>
+ /// <param name="offset">the character offset to begin scanning.</param>
+ /// <returns>
+ /// The first boundary after the specified offset or
+ /// <see cref="BreakIterator.DONE"/> if the last text boundary is passed in
+ /// as the offset.
+ /// </returns>
+ /// <exception cref="ArgumentException">
+ /// if the specified offset is less than
+ /// the first text boundary or greater than the last text boundary.
+ /// </exception>
+ public abstract int Following(int offset);
+
+ /// <summary>
+ /// Returns the last boundary preceding the specified character offset. If the
+ /// specified offset equals to the first text boundary, it returns
+ /// <see cref="BreakIterator.DONE"/> and the iterator's current position is unchanged.
+ /// Otherwise, the iterator's current position is set to the returned boundary.
+ /// The value returned is always less than the offset or the value
+ /// <see cref="BreakIterator.DONE"/>.
+ /// </summary>
+ /// <param name="offset">the character offset to begin scanning.</param>
+ /// <returns>
+ /// The last boundary before the specified offset or
+ /// <see cref="BreakIterator.DONE"/> if the first text boundary is passed in
+ /// as the offset.
+ /// </returns>
+ public abstract int Preceding(int offset);
+ //{
+ // // NOTE: This implementation is here solely because we can't add new
+ // // abstract methods to an existing class. There is almost ALWAYS a
+ // // better, faster way to do this.
+ // int pos = Following(offset);
+ // while (pos >= offset && pos != DONE)
+ // {
+ // pos = Previous();
+ // }
+ // return pos;
+ //}
+
+ /// <summary>
+ /// Returns true if the specified character offset is a text boundary.
+ /// </summary>
+ /// <param name="offset">the character offset to check.</param>
+ /// <returns><c>true</c> if "offset" is a boundary position, <c>false</c> otherwise.</returns>
+ /// <exception cref="ArgumentException">
+ /// if the specified offset is less than
+ /// the first text boundary or greater than the last text boundary.
+ /// </exception>
+ public abstract bool IsBoundary(int offset);
+ //{
+ // // NOTE: This implementation probably is wrong for most situations
+ // // because it fails to take into account the possibility that a
+ // // CharacterIterator passed to setText() may not have a begin offset
+ // // of 0. But since the abstract BreakIterator doesn't have that
+ // // knowledge, it assumes the begin offset is 0. If you subclass
+ // // BreakIterator, copy the SimpleTextBoundary implementation of this
+ // // function into your subclass. [This should have been abstract at
+ // // this level, but it's too late to fix that now.]
+ // if (offset == 0)
+ // {
+ // return true;
+ // }
+ // int boundary = Following(offset - 1);
+ // if (boundary == DONE)
+ // {
+ // throw new ArgumentException();
+ // }
+ // return boundary == offset;
+ //}
+
+ /// <summary>
+ /// Returns character index of the text boundary that was most
+ /// recently returned by Next(), Next(int), Previous(), First(), Last(),
+ /// Following(int) or Preceding(int). If any of these methods returns
+ /// <see cref="BreakIterator.DONE"/> because either first or last text boundary
+ /// has been reached, it returns the first or last text boundary depending on
+ /// which one is reached.
+ /// </summary>
+ /// <returns>
+ /// The text boundary returned from the above methods, first or last
+ /// text boundary.
+ /// </returns>
+ /// <seealso cref="Next()"/>
+ /// <seealso cref="Next(int)"/>
+ /// <seealso cref="Previous()"/>
+ /// <seealso cref="First()"/>
+ /// <seealso cref="Last()"/>
+ /// <seealso cref="Following(int)"/>
+ /// <seealso cref="Preceding(int)"/>
+ public abstract int Current { get; }
+
+ /// <summary>
+ /// Get the text being scanned
+ /// </summary>
+ /// <returns>the text being scanned</returns>
+ //public abstract CharacterIterator GetText();
+ public abstract string Text { get; }
+
+ /// <summary>
+ /// Set a new text string to be scanned. The current scan
+ /// position is reset to First().
+ /// </summary>
+ /// <param name="newText">new text to scan.</param>
+ public virtual void SetText(string newText)
+ {
+ SetText(new StringCharacterIterator(newText));
+ }
+
+ /// <summary>
+ /// Set a new text string to be scanned. The current scan
+ /// position is reset to First().
+ /// </summary>
+ /// <param name="newText">new text to scan.</param>
+ public abstract void SetText(CharacterIterator newText);
+ }
+}
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Icu/Support/CharacterIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Icu/Support/CharacterIterator.cs b/src/Lucene.Net.Icu/Support/CharacterIterator.cs
new file mode 100644
index 0000000..0c81629
--- /dev/null
+++ b/src/Lucene.Net.Icu/Support/CharacterIterator.cs
@@ -0,0 +1,50 @@
+\ufeff#if FEATURE_BREAKITERATOR
+using System;
+
+namespace Lucene.Net.Support
+{
+ /*
+ * 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.
+ */
+
+ public abstract class CharacterIterator
+ {
+ public static readonly char DONE = '\uFFFF';
+
+ public abstract char Current { get; }
+
+ public abstract char First();
+
+ public abstract char Last();
+
+ public abstract char Next();
+
+ public abstract char Previous();
+
+ public abstract char SetIndex(int position);
+
+ public abstract int BeginIndex { get; }
+
+ public abstract int EndIndex { get; }
+
+ public abstract int Index { get; }
+
+ public abstract object Clone();
+
+ public abstract string GetTextAsString();
+ }
+}
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Icu/Support/IcuBreakIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Icu/Support/IcuBreakIterator.cs b/src/Lucene.Net.Icu/Support/IcuBreakIterator.cs
new file mode 100644
index 0000000..79819ed
--- /dev/null
+++ b/src/Lucene.Net.Icu/Support/IcuBreakIterator.cs
@@ -0,0 +1,394 @@
+\ufeff#if FEATURE_BREAKITERATOR
+using Lucene.Net.Support;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+
+namespace Lucene.Net
+{
+ /*
+ * 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.
+ */
+
+ /// <summary>
+ /// A <see cref="BreakIterator"/> implementation that encapsulates the functionality
+ /// of icu.net's <see cref="Icu.BreakIterator"/> static class. A <see cref="BreakIterator"/>
+ /// provides methods to move forward, reverse, and randomly through a set of text breaks
+ /// defined by the <see cref="Icu.BreakIterator.UBreakIteratorType"/> enumeration.
+ /// </summary>
+ // LUCENENET specific type
+ public class IcuBreakIterator : BreakIterator
+ {
+ private readonly Icu.Locale locale;
+ private readonly Icu.BreakIterator.UBreakIteratorType type;
+
+ private List<int> boundaries = new List<int>();
+ private int currentBoundaryIndex; // Index (not the value) of the current boundary in boundaries
+ private string text;
+
+ /// <summary>
+ /// The start offset for the string, if supplied by a <see cref="CharacterIterator"/>
+ /// </summary>
+ protected int m_start;
+
+ /// <summary>
+ /// The end offset for the string, if supplied by a <see cref="CharacterIterator"/>
+ /// </summary>
+ protected int m_end;
+
+ private bool enableHacks = false;
+
+ public IcuBreakIterator(Icu.BreakIterator.UBreakIteratorType type)
+ : this(type, CultureInfo.CurrentCulture)
+ {
+ }
+
+ public IcuBreakIterator(Icu.BreakIterator.UBreakIteratorType type, CultureInfo locale)
+ {
+ if (locale == null)
+ throw new ArgumentNullException("locale");
+ this.locale = new Icu.Locale(locale.Name);
+ this.type = type;
+ }
+
+
+ public virtual bool EnableHacks
+ {
+ get { return enableHacks; }
+ set { enableHacks = value; }
+ }
+
+ /// <summary>
+ /// Sets the current iteration position to the beginning of the text.
+ /// </summary>
+ /// <returns>The offset of the beginning of the text.</returns>
+ public override int First()
+ {
+ currentBoundaryIndex = 0;
+ return ReturnCurrent();
+ }
+
+ /// <summary>
+ /// Sets the current iteration position to the end of the text.
+ /// </summary>
+ /// <returns>The text's past-the-end offset.</returns>
+ public override int Last()
+ {
+ currentBoundaryIndex = boundaries.Count - 1;
+ return ReturnCurrent();
+ }
+
+ /// <summary>
+ /// Advances the iterator either forward or backward the specified number of steps.
+ /// Negative values move backward, and positive values move forward. This is
+ /// equivalent to repeatedly calling <see cref="Next()"/> or <see cref="Previous()"/>.
+ /// </summary>
+ /// <param name="n">The number of steps to move. The sign indicates the direction
+ /// (negative is backwards, and positive is forwards).</param>
+ /// <returns>The character offset of the boundary position n boundaries away from
+ /// the current one.</returns>
+ public override int Next(int n)
+ {
+ int result = Current;
+ while (n > 0)
+ {
+ result = Next();
+ --n;
+ }
+ while (n < 0)
+ {
+ result = Previous();
+ ++n;
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// Advances the iterator to the next boundary position.
+ /// </summary>
+ /// <returns>The position of the first boundary after this one.</returns>
+ public override int Next()
+ {
+ if (currentBoundaryIndex >= boundaries.Count - 1 || boundaries.Count == 0)
+ {
+ return DONE;
+ }
+ currentBoundaryIndex++;
+ return ReturnCurrent();
+ }
+
+ /// <summary>
+ /// Advances the iterator backwards, to the last boundary preceding this one.
+ /// </summary>
+ /// <returns>The position of the last boundary position preceding this one.</returns>
+ public override int Previous()
+ {
+ if (currentBoundaryIndex == 0 || boundaries.Count == 0)
+ {
+ return DONE;
+ }
+ currentBoundaryIndex--;
+ return ReturnCurrent();
+ }
+
+ /// <summary>
+ /// Throw <see cref="ArgumentException"/> unless begin <= offset < end.
+ /// </summary>
+ /// <param name="offset"></param>
+ private void CheckOffset(int offset)
+ {
+ if (offset < m_start || offset > m_end)
+ {
+ throw new ArgumentException("offset out of bounds");
+ }
+ }
+
+ /// <summary>
+ /// Sets the iterator to refer to the first boundary position following
+ /// the specified position.
+ /// </summary>
+ /// <param name="offset">The position from which to begin searching for a break position.</param>
+ /// <returns>The position of the first break after the current position.</returns>
+ public override int Following(int offset)
+ {
+ CheckOffset(offset);
+
+ if (boundaries.Count == 0)
+ {
+ return DONE;
+ }
+
+ int following = GetLowestIndexGreaterThan(offset);
+ if (following == -1)
+ {
+ currentBoundaryIndex = boundaries.Count - 1;
+ return DONE;
+ }
+ else
+ {
+ currentBoundaryIndex = following;
+ }
+ return ReturnCurrent();
+ }
+
+ private int GetLowestIndexGreaterThan(int offset)
+ {
+ int index = boundaries.BinarySearch(offset);
+ if (index < 0)
+ {
+ return ~index;
+ }
+ else if (index + 1 < boundaries.Count)
+ {
+ return index + 1;
+ }
+
+ return -1;
+ }
+
+ /// <summary>
+ /// Sets the iterator to refer to the last boundary position before the
+ /// specified position.
+ /// </summary>
+ /// <param name="offset">The position to begin searching for a break from.</param>
+ /// <returns>The position of the last boundary before the starting position.</returns>
+ public override int Preceding(int offset)
+ {
+ CheckOffset(offset);
+
+ if (boundaries.Count == 0)
+ {
+ return DONE;
+ }
+
+ int preceeding = GetHighestIndexLessThan(offset);
+ if (preceeding == -1)
+ {
+ currentBoundaryIndex = 0;
+ return DONE;
+ }
+ else
+ {
+ currentBoundaryIndex = preceeding;
+ }
+ return ReturnCurrent();
+ }
+
+ private int GetHighestIndexLessThan(int offset)
+ {
+ int index = boundaries.BinarySearch(offset);
+ if (index < 0)
+ {
+ return ~index - 1;
+ }
+ else
+ {
+ // NOTE: This is intentionally allowed to return -1 in the case
+ // where index == 0. This state indicates we are before the first boundary.
+ return index - 1;
+ }
+ }
+
+ /// <summary>
+ /// Returns the current iteration position.
+ /// </summary>
+ public override int Current
+ {
+ get { return ReturnCurrent(); }
+ }
+
+ /// <summary>
+ /// Gets the text being analyzed.
+ /// </summary>
+ public override string Text
+ {
+ get
+ {
+ return text;
+ }
+ }
+
+ /// <summary>
+ /// Set the iterator to analyze a new piece of text. This function resets
+ /// the current iteration position to the beginning of the text.
+ /// </summary>
+ /// <param name="newText">The text to analyze.</param>
+ public override void SetText(string newText)
+ {
+ text = newText;
+ currentBoundaryIndex = 0;
+ m_start = 0;
+ m_end = newText.Length;
+
+ LoadBoundaries(m_start, m_end);
+ }
+
+ public override void SetText(CharacterIterator newText)
+ {
+ text = newText.GetTextAsString();
+ currentBoundaryIndex = 0;
+ m_start = newText.BeginIndex;
+ m_end = newText.EndIndex;
+
+ LoadBoundaries(m_start, m_end);
+ }
+
+ private void LoadBoundaries(int start, int end)
+ {
+ IEnumerable<Icu.Boundary> icuBoundaries;
+ string offsetText = text.Substring(start, end - start);
+
+#if !NETSTANDARD
+ try
+ {
+#endif
+ if (type == Icu.BreakIterator.UBreakIteratorType.WORD)
+ {
+ if (enableHacks)
+ {
+ // LUCENENET TODO: HACK - replacing hyphen with "a" so hyphenated words aren't broken
+ offsetText = offsetText.Replace("-", "a");
+ }
+
+ icuBoundaries = Icu.BreakIterator.GetWordBoundaries(locale, offsetText, true);
+ }
+ else
+ {
+ if (enableHacks && type == Icu.BreakIterator.UBreakIteratorType.SENTENCE)
+ {
+ // LUCENENET TODO: HACK - newline character causes incorrect sentence breaking.
+ offsetText = offsetText.Replace("\n", " ");
+ // LUCENENET TODO: HACK - the ICU sentence logic doesn't work (in English anyway) when sentences don't
+ // begin with capital letters.
+ offsetText = CapitalizeFirst(offsetText);
+ }
+
+ icuBoundaries = Icu.BreakIterator.GetBoundaries(type, locale, offsetText);
+ }
+#if !NETSTANDARD
+ }
+ catch (AccessViolationException ace)
+ {
+ // LUCENENET TODO: Find a reliable way to reproduce and report the
+ // AccessViolationException that happens here to the icu-dotnet project team
+ throw new Exception("Hit AccessViolationException: " + ace.ToString(), ace);
+ }
+#endif
+
+ boundaries = icuBoundaries
+ .Select(t => new[] { t.Start + start, t.End + start })
+ .SelectMany(b => b)
+ .Distinct()
+ .ToList();
+ }
+
+ /// <summary>
+ /// Returns true if the specified character offset is a text boundary.
+ /// </summary>
+ /// <param name="offset">the character offset to check.</param>
+ /// <returns><c>true</c> if "offset" is a boundary position, <c>false</c> otherwise.</returns>
+ public override bool IsBoundary(int offset)
+ {
+ CheckOffset(offset);
+ return boundaries.Contains(offset);
+ }
+
+ private int ReturnCurrent()
+ {
+ if (boundaries.Count > 0)
+ {
+ return currentBoundaryIndex < boundaries.Count && currentBoundaryIndex > -1
+ ? boundaries[currentBoundaryIndex]
+ : DONE;
+ }
+
+ // If there are no boundaries, we must return the start offset
+ return m_start;
+ }
+
+ /// <summary>
+ /// LUCENENET TODO: This is a temporary workaround for an issue with icu-dotnet
+ /// where it doesn't correctly break sentences unless they begin with a capital letter.
+ /// If/when ICU is fixed, this method should be deleted and the IcuBreakIterator
+ /// code changed to remove calls to this method.
+ /// </summary>
+ public static string CapitalizeFirst(string s)
+ {
+ bool isNewSentence = true;
+ var result = new StringBuilder(s.Length);
+ for (int i = 0; i < s.Length; i++)
+ {
+ if (isNewSentence && char.IsLetter(s[i]))
+ {
+ result.Append(char.ToUpper(s[i]));
+ isNewSentence = false;
+ }
+ else
+ result.Append(s[i]);
+
+ if (s[i] == '!' || s[i] == '?' || s[i] == '.')
+ {
+ isNewSentence = true;
+ }
+ }
+
+ return result.ToString();
+ }
+ }
+}
+#endif
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Icu/Support/StringCharacterIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Icu/Support/StringCharacterIterator.cs b/src/Lucene.Net.Icu/Support/StringCharacterIterator.cs
new file mode 100644
index 0000000..a91e49a
--- /dev/null
+++ b/src/Lucene.Net.Icu/Support/StringCharacterIterator.cs
@@ -0,0 +1,232 @@
+\ufeff#if FEATURE_BREAKITERATOR
+/*
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved
+ * (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved
+ *
+ * The original version of this source code and documentation
+ * is copyrighted and owned by Taligent, Inc., a wholly-owned
+ * subsidiary of IBM. These materials are provided under terms
+ * of a License Agreement between Taligent and Sun. This technology
+ * is protected by multiple US and International patents.
+ *
+ * This notice and attribution to Taligent may not be removed.
+ * Taligent is a registered trademark of Taligent, Inc.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Lucene.Net.Support
+{
+ /// <summary>
+ /// <see cref="StringCharacterIterator"/> implements the
+ /// <see cref="CharacterIterator"/> protocol for a <see cref="string"/>.
+ /// The <see cref="StringCharacterIterator"/> class iterates over the
+ /// entire <see cref="string"/>.
+ /// </summary>
+ /// <seealso cref="CharacterIterator"/>
+ public class StringCharacterIterator : CharacterIterator
+ {
+ private string text;
+ private int begin;
+ private int end;
+ // invariant: begin <= pos <= end
+ private int pos;
+
+
+ public StringCharacterIterator(string text)
+ : this(text, 0)
+ {
+ }
+
+ public StringCharacterIterator(string text, int pos)
+ : this(text, 0, text.Length, pos)
+ {
+ }
+
+ public StringCharacterIterator(string text, int begin, int end, int pos)
+ {
+ if (text == null)
+ throw new ArgumentNullException("text");
+ this.text = text;
+
+ if (begin < 0 || begin > end || end > text.Length)
+ throw new ArgumentException("Invalid substring range");
+
+ if (pos < begin || pos > end)
+ throw new ArgumentException("Invalid position");
+
+ this.begin = begin;
+ this.end = end;
+ this.pos = pos;
+ }
+
+ public void SetText(string text)
+ {
+ if (text == null)
+ throw new ArgumentNullException("text");
+ this.text = text;
+ this.begin = 0;
+ this.end = text.Length;
+ this.pos = 0;
+ }
+
+ public override char First()
+ {
+ pos = begin;
+ return Current;
+ }
+
+ public override char Last()
+ {
+ if (end != begin)
+ {
+ pos = end - 1;
+ }
+ else
+ {
+ pos = end;
+ }
+ return Current;
+ }
+
+ public override char SetIndex(int position)
+ {
+ if (position < begin || position > end)
+ throw new ArgumentException("Invalid index");
+ pos = position;
+ return Current;
+ }
+
+ public override char Current
+ {
+ get
+ {
+ if (pos >= begin && pos < end)
+ {
+ return text[pos];
+ }
+ else
+ {
+ return DONE;
+ }
+ }
+ }
+
+ public override char Next()
+ {
+ if (pos < end - 1)
+ {
+ pos++;
+ return text[pos];
+ }
+ else
+ {
+ pos = end;
+ return DONE;
+ }
+ }
+
+ public override char Previous()
+ {
+ if (pos > begin)
+ {
+ pos--;
+ return text[pos];
+ }
+ else
+ {
+ return DONE;
+ }
+ }
+
+
+ public override int BeginIndex
+ {
+ get
+ {
+ return begin;
+ }
+ }
+
+ public override int EndIndex
+ {
+ get
+ {
+ return end;
+ }
+ }
+
+ public override int Index
+ {
+ get
+ {
+ return pos;
+ }
+ }
+
+ public override string GetTextAsString()
+ {
+ return text;
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (this == obj)
+ return true;
+ if (!(obj is StringCharacterIterator))
+ return false;
+
+ StringCharacterIterator that = (StringCharacterIterator)obj;
+
+ if (GetHashCode() != that.GetHashCode())
+ return false;
+ if (!text.Equals(that.text, StringComparison.Ordinal))
+ return false;
+ if (pos != that.pos || begin != that.begin || end != that.end)
+ return false;
+ return true;
+ }
+
+ public override int GetHashCode()
+ {
+ return base.GetHashCode() ^ pos ^ begin ^ end;
+ }
+
+ public override object Clone()
+ {
+ return MemberwiseClone();
+ }
+ }
+}
+#endif
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Icu/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Icu/project.json b/src/Lucene.Net.Icu/project.json
new file mode 100644
index 0000000..2e8f212
--- /dev/null
+++ b/src/Lucene.Net.Icu/project.json
@@ -0,0 +1,63 @@
+{
+ "version": "4.8.0",
+ "dependencies": {
+ "icu.net": "54.1.1-alpha",
+ "Lucene.Net": "4.8.0",
+ "Lucene.Net.Analysis.Common": "4.8.0",
+ "Lucene.Net.Highlighter": "4.8.0"
+ },
+ "buildOptions": {
+ "debugType": "portable",
+ "compile": {
+ "includeFiles": [
+ "../CommonAssemblyInfo.cs",
+ "../Lucene.Net.Analysis.Common/Analysis/Th/ThaiAnalyzer.cs",
+ "../Lucene.Net.Analysis.Common/Analysis/Th/ThaiTokenizer.cs",
+ "../Lucene.Net.Analysis.Common/Analysis/Th/ThaiTokenizerFactory.cs",
+ "../Lucene.Net.Analysis.Common/Analysis/Th/ThaiWordFilter.cs",
+ "../Lucene.Net.Analysis.Common/Analysis/Th/ThaiWordFilterFactory.cs",
+ "../Lucene.Net.Analysis.Common/Analysis/Util/CharArrayIterator.cs",
+ "../Lucene.Net.Analysis.Common/Analysis/Util/SegmentingTokenizerBase.cs",
+ "../Lucene.Net.Highlighter/PostingsHighlight/DefaultPassageFormatter.cs",
+ "../Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs",
+ "../Lucene.Net.Highlighter/PostingsHighlight/Passage.cs",
+ "../Lucene.Net.Highlighter/PostingsHighlight/PassageFormatter.cs",
+ "../Lucene.Net.Highlighter/PostingsHighlight/PassageScorer.cs",
+ "../Lucene.Net.Highlighter/PostingsHighlight/PostingsHighlighter.cs",
+ "../Lucene.Net.Highlighter/PostingsHighlight/WholeBreakIterator.cs",
+ "../Lucene.Net.Highlighter/VectorHighlight/BreakIteratorBoundaryScanner.cs"
+ ]
+ },
+ "embed": {
+ "includeFiles": [ "Analysis/Th/stopwords.txt" ]
+ }
+ },
+ "packOptions": {
+ "summary": "<Added from AssemblyDescriptionAttribute by the build script - do not remove this>",
+ "licenseUrl": "https://github.com/apache/lucenenet/blob/master/LICENSE.txt",
+ "iconUrl": "https://github.com/apache/lucenenet/blob/master/branding/logo/lucene-net-icon-128x128.png?raw=true",
+ "owners": [
+ "The Apache Software Foundation"
+ ],
+ "repository": {
+ "url": "https://github.com/apache/lucenenet"
+ },
+ "tags": [ "lucene.net", "core", "text", "search", "information", "retrieval", "lucene", "apache", "analysis", "index", "query" ]
+ },
+ "frameworks": {
+ "netstandard1.5": {
+ "imports": "dnxcore50",
+ "buildOptions": {
+ "define": [ "NETSTANDARD", "FEATURE_BREAKITERATOR" ]
+ },
+ "dependencies": {
+ "NETStandard.Library": "1.6.0"
+ }
+ },
+ "net451": {
+ "buildOptions": {
+ "define": [ "FEATURE_BREAKITERATOR", "FEATURE_SERIALIZABLE" ]
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Tests.Highlighter/Lucene.Net.Tests.Highlighter.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Highlighter/Lucene.Net.Tests.Highlighter.csproj b/src/Lucene.Net.Tests.Highlighter/Lucene.Net.Tests.Highlighter.csproj
index 3ed7239..d87e43d 100644
--- a/src/Lucene.Net.Tests.Highlighter/Lucene.Net.Tests.Highlighter.csproj
+++ b/src/Lucene.Net.Tests.Highlighter/Lucene.Net.Tests.Highlighter.csproj
@@ -56,7 +56,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Support\TestExceptionSerialization.cs" />
<Compile Include="Support\TestApiConsistency.cs" />
- <Compile Include="TestBreakIterator.cs" />
<Compile Include="VectorHighlight\AbstractTestCase.cs" />
<Compile Include="VectorHighlight\BreakIteratorBoundaryScannerTest.cs" />
<Compile Include="VectorHighlight\FastVectorHighlighterTest.cs" />
@@ -70,7 +69,7 @@
<Compile Include="VectorHighlight\SimpleFragmentsBuilderTest.cs" />
<Compile Include="VectorHighlight\SingleFragListBuilderTest.cs" />
<Compile Include="VectorHighlight\WeightedFragListBuilderTest.cs" />
- <Compile Include="..\CommonAssemblyInfo.cs">
+ <Compile Include="..\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
</ItemGroup>
[3/7] lucenenet git commit: SWEEP: Moved BreakIterator-dependent
functionality to a common Lucene.Net.Icu library so we can manage the icu.net
dependency from one place and not make the majority of the users deal with it
when they don't need to
Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Tests.Icu/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Icu/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Icu/Support/TestApiConsistency.cs
new file mode 100644
index 0000000..1a143eb
--- /dev/null
+++ b/src/Lucene.Net.Tests.Icu/Support/TestApiConsistency.cs
@@ -0,0 +1,126 @@
+\ufeffusing Lucene.Net.Attributes;
+using NUnit.Framework;
+using System;
+
+namespace Lucene.Net.Support
+{
+ /// <summary>
+ /// LUCENENET specific tests for ensuring API conventions are followed
+ /// </summary>
+ public class TestApiConsistency : ApiScanTestBase
+ {
+ [Test, LuceneNetSpecific]
+ [TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]
+ public override void TestProtectedFieldNames(Type typeFromTargetAssembly)
+ {
+ base.TestProtectedFieldNames(typeFromTargetAssembly);
+ }
+
+ [Test, LuceneNetSpecific]
+ [TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]
+ public override void TestPrivateFieldNames(Type typeFromTargetAssembly)
+ {
+ base.TestPrivateFieldNames(typeFromTargetAssembly);
+ }
+
+ [Test, LuceneNetSpecific]
+ [TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]
+ public override void TestPublicFields(Type typeFromTargetAssembly)
+ {
+ base.TestPublicFields(typeFromTargetAssembly);
+ }
+
+ [Test, LuceneNetSpecific]
+ [TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]
+ public override void TestMethodParameterNames(Type typeFromTargetAssembly)
+ {
+ base.TestMethodParameterNames(typeFromTargetAssembly);
+ }
+
+ [Test, LuceneNetSpecific]
+ [TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]
+ public override void TestInterfaceNames(Type typeFromTargetAssembly)
+ {
+ base.TestInterfaceNames(typeFromTargetAssembly);
+ }
+
+ [Test, LuceneNetSpecific]
+ [TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]
+ public override void TestClassNames(Type typeFromTargetAssembly)
+ {
+ base.TestClassNames(typeFromTargetAssembly);
+ }
+
+ [Test, LuceneNetSpecific]
+ [TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]
+ public override void TestForPropertiesWithNoGetter(Type typeFromTargetAssembly)
+ {
+ base.TestForPropertiesWithNoGetter(typeFromTargetAssembly);
+ }
+
+ [Test, LuceneNetSpecific]
+ [TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]
+ public override void TestForPropertiesThatReturnArray(Type typeFromTargetAssembly)
+ {
+ base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
+ }
+
+ [Test, LuceneNetSpecific]
+ [TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]
+ public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
+ {
+ base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
+ }
+
+ [Test, LuceneNetSpecific]
+ [TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]
+ public override void TestForPublicMembersContainingComparer(Type typeFromTargetAssembly)
+ {
+ base.TestForPublicMembersContainingComparer(typeFromTargetAssembly);
+ }
+
+ [Test, LuceneNetSpecific]
+ [TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]
+ public override void TestForPublicMembersNamedSize(Type typeFromTargetAssembly)
+ {
+ base.TestForPublicMembersNamedSize(typeFromTargetAssembly);
+ }
+
+ [Test, LuceneNetSpecific]
+ [TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]
+ public override void TestForPublicMembersContainingNonNetNumeric(Type typeFromTargetAssembly)
+ {
+ base.TestForPublicMembersContainingNonNetNumeric(typeFromTargetAssembly);
+ }
+
+ [Test, LuceneNetSpecific]
+ [TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]
+ public override void TestForTypesContainingNonNetNumeric(Type typeFromTargetAssembly)
+ {
+ base.TestForTypesContainingNonNetNumeric(typeFromTargetAssembly);
+ }
+
+ [Test, LuceneNetSpecific]
+ [TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]
+ public override void TestForPublicMembersWithNullableEnum(Type typeFromTargetAssembly)
+ {
+ base.TestForPublicMembersWithNullableEnum(typeFromTargetAssembly);
+ }
+
+ // LUCENENET NOTE: This test is only for identifying members who were changed from
+ // ICollection, IList or ISet to IEnumerable during the port (that should be changed back)
+ //[Test, LuceneNetSpecific]
+ //[TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]
+ //public override void TestForMembersAcceptingOrReturningIEnumerable(Type typeFromTargetAssembly)
+ //{
+ // base.TestForMembersAcceptingOrReturningIEnumerable(typeFromTargetAssembly);
+ //}
+
+ [Test, LuceneNetSpecific]
+ [TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]
+ public override void TestForMembersAcceptingOrReturningListOrDictionary(Type typeFromTargetAssembly)
+ {
+ base.TestForMembersAcceptingOrReturningListOrDictionary(typeFromTargetAssembly);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Tests.Icu/Support/TestExceptionSerialization.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Icu/Support/TestExceptionSerialization.cs b/src/Lucene.Net.Tests.Icu/Support/TestExceptionSerialization.cs
new file mode 100644
index 0000000..ad84905
--- /dev/null
+++ b/src/Lucene.Net.Tests.Icu/Support/TestExceptionSerialization.cs
@@ -0,0 +1,54 @@
+\ufeff#if FEATURE_SERIALIZABLE
+using Lucene.Net.Attributes;
+using NUnit.Framework;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Lucene.Net.Support
+{
+ /*
+ * 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.
+ */
+
+ [TestFixture]
+ public class TestExceptionSerialization : ExceptionSerializationTestBase
+ {
+ public static IEnumerable<object> ExceptionTestData
+ {
+ get
+ {
+ var exceptionTypes = typeof(Lucene.Net.Search.Highlight.DefaultEncoder).Assembly.GetTypes().Where(t => typeof(Exception).IsAssignableFrom(t)).Cast<object>();
+
+ // If the assembly has no exceptions, just provide Exception so the test will pass
+ if (!exceptionTypes.Any())
+ {
+ return new Type[] { typeof(Exception) };
+ }
+
+ return exceptionTypes;
+ }
+ }
+
+ [Test, LuceneNetSpecific]
+ public void AllExceptionsInLuceneNamespaceCanSerialize([ValueSource("ExceptionTestData")]Type luceneException)
+ {
+ var instance = TryInstantiate(luceneException);
+ Assert.That(TypeCanSerialize(instance), string.Format("Unable to serialize {0}", luceneException.FullName));
+ }
+ }
+}
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Tests.Icu/Support/TestIcuBreakIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Icu/Support/TestIcuBreakIterator.cs b/src/Lucene.Net.Tests.Icu/Support/TestIcuBreakIterator.cs
new file mode 100644
index 0000000..2bc790c
--- /dev/null
+++ b/src/Lucene.Net.Tests.Icu/Support/TestIcuBreakIterator.cs
@@ -0,0 +1,421 @@
+\ufeff#if FEATURE_BREAKITERATOR
+using Lucene.Net.Support;
+using Lucene.Net.Util;
+using NUnit.Framework;
+using System;
+using System.Globalization;
+
+namespace Lucene.Net.Support
+{
+ /*
+ * 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.
+ */
+
+ public class TestIcuBreakIterator : LuceneTestCase
+ {
+ static readonly String TEXT =
+ "Apache Lucene(TM) is a high-performance, full-featured text search engine library written entirely in Java.";
+
+ static readonly String SENTENCE_TEXT =
+ "Apache Lucene(TM) is a high-performance, full-featured text search engine library written entirely in Java. " +
+ "It is a technology suitable for nearly any application that requires" +
+ "full-text search, especially cross-platform. Apache Lucene is an open source project available for free download. " +
+ "Lucene makes finding things easy. Lucene is powerful. Lucene is exciting. Lucene is cool. Where be Lucene now?";
+
+ private BreakIterator GetWordInstance(CultureInfo locale)
+ {
+ //return new WordBreakIterator(locale);
+ return new IcuBreakIterator(Icu.BreakIterator.UBreakIteratorType.WORD, locale) { EnableHacks = true };
+ }
+
+ private BreakIterator GetSentenceInstance(CultureInfo locale)
+ {
+ return new IcuBreakIterator(Icu.BreakIterator.UBreakIteratorType.SENTENCE, locale);
+ }
+
+ [Test]
+ public void TestWordIteration()
+ {
+ BreakIterator bi = GetWordInstance(CultureInfo.InvariantCulture);
+ bi.SetText(TEXT);
+
+ int temp;
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(0, temp);
+
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(6, temp);
+
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(6, temp);
+
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(7, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(7, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(13, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(13, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(14, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(16, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(17, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(17, temp);
+
+ temp = bi.Previous();
+ Console.WriteLine(temp);
+ assertEquals(16, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(16, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(17, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(17, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(18, temp);
+
+ temp = bi.Last();
+ Console.WriteLine(temp);
+ assertEquals(107, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(107, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(-1, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(107, temp);
+ temp = bi.Previous();
+ Console.WriteLine(temp);
+ assertEquals(106, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(106, temp);
+ temp = bi.Previous();
+ Console.WriteLine(temp);
+ assertEquals(102, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(102, temp);
+ temp = bi.Previous();
+ Console.WriteLine(temp);
+ assertEquals(101, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(101, temp);
+ }
+
+ [Test]
+ public void TestWordFollowing()
+ {
+ BreakIterator bi = GetWordInstance(CultureInfo.InvariantCulture);
+ bi.SetText(TEXT);
+
+ int temp;
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(0, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(6, temp);
+
+
+ temp = bi.Following(70);
+ Console.WriteLine(temp);
+ assertEquals(73, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(73, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(74, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(74, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(81, temp);
+ temp = bi.Following(107); // Test the final boundary
+ Console.WriteLine(temp);
+ assertEquals(-1, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(-1, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(107, temp);
+
+ temp = bi.Following(66); // Test exactly on a boundary position
+ Console.WriteLine(temp);
+ assertEquals(67, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(73, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(73, temp);
+
+ temp = bi.Following(0); // Test the first boundary
+ Console.WriteLine(temp);
+ assertEquals(6, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(7, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(7, temp);
+
+ }
+
+ [Test]
+ public void TestWordPreceding()
+ {
+ BreakIterator bi = GetWordInstance(CultureInfo.InvariantCulture);
+ bi.SetText(TEXT);
+
+ int temp;
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(0, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(6, temp);
+
+
+ temp = bi.Preceding(70);
+ Console.WriteLine(temp);
+ assertEquals(67, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(67, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(73, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(73, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(74, temp);
+ temp = bi.Preceding(107); // Test the final boundary
+ Console.WriteLine(temp);
+ assertEquals(106, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(107, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(107, temp);
+
+ temp = bi.Preceding(66); // Test exactly on a boundary position
+ Console.WriteLine(temp);
+ assertEquals(60, temp);
+ temp = bi.Previous();
+ Console.WriteLine(temp);
+ assertEquals(59, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(59, temp);
+
+ temp = bi.Preceding(0); // Test the first boundary
+ Console.WriteLine(temp);
+ assertEquals(-1, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(0, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(6, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(6, temp);
+
+ }
+
+ [Test]
+ public void TestWordNextWithInt()
+ {
+ BreakIterator bi = GetWordInstance(CultureInfo.InvariantCulture);
+ bi.SetText(TEXT);
+
+ int temp;
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(0, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(6, temp);
+
+
+ temp = bi.Next(10);
+ Console.WriteLine(temp);
+ assertEquals(23, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(23, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(39, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(39, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(40, temp);
+ temp = bi.Next(-8); // Test going backward
+ Console.WriteLine(temp);
+ assertEquals(16, temp); // Magically, this is correct (from position 28 back 8 places) in Java, even though its start position is wrong
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(17, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(17, temp);
+
+
+ temp = bi.Next(107); // Go past the last boundary
+ Console.WriteLine(temp);
+ assertEquals(-1, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(107, temp);
+ temp = bi.Next(-107); // Go past the first boundary
+ Console.WriteLine(temp);
+ assertEquals(-1, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(0, temp);
+
+ }
+
+ [Test]
+ public void TestSentenceIteration()
+ {
+ BreakIterator bi = GetSentenceInstance(CultureInfo.InvariantCulture);
+ bi.SetText(SENTENCE_TEXT);
+
+ int temp;
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(0, temp);
+
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(108, temp);
+
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(108, temp);
+
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(221, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(221, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(290, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(290, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(324, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(344, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(364, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(364, temp);
+
+ temp = bi.Previous();
+ Console.WriteLine(temp);
+ assertEquals(344, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(344, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(364, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(364, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(380, temp);
+
+ temp = bi.First();
+ Console.WriteLine(temp);
+ assertEquals(0, temp);
+
+ temp = bi.Last();
+ Console.WriteLine(temp);
+ assertEquals(400, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(400, temp);
+ temp = bi.Next();
+ Console.WriteLine(temp);
+ assertEquals(-1, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(400, temp);
+ temp = bi.Previous();
+ Console.WriteLine(temp);
+ assertEquals(380, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(380, temp);
+ temp = bi.Previous();
+ Console.WriteLine(temp);
+ assertEquals(364, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(364, temp);
+ temp = bi.Previous();
+ Console.WriteLine(temp);
+ assertEquals(344, temp);
+ temp = bi.Current;
+ Console.WriteLine(temp);
+ assertEquals(344, temp);
+ }
+ }
+}
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Tests.Icu/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Icu/project.json b/src/Lucene.Net.Tests.Icu/project.json
new file mode 100644
index 0000000..f9b0fe3
--- /dev/null
+++ b/src/Lucene.Net.Tests.Icu/project.json
@@ -0,0 +1,67 @@
+\ufeff{
+ "version": "4.8.0",
+ "dependencies": {
+ "dotnet-test-nunit": "3.4.0-beta-3",
+ "Lucene.Net": "4.8.0",
+ "Lucene.Net.Analysis.Common": "4.8.0",
+ "Lucene.Net.Highlighter": "4.8.0",
+ "Lucene.Net.Icu": "4.8.0",
+ "Lucene.Net.TestFramework": "4.8.0",
+ "Lucene.Net.Tests.Analysis.Common": "4.8.0",
+ "NUnit": "3.5.0"
+ },
+ "buildOptions": {
+ "debugType": "portable",
+ "compile": {
+ "includeFiles": [
+ "../CommonAssemblyInfo.cs",
+ "../Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiAnalyzer.cs",
+ "../Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiTokenizerFactory.cs",
+ "../Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiWordFilterFactory.cs",
+ "../Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArrayIterator.cs",
+ "../Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestSegmentingTokenizerBase.cs",
+ "../Lucene.Net.Tests.Highlighter/PostingsHighlight/TestMultiTermHighlighting.cs",
+ "../Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighter.cs",
+ "../Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighterRanking.cs",
+ "../Lucene.Net.Tests.Highlighter/PostingsHighlight/TestWholeBreakIterator.cs",
+ "../Lucene.Net.Tests.Highlighter/VectorHighlight/BreakIteratorBoundaryScannerTest.cs"
+ ]
+ },
+ "embed": {
+ "includeFiles": [
+ "Search/PostingsHighlight/CambridgeMA.utf8"
+ ]
+ }
+ },
+ "testRunner": "nunit",
+ "frameworks": {
+ "netcoreapp1.0": {
+ "imports": "dnxcore50",
+ "buildOptions": {
+ "define": [ "NETSTANDARD", "FEATURE_BREAKITERATOR" ],
+ "compile": {
+ "excludeFiles": [
+ "Support/TestApiConsistency.cs"
+ ]
+ }
+ },
+ "dependencies": {
+ "Microsoft.NETCore.App": {
+ "type": "platform",
+ "version": "1.0.1"
+ },
+ "System.Xml.XmlDocument": "4.0.1"
+ }
+ },
+ "net451": {
+ "buildOptions": {
+ "define": [ "FEATURE_BREAKITERATOR", "FEATURE_SERIALIZABLE" ]
+ }
+ }
+ },
+
+ "runtimes": {
+ "win7-x86": {},
+ "win7-x64": {}
+ }
+}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net/Lucene.Net.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Lucene.Net.csproj b/src/Lucene.Net/Lucene.Net.csproj
index 1e3f970..69de9ee 100644
--- a/src/Lucene.Net/Lucene.Net.csproj
+++ b/src/Lucene.Net/Lucene.Net.csproj
@@ -599,7 +599,6 @@
<Compile Include="Support\AtomicLong.cs" />
<Compile Include="Support\AtomicObject.cs" />
<Compile Include="Support\AtomicReferenceArray.cs" />
- <Compile Include="Support\BreakIterator.cs" />
<Compile Include="Support\Buffer.cs" />
<Compile Include="Support\AttributeItem.cs" />
<Compile Include="Support\BitArrayExtensions.cs" />
@@ -611,7 +610,6 @@
<Compile Include="Support\C5.Support.cs" />
<Compile Include="Support\Character.cs" />
<Compile Include="Support\Arrays.cs" />
- <Compile Include="Support\CharacterIterator.cs" />
<Compile Include="Support\Codecs\CodecNameAttribute.cs" />
<Compile Include="Support\Codecs\DefaultDocValuesFormatFactory.cs" />
<Compile Include="Support\Codecs\DefaultPostingsFormatFactory.cs" />
@@ -668,7 +666,6 @@
<Compile Include="Support\SignedZeroComparer.cs" />
<Compile Include="Support\StreamUtils.cs" />
<Compile Include="Support\StringBuilderExtensions.cs" />
- <Compile Include="Support\StringCharacterIterator.cs" />
<Compile Include="Support\StringCharSequenceWrapper.cs" />
<Compile Include="Support\StringExtensions.cs" />
<Compile Include="Support\StringTokenizer.cs" />
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Properties/AssemblyInfo.cs b/src/Lucene.Net/Properties/AssemblyInfo.cs
index b558f6a..2acfe37 100644
--- a/src/Lucene.Net/Properties/AssemblyInfo.cs
+++ b/src/Lucene.Net/Properties/AssemblyInfo.cs
@@ -55,10 +55,12 @@ using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("Lucene.Net.Tests")]
[assembly: InternalsVisibleTo("Lucene.Net.TestFramework")]
[assembly: InternalsVisibleTo("Lucene.Net.Highlighter")] // For Automaton
+[assembly: InternalsVisibleTo("Lucene.Net.Icu")] // For Automaton
[assembly: InternalsVisibleTo("Lucene.Net.Misc")]
[assembly: InternalsVisibleTo("Lucene.Net.Suggest")] // For Automaton
[assembly: InternalsVisibleTo("Lucene.Net.Tests.Analysis.Common")] // For Automaton
[assembly: InternalsVisibleTo("Lucene.Net.Tests.Highlighter")] // For Automaton
+[assembly: InternalsVisibleTo("Lucene.Net.Tests.Icu")] // For Analysis.Util.TestSegmentingTokenizerBase
[assembly: InternalsVisibleTo("Lucene.Net.Tests.Misc")]
[assembly: InternalsVisibleTo("Lucene.Net.Tests.QueryParser")]
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net/Support/BreakIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Support/BreakIterator.cs b/src/Lucene.Net/Support/BreakIterator.cs
deleted file mode 100644
index ded1c9c..0000000
--- a/src/Lucene.Net/Support/BreakIterator.cs
+++ /dev/null
@@ -1,231 +0,0 @@
-\ufeff#if FEATURE_BREAKITERATOR
-using System;
-
-namespace Lucene.Net.Support
-{
- /// <summary>
- /// The <code>BreakIterator</code> class implements methods for finding
- /// the location of boundaries in text. Instances of <code>BreakIterator</code>
- /// maintain a current position and scan over text
- /// returning the index of characters where boundaries occur.
- /// </summary>
- public abstract class BreakIterator
-#if FEATURE_CLONEABLE
- : ICloneable
-#endif
- {
- /// <summary>
- /// Constructor. BreakIterator is stateless and has no default behavior.
- /// </summary>
- protected BreakIterator()
- {
- }
-
- /// <summary>
- /// Create a copy of this iterator
- /// </summary>
- /// <returns>A member-wise copy of this</returns>
- public object Clone()
- {
- return MemberwiseClone();
- }
-
- /// <summary>
- /// DONE is returned by Previous(), Next(), Next(int), Preceding(int)
- /// and Following(int) when either the first or last text boundary has been
- /// reached.
- /// </summary>
- public static readonly int DONE = -1;
-
- /// <summary>
- /// Returns the first boundary. The iterator's current position is set
- /// to the first text boundary.
- /// </summary>
- /// <returns>The character index of the first text boundary</returns>
- public abstract int First();
-
- /// <summary>
- /// Returns the last boundary. The iterator's current position is set
- /// to the last text boundary.
- /// </summary>
- /// <returns>The character index of the last text boundary.</returns>
- public abstract int Last();
-
- /// <summary>
- /// Returns the nth boundary from the current boundary. If either
- /// the first or last text boundary has been reached, it returns
- /// <see cref="BreakIterator.DONE"/> and the current position is set to either
- /// the first or last text boundary depending on which one is reached. Otherwise,
- /// the iterator's current position is set to the new boundary.
- /// For example, if the iterator's current position is the mth text boundary
- /// and three more boundaries exist from the current boundary to the last text
- /// boundary, the Next(2) call will return m + 2. The new text position is set
- /// to the (m + 2)th text boundary. A Next(4) call would return
- /// <see cref="BreakIterator.DONE"/> and the last text boundary would become the
- /// new text position.
- /// </summary>
- /// <param name="n">
- /// which boundary to return. A value of 0
- /// does nothing. Negative values move to previous boundaries
- /// and positive values move to later boundaries.
- /// </param>
- /// <returns>
- /// The character index of the nth boundary from the current position
- /// or <see cref="BreakIterator.DONE"/> if either first or last text boundary
- /// has been reached.
- /// </returns>
- public abstract int Next(int n);
-
- /// <summary>
- /// Returns the boundary following the current boundary. If the current boundary
- /// is the last text boundary, it returns <c>BreakIterator.DONE</c> and
- /// the iterator's current position is unchanged. Otherwise, the iterator's
- /// current position is set to the boundary following the current boundary.
- /// </summary>
- /// <returns>
- /// The character index of the next text boundary or
- /// <see cref="BreakIterator.DONE"/> if the current boundary is the last text
- /// boundary.
- /// Equivalent to Next(1).
- /// </returns>
- /// <seealso cref="Next(int)"/>
- public abstract int Next();
-
- /// <summary>
- /// Returns the boundary preceding the current boundary. If the current boundary
- /// is the first text boundary, it returns <code>BreakIterator.DONE</code> and
- /// the iterator's current position is unchanged. Otherwise, the iterator's
- /// current position is set to the boundary preceding the current boundary.
- /// </summary>
- /// <returns>
- /// The character index of the previous text boundary or
- /// <see cref="BreakIterator.DONE"/> if the current boundary is the first text
- /// boundary.
- /// </returns>
- public abstract int Previous();
-
- /// <summary>
- /// Returns the first boundary following the specified character offset. If the
- /// specified offset equals to the last text boundary, it returns
- /// <see cref="BreakIterator.DONE"/> and the iterator's current position is unchanged.
- /// Otherwise, the iterator's current position is set to the returned boundary.
- /// The value returned is always greater than the offset or the value
- /// <see cref="BreakIterator.DONE"/>.
- /// </summary>
- /// <param name="offset">the character offset to begin scanning.</param>
- /// <returns>
- /// The first boundary after the specified offset or
- /// <see cref="BreakIterator.DONE"/> if the last text boundary is passed in
- /// as the offset.
- /// </returns>
- /// <exception cref="ArgumentException">
- /// if the specified offset is less than
- /// the first text boundary or greater than the last text boundary.
- /// </exception>
- public abstract int Following(int offset);
-
- /// <summary>
- /// Returns the last boundary preceding the specified character offset. If the
- /// specified offset equals to the first text boundary, it returns
- /// <see cref="BreakIterator.DONE"/> and the iterator's current position is unchanged.
- /// Otherwise, the iterator's current position is set to the returned boundary.
- /// The value returned is always less than the offset or the value
- /// <see cref="BreakIterator.DONE"/>.
- /// </summary>
- /// <param name="offset">the character offset to begin scanning.</param>
- /// <returns>
- /// The last boundary before the specified offset or
- /// <see cref="BreakIterator.DONE"/> if the first text boundary is passed in
- /// as the offset.
- /// </returns>
- public abstract int Preceding(int offset);
- //{
- // // NOTE: This implementation is here solely because we can't add new
- // // abstract methods to an existing class. There is almost ALWAYS a
- // // better, faster way to do this.
- // int pos = Following(offset);
- // while (pos >= offset && pos != DONE)
- // {
- // pos = Previous();
- // }
- // return pos;
- //}
-
- /// <summary>
- /// Returns true if the specified character offset is a text boundary.
- /// </summary>
- /// <param name="offset">the character offset to check.</param>
- /// <returns><c>true</c> if "offset" is a boundary position, <c>false</c> otherwise.</returns>
- /// <exception cref="ArgumentException">
- /// if the specified offset is less than
- /// the first text boundary or greater than the last text boundary.
- /// </exception>
- public abstract bool IsBoundary(int offset);
- //{
- // // NOTE: This implementation probably is wrong for most situations
- // // because it fails to take into account the possibility that a
- // // CharacterIterator passed to setText() may not have a begin offset
- // // of 0. But since the abstract BreakIterator doesn't have that
- // // knowledge, it assumes the begin offset is 0. If you subclass
- // // BreakIterator, copy the SimpleTextBoundary implementation of this
- // // function into your subclass. [This should have been abstract at
- // // this level, but it's too late to fix that now.]
- // if (offset == 0)
- // {
- // return true;
- // }
- // int boundary = Following(offset - 1);
- // if (boundary == DONE)
- // {
- // throw new ArgumentException();
- // }
- // return boundary == offset;
- //}
-
- /// <summary>
- /// Returns character index of the text boundary that was most
- /// recently returned by Next(), Next(int), Previous(), First(), Last(),
- /// Following(int) or Preceding(int). If any of these methods returns
- /// <see cref="BreakIterator.DONE"/> because either first or last text boundary
- /// has been reached, it returns the first or last text boundary depending on
- /// which one is reached.
- /// </summary>
- /// <returns>
- /// The text boundary returned from the above methods, first or last
- /// text boundary.
- /// </returns>
- /// <seealso cref="Next()"/>
- /// <seealso cref="Next(int)"/>
- /// <seealso cref="Previous()"/>
- /// <seealso cref="First()"/>
- /// <seealso cref="Last()"/>
- /// <seealso cref="Following(int)"/>
- /// <seealso cref="Preceding(int)"/>
- public abstract int Current { get; }
-
- /// <summary>
- /// Get the text being scanned
- /// </summary>
- /// <returns>the text being scanned</returns>
- //public abstract CharacterIterator GetText();
- public abstract string Text { get; }
-
- /// <summary>
- /// Set a new text string to be scanned. The current scan
- /// position is reset to First().
- /// </summary>
- /// <param name="newText">new text to scan.</param>
- public virtual void SetText(string newText)
- {
- SetText(new StringCharacterIterator(newText));
- }
-
- /// <summary>
- /// Set a new text string to be scanned. The current scan
- /// position is reset to First().
- /// </summary>
- /// <param name="newText">new text to scan.</param>
- public abstract void SetText(CharacterIterator newText);
- }
-}
-#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net/Support/CharacterIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Support/CharacterIterator.cs b/src/Lucene.Net/Support/CharacterIterator.cs
deleted file mode 100644
index 0c81629..0000000
--- a/src/Lucene.Net/Support/CharacterIterator.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-\ufeff#if FEATURE_BREAKITERATOR
-using System;
-
-namespace Lucene.Net.Support
-{
- /*
- * 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.
- */
-
- public abstract class CharacterIterator
- {
- public static readonly char DONE = '\uFFFF';
-
- public abstract char Current { get; }
-
- public abstract char First();
-
- public abstract char Last();
-
- public abstract char Next();
-
- public abstract char Previous();
-
- public abstract char SetIndex(int position);
-
- public abstract int BeginIndex { get; }
-
- public abstract int EndIndex { get; }
-
- public abstract int Index { get; }
-
- public abstract object Clone();
-
- public abstract string GetTextAsString();
- }
-}
-#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net/Support/StringCharacterIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Support/StringCharacterIterator.cs b/src/Lucene.Net/Support/StringCharacterIterator.cs
deleted file mode 100644
index a91e49a..0000000
--- a/src/Lucene.Net/Support/StringCharacterIterator.cs
+++ /dev/null
@@ -1,232 +0,0 @@
-\ufeff#if FEATURE_BREAKITERATOR
-/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved
- * (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved
- *
- * The original version of this source code and documentation
- * is copyrighted and owned by Taligent, Inc., a wholly-owned
- * subsidiary of IBM. These materials are provided under terms
- * of a License Agreement between Taligent and Sun. This technology
- * is protected by multiple US and International patents.
- *
- * This notice and attribution to Taligent may not be removed.
- * Taligent is a registered trademark of Taligent, Inc.
- *
- */
-
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Lucene.Net.Support
-{
- /// <summary>
- /// <see cref="StringCharacterIterator"/> implements the
- /// <see cref="CharacterIterator"/> protocol for a <see cref="string"/>.
- /// The <see cref="StringCharacterIterator"/> class iterates over the
- /// entire <see cref="string"/>.
- /// </summary>
- /// <seealso cref="CharacterIterator"/>
- public class StringCharacterIterator : CharacterIterator
- {
- private string text;
- private int begin;
- private int end;
- // invariant: begin <= pos <= end
- private int pos;
-
-
- public StringCharacterIterator(string text)
- : this(text, 0)
- {
- }
-
- public StringCharacterIterator(string text, int pos)
- : this(text, 0, text.Length, pos)
- {
- }
-
- public StringCharacterIterator(string text, int begin, int end, int pos)
- {
- if (text == null)
- throw new ArgumentNullException("text");
- this.text = text;
-
- if (begin < 0 || begin > end || end > text.Length)
- throw new ArgumentException("Invalid substring range");
-
- if (pos < begin || pos > end)
- throw new ArgumentException("Invalid position");
-
- this.begin = begin;
- this.end = end;
- this.pos = pos;
- }
-
- public void SetText(string text)
- {
- if (text == null)
- throw new ArgumentNullException("text");
- this.text = text;
- this.begin = 0;
- this.end = text.Length;
- this.pos = 0;
- }
-
- public override char First()
- {
- pos = begin;
- return Current;
- }
-
- public override char Last()
- {
- if (end != begin)
- {
- pos = end - 1;
- }
- else
- {
- pos = end;
- }
- return Current;
- }
-
- public override char SetIndex(int position)
- {
- if (position < begin || position > end)
- throw new ArgumentException("Invalid index");
- pos = position;
- return Current;
- }
-
- public override char Current
- {
- get
- {
- if (pos >= begin && pos < end)
- {
- return text[pos];
- }
- else
- {
- return DONE;
- }
- }
- }
-
- public override char Next()
- {
- if (pos < end - 1)
- {
- pos++;
- return text[pos];
- }
- else
- {
- pos = end;
- return DONE;
- }
- }
-
- public override char Previous()
- {
- if (pos > begin)
- {
- pos--;
- return text[pos];
- }
- else
- {
- return DONE;
- }
- }
-
-
- public override int BeginIndex
- {
- get
- {
- return begin;
- }
- }
-
- public override int EndIndex
- {
- get
- {
- return end;
- }
- }
-
- public override int Index
- {
- get
- {
- return pos;
- }
- }
-
- public override string GetTextAsString()
- {
- return text;
- }
-
- public override bool Equals(object obj)
- {
- if (this == obj)
- return true;
- if (!(obj is StringCharacterIterator))
- return false;
-
- StringCharacterIterator that = (StringCharacterIterator)obj;
-
- if (GetHashCode() != that.GetHashCode())
- return false;
- if (!text.Equals(that.text, StringComparison.Ordinal))
- return false;
- if (pos != that.pos || begin != that.begin || end != that.end)
- return false;
- return true;
- }
-
- public override int GetHashCode()
- {
- return base.GetHashCode() ^ pos ^ begin ^ end;
- }
-
- public override object Clone()
- {
- return MemberwiseClone();
- }
- }
-}
-#endif
[2/7] lucenenet git commit: SWEEP: Removed dependency on icu.net from
Lucene.Net.Analysis.Common and Lucene.Net.Highlighter and disabled
FEATURE_BREAKITERATOR
Posted by ni...@apache.org.
SWEEP: Removed dependency on icu.net from Lucene.Net.Analysis.Common and Lucene.Net.Highlighter and disabled FEATURE_BREAKITERATOR
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/63c599ed
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/63c599ed
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/63c599ed
Branch: refs/heads/api-work
Commit: 63c599ed13e1a029b0d4a66d9c6ea7aba8f723a2
Parents: ddc93f1
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Sun Apr 16 22:05:09 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Sun Apr 16 22:05:09 2017 +0700
----------------------------------------------------------------------
.../Lucene.Net.Analysis.Common.csproj | 2 +-
.../Lucene.Net.Analysis.Common.project.json | 3 ---
src/Lucene.Net.Analysis.Common/project.json | 5 +----
src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj | 2 +-
src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.project.json | 3 ---
src/Lucene.Net.Highlighter/project.json | 5 +----
.../Lucene.Net.Tests.Analysis.Common.csproj | 2 +-
.../Lucene.Net.Tests.Analysis.Common.project.json | 1 -
src/Lucene.Net.Tests.Analysis.Common/project.json | 6 +-----
.../Lucene.Net.Tests.Highlighter.csproj | 2 +-
.../Lucene.Net.Tests.Highlighter.project.json | 1 -
src/Lucene.Net.Tests.Highlighter/project.json | 6 +-----
src/Lucene.Net.Tests/Lucene.Net.Tests.csproj | 2 +-
src/Lucene.Net.Tests/project.json | 2 +-
src/Lucene.Net/Lucene.Net.csproj | 2 +-
src/Lucene.Net/project.json | 1 -
16 files changed, 11 insertions(+), 34 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/63c599ed/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj b/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj
index c5ead38..fb403aa 100644
--- a/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj
+++ b/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj
@@ -31,7 +31,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
- <DefineConstants>$(DefineConstants);FEATURE_BREAKITERATOR;FEATURE_CLONEABLE;FEATURE_DTD_PROCESSING;FEATURE_SERIALIZABLE</DefineConstants>
+ <DefineConstants>$(DefineConstants);FEATURE_CLONEABLE;FEATURE_DTD_PROCESSING;FEATURE_SERIALIZABLE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualBasic" />
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/63c599ed/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.project.json b/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.project.json
index 74d9d80..86d1c12 100644
--- a/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.project.json
+++ b/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.project.json
@@ -2,9 +2,6 @@
"runtimes": {
"win": {}
},
- "dependencies": {
- "icu.net": "54.1.1-alpha"
- },
"frameworks": {
"net451": {}
}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/63c599ed/src/Lucene.Net.Analysis.Common/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/project.json b/src/Lucene.Net.Analysis.Common/project.json
index 7b2777d..ca771a3 100644
--- a/src/Lucene.Net.Analysis.Common/project.json
+++ b/src/Lucene.Net.Analysis.Common/project.json
@@ -49,7 +49,7 @@
},
"buildOptions": {
"debugType": "portable",
- "define": [ "FEATURE_BREAKITERATOR", "FEATURE_CLONEABLE", "FEATURE_DTD_PROCESSING", "FEATURE_SERIALIZABLE" ],
+ "define": [ "FEATURE_CLONEABLE", "FEATURE_DTD_PROCESSING", "FEATURE_SERIALIZABLE" ],
"compile": {
"includeFiles": [
"../CommonAssemblyInfo.cs",
@@ -67,9 +67,6 @@
"Analysis/Compound/Hyphenation/hyphenation.dtd"
]
}
- },
- "dependencies": {
- "icu.net": "2.1.1-beta0003"
}
}
}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/63c599ed/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj b/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj
index c362f23..31ac251 100644
--- a/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj
+++ b/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj
@@ -31,7 +31,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
- <DefineConstants>$(DefineConstants);FEATURE_BREAKITERATOR;FEATURE_SERIALIZABLE</DefineConstants>
+ <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/63c599ed/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.project.json b/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.project.json
index af28fc8..e33edda 100644
--- a/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.project.json
+++ b/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.project.json
@@ -2,9 +2,6 @@
"runtimes": {
"win": {}
},
- "dependencies": {
- "icu.net": "54.1.1-alpha"
- },
"frameworks": {
"net451": {}
}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/63c599ed/src/Lucene.Net.Highlighter/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Highlighter/project.json b/src/Lucene.Net.Highlighter/project.json
index dfc0a1e..5016f93 100644
--- a/src/Lucene.Net.Highlighter/project.json
+++ b/src/Lucene.Net.Highlighter/project.json
@@ -37,16 +37,13 @@
"net451": {
"buildOptions": {
"debugType": "portable",
- "define": [ "FEATURE_BREAKITERATOR", "FEATURE_SERIALIZABLE" ],
+ "define": [ "FEATURE_SERIALIZABLE" ],
"compile": {
"includeFiles": [
"../CommonAssemblyInfo.cs",
"../IcuBreakIterator.cs"
]
}
- },
- "dependencies": {
- "icu.net": "2.1.1-beta0003"
}
}
}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/63c599ed/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj b/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj
index 9cf1542..4ca6bfc 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj
+++ b/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj
@@ -33,7 +33,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
- <DefineConstants>$(DefineConstants);FEATURE_BREAKITERATOR;FEATURE_SERIALIZABLE</DefineConstants>
+ <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/63c599ed/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.project.json b/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.project.json
index 36faa44..8c631ab 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.project.json
+++ b/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.project.json
@@ -3,7 +3,6 @@
"win": {}
},
"dependencies": {
- "icu.net": "54.1.1-alpha",
"NUnit": "3.5.0"
},
"frameworks": {
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/63c599ed/src/Lucene.Net.Tests.Analysis.Common/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/project.json b/src/Lucene.Net.Tests.Analysis.Common/project.json
index 569ba9b..55e945d 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/project.json
+++ b/src/Lucene.Net.Tests.Analysis.Common/project.json
@@ -117,7 +117,7 @@
"net451": {
"buildOptions": {
"debugType": "portable",
- "define": [ "FEATURE_BREAKITERATOR", "FEATURE_SERIALIZABLE" ],
+ "define": [ "FEATURE_SERIALIZABLE" ],
"compile": {
"includeFiles": [
"../CommonAssemblyInfo.cs"
@@ -207,10 +207,6 @@
"Analysis/Compound/da_compoundDictionary.txt"
]
}
- },
- "dependencies": {
- "icu.net": "2.1.1-beta0003",
- "Icu4c.Win.Full.Lib": "56.1.21"
}
}
},
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/63c599ed/src/Lucene.Net.Tests.Highlighter/Lucene.Net.Tests.Highlighter.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Highlighter/Lucene.Net.Tests.Highlighter.csproj b/src/Lucene.Net.Tests.Highlighter/Lucene.Net.Tests.Highlighter.csproj
index ea8768b..3ed7239 100644
--- a/src/Lucene.Net.Tests.Highlighter/Lucene.Net.Tests.Highlighter.csproj
+++ b/src/Lucene.Net.Tests.Highlighter/Lucene.Net.Tests.Highlighter.csproj
@@ -31,7 +31,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
- <DefineConstants>$(DefineConstants);FEATURE_BREAKITERATOR;FEATURE_SERIALIZABLE</DefineConstants>
+ <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/63c599ed/src/Lucene.Net.Tests.Highlighter/Lucene.Net.Tests.Highlighter.project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Highlighter/Lucene.Net.Tests.Highlighter.project.json b/src/Lucene.Net.Tests.Highlighter/Lucene.Net.Tests.Highlighter.project.json
index eb0a370..e3dbf4c 100644
--- a/src/Lucene.Net.Tests.Highlighter/Lucene.Net.Tests.Highlighter.project.json
+++ b/src/Lucene.Net.Tests.Highlighter/Lucene.Net.Tests.Highlighter.project.json
@@ -3,7 +3,6 @@
"win": {}
},
"dependencies": {
- "icu.net": "54.1.1-alpha",
"NUnit": "3.5.0"
},
"frameworks": {
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/63c599ed/src/Lucene.Net.Tests.Highlighter/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Highlighter/project.json b/src/Lucene.Net.Tests.Highlighter/project.json
index 198dbc1..6caafe2 100644
--- a/src/Lucene.Net.Tests.Highlighter/project.json
+++ b/src/Lucene.Net.Tests.Highlighter/project.json
@@ -39,7 +39,7 @@
"net451": {
"buildOptions": {
"debugType": "portable",
- "define": [ "FEATURE_BREAKITERATOR", "FEATURE_SERIALIZABLE" ],
+ "define": [ "FEATURE_SERIALIZABLE" ],
"compile": {
"includeFiles": [
"../CommonAssemblyInfo.cs"
@@ -50,10 +50,6 @@
"PostingsHighlight/CambridgeMA.utf8"
]
}
- },
- "dependencies": {
- "icu.net": "2.1.1-beta0003",
- "Icu4c.Win.Full.Lib": "56.1.21"
}
}
},
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/63c599ed/src/Lucene.Net.Tests/Lucene.Net.Tests.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Lucene.Net.Tests.csproj b/src/Lucene.Net.Tests/Lucene.Net.Tests.csproj
index a7d79bc..1ce7638 100644
--- a/src/Lucene.Net.Tests/Lucene.Net.Tests.csproj
+++ b/src/Lucene.Net.Tests/Lucene.Net.Tests.csproj
@@ -34,7 +34,7 @@
</PropertyGroup>
<PropertyGroup>
<RootNamespace>Lucene.Net.Tests</RootNamespace>
- <DefineConstants>$(DefineConstants);FEATURE_BREAKITERATOR;FEATURE_CONCURRENTMERGESCHEDULER;FEATURE_SERIALIZABLE</DefineConstants>
+ <DefineConstants>$(DefineConstants);FEATURE_CONCURRENTMERGESCHEDULER;FEATURE_SERIALIZABLE</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/63c599ed/src/Lucene.Net.Tests/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/project.json b/src/Lucene.Net.Tests/project.json
index 36f288f..b838d2b 100644
--- a/src/Lucene.Net.Tests/project.json
+++ b/src/Lucene.Net.Tests/project.json
@@ -84,7 +84,7 @@
"net451": {
"buildOptions": {
"debugType": "portable",
- "define": [ "FEATURE_BREAKITERATOR", "FEATURE_CONCURRENTMERGESCHEDULER", "FEATURE_SERIALIZABLE" ],
+ "define": [ "FEATURE_CONCURRENTMERGESCHEDULER", "FEATURE_SERIALIZABLE" ],
"compile": {
"includeFiles": [
"../CommonAssemblyInfo.cs"
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/63c599ed/src/Lucene.Net/Lucene.Net.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Lucene.Net.csproj b/src/Lucene.Net/Lucene.Net.csproj
index d2afed0..1e3f970 100644
--- a/src/Lucene.Net/Lucene.Net.csproj
+++ b/src/Lucene.Net/Lucene.Net.csproj
@@ -33,7 +33,7 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
- <DefineConstants>$(DefineConstants);FEATURE_BREAKITERATOR;FEATURE_CLONEABLE;FEATURE_CONCURRENTMERGESCHEDULER;FEATURE_SERIALIZABLE;FEATURE_THREADPOOL_UNSAFEQUEUEWORKITEM</DefineConstants>
+ <DefineConstants>$(DefineConstants);FEATURE_CLONEABLE;FEATURE_CONCURRENTMERGESCHEDULER;FEATURE_SERIALIZABLE;FEATURE_THREADPOOL_UNSAFEQUEUEWORKITEM</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/63c599ed/src/Lucene.Net/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/project.json b/src/Lucene.Net/project.json
index 47d2d6e..8be0747 100644
--- a/src/Lucene.Net/project.json
+++ b/src/Lucene.Net/project.json
@@ -50,7 +50,6 @@
"buildOptions": {
"debugType": "portable",
"define": [
- "FEATURE_BREAKITERATOR",
"FEATURE_CLONEABLE",
"FEATURE_CONCURRENTMERGESCHEDULER",
"FEATURE_SERIALIZABLE",
[4/7] lucenenet git commit: SWEEP: Moved BreakIterator-dependent
functionality to a common Lucene.Net.Icu library so we can manage the icu.net
dependency from one place and not make the majority of the users deal with it
when they don't need to
Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b1fdcca3/src/Lucene.Net.Tests.Icu/Search/PostingsHighlight/CambridgeMA.utf8
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Icu/Search/PostingsHighlight/CambridgeMA.utf8 b/src/Lucene.Net.Tests.Icu/Search/PostingsHighlight/CambridgeMA.utf8
new file mode 100644
index 0000000..d60b6fa
--- /dev/null
+++ b/src/Lucene.Net.Tests.Icu/Search/PostingsHighlight/CambridgeMA.utf8
@@ -0,0 +1 @@
+{{Distinguish|Cambridge, England}} {{primary sources|date=June 2012}} {{Use mdy dates|date=January 2011}} {{Infobox settlement |official_name = Cambridge, Massachusetts |nickname = |motto = "Boston's Left Bank"<ref>{{cite web|url= http://www.epodunk.com/cgi-bin/genInfo.php?locIndex=2894|title=Profile for Cambridge, Massachusetts, MA|publisher= ePodunk |accessdate= November 1, 2012}}</ref> |image_skyline = CambridgeMACityHall2.jpg |imagesize = 175px |image_caption = Cambridge City Hall |image_seal = |image_flag = |image_map = Cambridge ma highlight.png |mapsize = 250px |map_caption = Location in Middlesex County in Massachusetts |image_map1 = |mapsize1 = |map_caption1 = |coordinates_region = US-MA |subdivision_type = Country |subdivision_name = United States |subdivision_type1 = State |subdivision_name1 = [[Massachusetts]] |subdivision_type2 = [[List of counties in Massachusetts|County]] |subdivision_name2 = [[Middlesex County, Massachusetts|Middlesex]] |established_title = Settled |
established_date = 1630 |established_title2 = Incorporated |established_date2 = 1636 |established_title3 = |established_date3 = |government_type = [[Council-manager government|Council-City Manager]] |leader_title = Mayor |leader_name = Henrietta Davis |leader_title1 = [[City manager|City Manager]] |leader_name1 = [[Robert W. Healy]] |area_magnitude = |area_total_km2 = 18.47 |area_total_sq_mi = 7.13 |area_land_km2 = 16.65 |area_land_sq_mi = 6.43 |area_water_km2 = 1.81 |area_water_sq_mi = 0.70 |population_as_of = 2010 |population_blank2_title = [[Demonym]] |population_blank2 = [[Cantabrigian]] |settlement_type = City |population_total = 105,162 |population_density_km2 = 6,341.98 |population_density_sq_mi = 16,422.08 |elevation_m = 12 |elevation_ft = 40 |timezone = [[Eastern Time Zone|Eastern]] |utc_offset = -5 |timezone_DST = [[Eastern Time Zone|Eastern]] |utc_offset_DST = -4 |coordinates_display = display=inline,title |latd = 42 |latm = 22 |lats = 25 |latNS = N |longd = 71 |longm = 0
6 |longs = 38 |longEW = W |website = [http://www.cambridgema.gov/ www.cambridgema.gov] |postal_code_type = ZIP code |postal_code = 02138, 02139, 02140, 02141, 02142 |area_code = [[Area code 617|617]] / [[Area code 857|857]] |blank_name = [[Federal Information Processing Standard|FIPS code]] |blank_info = 25-11000 |blank1_name = [[Geographic Names Information System|GNIS]] feature ID |blank1_info = 0617365 |footnotes = }} '''Cambridge''' is a city in [[Middlesex County, Massachusetts|Middlesex County]], [[Massachusetts]], [[United States]], in the [[Greater Boston]] area. It was named in honor of the [[University of Cambridge]] in [[England]], an important center of the [[Puritan]] theology embraced by the town's founders.<ref>{{cite book|last=Degler|first=Carl Neumann|title=Out of Our Pasts: The Forces That Shaped Modern America|publisher=HarperCollins|location=New York|year=1984|url=http://books.google.com/books?id=NebLe1ueuGQC&pg=PA18&lpg=PA18&dq=cambridge+university+puritans+newt
owne#v=onepage&q=&f=false|accessdate=September 9, 2009 | isbn=978-0-06-131985-3}}</ref> Cambridge is home to two of the world's most prominent universities, [[Harvard University]] and the [[Massachusetts Institute of Technology]]. According to the [[2010 United States Census]], the city's population was 105,162.<ref name="2010.census.gov">{{cite web|url=http://2010.census.gov/news/releases/operations/cb11-cn104.html |title=Census 2010 News | U.S. Census Bureau Delivers Massachusetts' 2010 Census Population Totals, Including First Look at Race and Hispanic Origin Data for Legislative Redistricting |publisher=2010.census.gov |date=2011-03-22 |accessdate=2012-04-28}}</ref> It is the fifth most populous city in the state, behind [[Boston]], [[Worcester, MA|Worcester]], [[Springfield, MA|Springfield]], and [[Lowell, Massachusetts|Lowell]].<ref name="2010.census.gov"/> Cambridge was one of the two [[county seat]]s of Middlesex County prior to the abolition of county government in 199
7; [[Lowell, Massachusetts|Lowell]] was the other. ==History== {{See also|Timeline of Cambridge, Massachusetts history}} [[File:Formation of Massachusetts towns.svg|thumb|A map showing the original boundaries of Cambridge]] The site for what would become Cambridge was chosen in December 1630, because it was located safely upriver from Boston Harbor, which made it easily defensible from attacks by enemy ships. Also, the water from the local spring was so good that the local Native Americans believed it had medicinal properties.{{Citation needed|date=November 2009}} [[Thomas Dudley]], his daughter [[Anne Bradstreet]] and her husband Simon were among the first settlers of the town. The first houses were built in the spring of 1631. The settlement was initially referred to as "the newe towne".<ref name=drake>{{cite book|last=Drake|first=Samuel Adams|title=History of Middlesex County, Massachusetts|publisher=Estes and Lauriat|location=Boston|year=1880|volume=1|pages=305\u201316|url=http://b
ooks.google.com/books?id=QGolOAyd9RMC&pg=PA316&lpg=PA305&dq=newetowne&ct=result#PPA305,M1|accessdate=December 26, 2008}}</ref> Official Massachusetts records show the name capitalized as '''Newe Towne''' by 1632.<ref name=public>{{cite book|title=Report on the Custody and Condition of the Public Records of Parishes|publisher=Massachusetts Secretary of the Commonwealth|url=http://books.google.com/books?id=IyYWAAAAYAAJ&pg=RA1-PA298&lpg=RA1-PA298&dq=%22Ordered+That+Newtowne+shall+henceforward+be+called%22|location=Boston|year=1889|page=298|accessdate=December 24, 2008}}</ref> Located at the first convenient [[Charles River]] crossing west of [[Boston]], Newe Towne was one of a number of towns (including Boston, [[Dorchester, Massachusetts|Dorchester]], [[Watertown, Massachusetts|Watertown]], and [[Weymouth, Massachusetts|Weymouth]]) founded by the 700 original [[Puritan]] colonists of the [[Massachusetts Bay Colony]] under governor [[John Winthrop]]. The original village site is in the
heart of today's [[Harvard Square]]. The marketplace where farmers brought in crops from surrounding towns to sell survives today as the small park at the corner of John F. Kennedy (J.F.K.) and Winthrop Streets, then at the edge of a salt marsh, since filled. The town included a much larger area than the present city, with various outlying parts becoming independent towns over the years: [[Newton, Massachusetts|Newton (originally Cambridge Village, then Newtown)]] in 1688,<ref>{{cite book |last= Ritter |first= Priscilla R. |coauthors= Thelma Fleishman |title= Newton, Massachusetts 1679\u20131779: A Biographical Directory |year= 1982 |publisher= New England Historic Genealogical Society }}</ref> [[Lexington, Massachusetts|Lexington (Cambridge Farms)]] in 1712, and both [[Arlington, Massachusetts|West Cambridge (originally Menotomy)]] and [[Brighton, Massachusetts|Brighton (Little Cambridge)]] in 1807.<ref>{{cite web |url=http://www.brightonbot.com/history.php |title=A Short History of
Allston-Brighton |first=Marchione |last=William P. |author= |authorlink= |coauthors= |date= |month= |year=2011 |work=Brighton-Allston Historical Society |publisher=Brighton Board of Trade |location= |page= |pages= |at= |language= |trans_title= |arxiv= |asin= |bibcode= |doi= |doibroken= |isbn= |issn= |jfm= |jstor= |lccn= |mr= |oclc= |ol= |osti= |pmc = |pmid= |rfc= |ssrn= |zbl= |id= |archiveurl= |archivedate= |deadurl= |accessdate=December 21, 2011 |quote= |ref= |separator= |postscript=}}</ref> Part of West Cambridge joined the new town of [[Belmont, Massachusetts|Belmont]] in 1859, and the rest of West Cambridge was renamed Arlington in 1867; Brighton was annexed by Boston in 1874. In the late 19th century, various schemes for annexing Cambridge itself to the City of Boston were pursued and rejected.<ref>{{cite news |title=ANNEXATION AND ITS FRUITS |author=Staff writer |first= |last= |authorlink= |url=http://query.nytimes.com/gst/abstract.html?res=9901E4DC173BEF34BC4D52DFB766838F669F
DE |agency= |newspaper=[[The New York Times]] |publisher= |isbn= |issn= |pmid= |pmd= |bibcode= |doi= |date=January 15, 1874, Wednesday |page= 4 |pages= |accessdate=|archiveurl=http://query.nytimes.com/mem/archive-free/pdf?res=9901E4DC173BEF34BC4D52DFB766838F669FDE |archivedate=January 15, 1874 |ref= }}</ref><ref>{{cite news |title=BOSTON'S ANNEXATION SCHEMES.; PROPOSAL TO ABSORB CAMBRIDGE AND OTHER NEAR-BY TOWNS |author=Staff writer |first= |last= |authorlink= |url=http://query.nytimes.com/gst/abstract.html?res=9C05E1DC1F39E233A25754C2A9659C94639ED7CF |agency= |newspaper=[[The New York Times]] |publisher= |isbn= |issn= |pmid= |pmd= |bibcode= |doi= |date=March 26, 1892, Wednesday |page= 11 |pages= |accessdate=August 21, 2010|archiveurl=http://query.nytimes.com/mem/archive-free/pdf?res=9C05E1DC1F39E233A25754C2A9659C94639ED7CF |archivedate=March 27, 1892 |ref= }}</ref> In 1636, [[Harvard College]] was founded by the colony to train [[minister (religion)|ministers]] and the new town was
chosen for its site by [[Thomas Dudley]]. By 1638, the name "Newe Towne" had "compacted by usage into 'Newtowne'."<ref name=drake /> In May 1638<ref>{{cite book|title=The Cambridge of Eighteen Hundred and Ninety-six|editor=Arthur Gilman, ed.|publisher=Committee on the Memorial Volume|location=Cambridge|year=1896|page=8}}</ref><ref>{{cite web|author=Harvard News Office |url=http://news.harvard.edu/gazette/2002/05.02/02-history.html |title=''Harvard Gazette'' historical calendar giving May 12, 1638 as date of name change; certain other sources say May 2, 1638 or late 1637 |publisher=News.harvard.edu |date=2002-05-02 |accessdate=2012-04-28}}</ref> the name was changed to '''Cambridge''' in honor of the [[University of Cambridge|university]] in [[Cambridge, England]].<ref>{{cite book |last= Hannah Winthrop Chapter, D.A.R. |title= Historic Guide to Cambridge |edition= Second |year= 1907 |publisher= Hannah Winthrop Chapter, D.A.R. |location= Cambridge, Mass. |pages= 20\u201321 |quot
e= On October 15, 1637, the Great and General Court passed a vote that: "The college is ordered to bee at Newetowne." In this same year the name of Newetowne was changed to Cambridge, ("It is ordered that Newetowne shall henceforward be called Cambridge") in honor of the university in Cambridge, England, where many of the early settlers were educated. }}</ref> The first president ([[Henry Dunster]]), the first benefactor ([[John Harvard (clergyman)|John Harvard]]), and the first schoolmaster ([[Nathaniel Eaton]]) of Harvard were all Cambridge University alumni, as was the then ruling (and first) governor of the [[Massachusetts Bay Colony]], John Winthrop. In 1629, Winthrop had led the signing of the founding document of the city of Boston, which was known as the [[Cambridge Agreement]], after the university.<ref>{{cite web|url=http://www.winthropsociety.org/doc_cambr.php|publisher=The Winthrop Society|title=Descendants of the Great Migration|accessdate=September 8, 2008}}</ref>
It was Governor Thomas Dudley who, in 1650, signed the charter creating the corporation which still governs Harvard College.<ref>{{cite web|url=http://hul.harvard.edu/huarc/charter.html |title=Harvard Charter of 1650, Harvard University Archives, Harvard University, harvard.edu |publisher=Hul.harvard.edu |date= |accessdate=2012-04-28}}</ref><ref>{{cite book |last1= |first1= |authorlink1= |editor1-first= |editor1-last= |editor1-link= |others= |title=Constitution of the Commonwealth of Massachusetts|url=http://www.mass.gov/legis/const.htm |accessdate=December 13, 2009 |edition= |series= |volume= |date=September 1, 1779 |publisher=The General Court of Massachusetts |location= |isbn= |oclc= |doi= |page= |pages=|chapter=Chapter V: The University at Cambridge, and encouragement of literature, etc. |chapterurl= |ref= |bibcode= }}</ref> [[Image:Washington taking command of the American Army at Cambridge, 1775 - NARA - 532874.tif|thumb|right|George Washington in Cambridge, 1775]] Cambridge
grew slowly as an agricultural village eight miles (13 km) by road from Boston, the capital of the colony. By the [[American Revolution]], most residents lived near the [[Cambridge Common|Common]] and Harvard College, with farms and estates comprising most of the town. Most of the inhabitants were descendants of the original Puritan colonists, but there was also a small elite of [[Anglicans|Anglican]] "worthies" who were not involved in village life, who made their livings from estates, investments, and trade, and lived in mansions along "the Road to Watertown" (today's [[Brattle Street (Cambridge, Massachusetts)|Brattle Street]], still known as [[Tory Row]]). In 1775, [[George Washington]] came up from [[Virginia]] to take command of fledgling volunteer American soldiers camped on the [[Cambridge Common]]\u2014today called the birthplace of the [[U.S. Army]]. (The name of today's nearby Sheraton Commander Hotel refers to that event.) Most of the Tory estates were confiscated afte
r the Revolution. On January 24, 1776, [[Henry Knox]] arrived with artillery captured from [[Fort Ticonderoga]], which enabled Washington to drive the British army out of Boston. [[File:Cambridge 1873 WardMap.jpg|thumb|300px|left|A map of Cambridge from 1873]] Between 1790 and 1840, Cambridge began to grow rapidly, with the construction of the [[West Boston Bridge]] in 1792, that connected Cambridge directly to Boston, making it no longer necessary to travel eight miles (13 km) through the [[Boston Neck]], [[Roxbury, Massachusetts|Roxbury]], and [[Brookline, Massachusetts|Brookline]] to cross the [[Charles River]]. A second bridge, the Canal Bridge, opened in 1809 alongside the new [[Middlesex Canal]]. The new bridges and roads made what were formerly estates and [[marsh]]land into prime industrial and residential districts. In the mid-19th century, Cambridge was the center of a literary revolution when it gave the country a new identity through poetry and literature. Cambridge
was home to the famous Fireside Poets\u2014so called because their poems would often be read aloud by families in front of their evening fires. In their day, the [[Fireside Poets]]\u2014[[Henry Wadsworth Longfellow]], [[James Russell Lowell]], and [[Oliver Wendell Holmes, Sr.|Oliver Wendell Holmes]]\u2014were as popular and influential as rock stars are today.{{Citation needed|date=November 2009}} Soon after, [[Toll road|turnpikes]] were built: the [[Cambridge and Concord Turnpike]] (today's Broadway and Concord Ave.), the [[Middlesex Turnpike (Massachusetts)|Middlesex Turnpike]] (Hampshire St. and [[Massachusetts Avenue (Boston)|Massachusetts Ave.]] northwest of [[Porter Square]]), and what are today's Cambridge, Main, and Harvard Streets were roads to connect various areas of Cambridge to the bridges. In addition, railroads crisscrossed the town during the same era, leading to the development of Porter Square as well as the creation of neighboring town [[Somerville, Massachusetts|Somervil
le]] from the formerly rural parts of [[Charlestown, Massachusetts|Charlestown]]. [[File:Middlesex Canal (Massachusetts) map, 1852.jpg|thumb|1852 Map of Boston area showing Cambridge and rail lines.]] Cambridge was incorporated as a city in 1846. This was despite noticeable tensions between East Cambridge, Cambridgeport, and Old Cambridge that stemmed from differences in in each area's culture, sources of income, and the national origins of the residents.<ref>Cambridge Considered: A Very Brief History of Cambridge, 1800-1900, Part I. http://cambridgeconsidered.blogspot.com/2011/01/very-brief-history-of-cambridge-1800.html</ref> The city's commercial center began to shift from Harvard Square to Central Square, which became the downtown of the city around this time. Between 1850 and 1900, Cambridge took on much of its present character\u2014[[streetcar suburb]]an development along the turnpikes, with working-class and industrial neighborhoods focused on East Cambridge, comfortable middle
-class housing being built on old estates in Cambridgeport and Mid-Cambridge, and upper-class enclaves near Harvard University and on the minor hills of the city. The coming of the railroad to North Cambridge and Northwest Cambridge then led to three major changes in the city: the development of massive brickyards and brickworks between Massachusetts Ave., Concord Ave. and [[Alewife Brook]]; the ice-cutting industry launched by [[Frederic Tudor]] on [[Fresh Pond, Cambridge, Massachusetts|Fresh Pond]]; and the carving up of the last estates into residential subdivisions to provide housing to the thousands of immigrants that arrived to work in the new industries. For many years, the city's largest employer was the [[New England Glass Company]], founded in 1818. By the middle of the 19th century it was the largest and most modern glassworks in the world. In 1888, all production was moved, by [[Edward Libbey|Edward Drummond Libbey]], to [[Toledo, Ohio]], where it continues today under t
he name Owens Illinois. Flint glassware with heavy lead content, produced by that company, is prized by antique glass collectors. There is none on public display in Cambridge, but there is a large collection in the [[Toledo Museum of Art]]. Among the largest businesses located in Cambridge was the firm of [[Carter's Ink Company]], whose neon sign long adorned the [[Charles River]] and which was for many years the largest manufacturer of ink in the world. By 1920, Cambridge was one of the main industrial cities of [[New England]], with nearly 120,000 residents. As industry in New England began to decline during the [[Great Depression]] and after World War II, Cambridge lost much of its industrial base. It also began the transition to being an intellectual, rather than an industrial, center. Harvard University had always been important in the city (both as a landowner and as an institution), but it began to play a more dominant role in the city's life and culture. Also, the move of th
e [[Massachusetts Institute of Technology]] from Boston in 1916 ensured Cambridge's status as an intellectual center of the United States. After the 1950s, the city's population began to decline slowly, as families tended to be replaced by single people and young couples. The 1980s brought a wave of high-technology startups, creating software such as [[Visicalc]] and [[Lotus 1-2-3]], and advanced computers, but many of these companies fell into decline with the fall of the minicomputer and [[DOS]]-based systems. However, the city continues to be home to many startups as well as a thriving biotech industry. By the end of the 20th century, Cambridge had one of the most expensive housing markets in the Northeastern United States. While maintaining much diversity in class, race, and age, it became harder and harder for those who grew up in the city to be able to afford to stay. The end of [[rent control]] in 1994 prompted many Cambridge renters to move to housing that was more affordabl
e, in Somerville and other communities. In 2005, a reassessment of residential property values resulted in a disproportionate number of houses owned by non-affluent people jumping in value relative to other houses, with hundreds having their property tax increased by over 100%; this forced many homeowners in Cambridge to move elsewhere.<ref>Cambridge Chronicle, October 6, 13, 20, 27, 2005</ref> As of 2012, Cambridge's mix of amenities and proximity to Boston has kept housing prices relatively stable. ==Geography== [[File:Charles River Cambridge USA.jpg|thumb|upright|A view from Boston of Harvard's [[Weld Boathouse]] and Cambridge in winter. The [[Charles River]] is in the foreground.]] According to the [[United States Census Bureau]], Cambridge has a total area of {{convert|7.1|sqmi|km2}}, of which {{convert|6.4|sqmi|km2}} of it is land and {{convert|0.7|sqmi|km2}} of it (9.82%) is water. ===Adjacent municipalities=== Cambridge is located in eastern Massachusetts, bordered by: *the
city of [[Boston]] to the south (across the [[Charles River]]) and east *the city of [[Somerville, Massachusetts|Somerville]] to the north *the town of [[Arlington, Massachusetts|Arlington]] to the northwest *the town of [[Belmont, Massachusetts|Belmont]] and *the city of [[Watertown, Massachusetts|Watertown]] to the west The border between Cambridge and the neighboring city of [[Somerville, Massachusetts|Somerville]] passes through densely populated neighborhoods which are connected by the [[Red Line (MBTA)|MBTA Red Line]]. Some of the main squares, [[Inman Square|Inman]], [[Porter Square|Porter]], and to a lesser extent, [[Harvard Square|Harvard]], are very close to the city line, as are Somerville's [[Union Square (Somerville)|Union]] and [[Davis Square]]s. ===Neighborhoods=== ====Squares==== [[File:Centralsquarecambridgemass.jpg|thumb|[[Central Square (Cambridge)|Central Square]]]] [[File:Harvard square 2009j.JPG|thumb|[[Harvard Square]]]] [[File:Cambridge MA Inman Square.jpg|th
umb|[[Inman Square]]]] Cambridge has been called the "City of Squares" by some,<ref>{{cite web|author=No Writer Attributed |url=http://www.thecrimson.com/article/1969/9/18/cambridge-a-city-of-squares-pcambridge/ |title="Cambridge: A City of Squares" Harvard Crimson, Sept. 18, 1969 |publisher=Thecrimson.com |date=1969-09-18 |accessdate=2012-04-28}}</ref><ref>{{cite web|url=http://www.travelwritersmagazine.com/RonBernthal/Cambridge.html |title=Cambridge Journal: Massachusetts City No Longer in Boston's Shadow |publisher=Travelwritersmagazine.com |date= |accessdate=2012-04-28}}</ref> as most of its commercial districts are major street intersections known as [[Town square|squares]]. Each of the squares acts as a neighborhood center. These include: * [[Kendall Square]], formed by the junction of Broadway, Main Street, and Third Street, is also known as '''Technology Square''', a name shared with an office and laboratory building cluster in the neighborhood. Just over the [[Longfellow Br
idge]] from Boston, at the eastern end of the [[Massachusetts Institute of Technology|MIT]] campus, it is served by the [[Kendall (MBTA station)|Kendall/MIT]] station on the [[Massachusetts Bay Transportation Authority|MBTA]] [[Red Line (MBTA)|Red Line]] subway. Most of Cambridge's large office towers are located here, giving the area somewhat of an office park feel. A flourishing [[biotech]] industry has grown up around this area. The "One Kendall Square" complex is nearby, but\u2014confusingly\u2014not actually in Kendall Square. Also, the "Cambridge Center" office complex is located here, and not at the actual center of Cambridge. * [[Central Square (Cambridge)|Central Square]], formed by the junction of Massachusetts Avenue, Prospect Street, and Western Avenue, is well known for its wide variety of ethnic restaurants. As recently as the late 1990s it was rather run-down; it underwent a controversial [[gentrification]] in recent years (in conjunction with the development of the nearby
[[University Park at MIT]]), and continues to grow more expensive. It is served by the [[Central (MBTA station)|Central Station]] stop on the MBTA Red Line subway. '''Lafayette Square''', formed by the junction of Massachusetts Avenue, Columbia Street, Sidney Street, and Main Street, is considered part of the Central Square area. [[Cambridgeport]] is south of Central Square along Magazine Street and Brookline Street. * [[Harvard Square]], formed by the junction of Massachusetts Avenue, Brattle Street, and JFK Street. This is the primary site of [[Harvard University]], and is a major Cambridge shopping area. It is served by a [[Harvard (MBTA station)|Red Line station]]. Harvard Square was originally the northwestern terminus of the Red Line and a major transfer point to streetcars that also operated in a short [[Harvard Bus Tunnel|tunnel]]\u2014which is still a major bus terminal, although the area under the Square was reconfigured dramatically in the 1980s when the Red Line was extende
d. The Harvard Square area includes '''Brattle Square''' and '''Eliot Square'''. A short distance away from the square lies the [[Cambridge Common]], while the neighborhood north of Harvard and east of Massachusetts Avenue is known as Agassiz in honor of the famed scientist [[Louis Agassiz]]. * [[Porter Square]], about a mile north on Massachusetts Avenue from Harvard Square, is formed by the junction of Massachusetts and Somerville Avenues, and includes part of the city of [[Somerville, Massachusetts|Somerville]]. It is served by the [[Porter (MBTA station)|Porter Square Station]], a complex housing a [[Red Line (MBTA)|Red Line]] stop and a [[Fitchburg Line]] [[MBTA commuter rail|commuter rail]] stop. [[Lesley University]]'s University Hall and Porter campus are located at Porter Square. * [[Inman Square]], at the junction of Cambridge and Hampshire streets in Mid-Cambridge. Inman Square is home to many diverse restaurants, bars, music venues and boutiques. The funky street scene s
till holds some urban flair, but was dressed up recently with Victorian streetlights, benches and bus stops. A new community park was installed and is a favorite place to enjoy some takeout food from the nearby restaurants and ice cream parlor. * [[Lechmere Square]], at the junction of Cambridge and First streets, adjacent to the CambridgeSide Galleria shopping mall. Perhaps best known as the northern terminus of the [[Massachusetts Bay Transportation Authority|MBTA]] [[Green Line (MBTA)|Green Line]] subway, at [[Lechmere (MBTA station)|Lechmere Station]]. ====Other neighborhoods==== The residential neighborhoods ([http://www.cambridgema.gov/CPD/publications/neighborhoods.cfm map]) in Cambridge border, but are not defined by the squares. These include: * [[East Cambridge, Massachusetts|East Cambridge]] (Area 1) is bordered on the north by the [[Somerville, Massachusetts|Somerville]] border, on the east by the Charles River, on the south by Broadway and Main Street, and on the west b
y the [[Grand Junction Railroad]] tracks. It includes the [[NorthPoint (Cambridge, Massachusetts)|NorthPoint]] development. * [[Massachusetts Institute of Technology|MIT]] Campus ([[MIT Campus (Area 2), Cambridge|Area 2]]) is bordered on the north by Broadway, on the south and east by the Charles River, and on the west by the Grand Junction Railroad tracks. * [[Wellington-Harrington]] (Area 3) is bordered on the north by the [[Somerville, Massachusetts|Somerville]] border, on the south and west by Hampshire Street, and on the east by the Grand Junction Railroad tracks. Referred to as "Mid-Block".{{clarify|What is? By whom? A full sentence would help.|date=September 2011}} * [[Area 4, Cambridge|Area 4]] is bordered on the north by Hampshire Street, on the south by Massachusetts Avenue, on the west by Prospect Street, and on the east by the Grand Junction Railroad tracks. Residents of Area 4 often refer to their neighborhood simply as "The Port", and refer to the area of Cambridgeport
and Riverside as "The Coast". * [[Cambridgeport]] (Area 5) is bordered on the north by Massachusetts Avenue, on the south by the Charles River, on the west by River Street, and on the east by the Grand Junction Railroad tracks. * [[Mid-Cambridge]] (Area 6) is bordered on the north by Kirkland and Hampshire Streets and the [[Somerville, Massachusetts|Somerville]] border, on the south by Massachusetts Avenue, on the west by Peabody Street, and on the east by Prospect Street. * [[Riverside, Cambridge|Riverside]] (Area 7), an area sometimes referred to as "The Coast," is bordered on the north by Massachusetts Avenue, on the south by the Charles River, on the west by JFK Street, and on the east by River Street. * [[Agassiz, Cambridge, Massachusetts|Agassiz (Harvard North)]] (Area 8) is bordered on the north by the [[Somerville, Massachusetts|Somerville]] border, on the south and east by Kirkland Street, and on the west by Massachusetts Avenue. * [[Peabody, Cambridge, Massachusetts|Peabo
dy]] (Area 9) is bordered on the north by railroad tracks, on the south by Concord Avenue, on the west by railroad tracks, and on the east by Massachusetts Avenue. The Avon Hill sub-neighborhood consists of the higher elevations bounded by Upland Road, Raymond Street, Linnaean Street and Massachusetts Avenue. * Brattle area/[[West Cambridge (neighborhood)|West Cambridge]] (Area 10) is bordered on the north by Concord Avenue and Garden Street, on the south by the Charles River and the [[Watertown, Massachusetts|Watertown]] border, on the west by Fresh Pond and the Collins Branch Library, and on the east by JFK Street. It includes the sub-neighborhoods of Brattle Street (formerly known as [[Tory Row]]) and Huron Village. * [[North Cambridge, Massachusetts|North Cambridge]] (Area 11) is bordered on the north by the [[Arlington, Massachusetts|Arlington]] and [[Somerville, Massachusetts|Somerville]] borders, on the south by railroad tracks, on the west by the [[Belmont, Massachusetts|Bel
mont]] border, and on the east by the [[Somerville, Massachusetts|Somerville]] border. * [[Cambridge Highlands]] (Area 12) is bordered on the north and east by railroad tracks, on the south by Fresh Pond, and on the west by the [[Belmont, Massachusetts|Belmont]] border. * [[Strawberry Hill, Cambridge|Strawberry Hill]] (Area 13) is bordered on the north by Fresh Pond, on the south by the [[Watertown, Massachusetts|Watertown]] border, on the west by the [[Belmont, Massachusetts|Belmont]] border, and on the east by railroad tracks. ===Parks and outdoors=== [[File:Alewife Brook Reservation.jpg|thumb|Alewife Brook Reservation]] Consisting largely of densely built residential space, Cambridge lacks significant tracts of public parkland. This is partly compensated for, however, by the presence of easily accessible open space on the university campuses, including [[Harvard Yard]] and MIT's Great Lawn, as well as the considerable open space of [[Mount Auburn Cemetery]]. At the western edge o
f Cambridge, the cemetery is well known as the first garden cemetery, for its distinguished inhabitants, for its superb landscaping (the oldest planned landscape in the country), and as a first-rate [[arboretum]]. Although known as a Cambridge landmark, much of the cemetery lies within the bounds of Watertown.<ref>http://www2.cambridgema.gov/CityOfCambridge_Content/documents/CambridgeStreetMap18x24_032007.pdf</ref> It is also a significant [[Important Bird Area]] (IBA) in the Greater Boston area. Public parkland includes the esplanade along the Charles River, which mirrors its [[Charles River Esplanade|Boston counterpart]], [[Cambridge Common]], a busy and historic public park immediately adjacent to the Harvard campus, and the [[Alewife Brook Reservation]] and [[Fresh Pond, Cambridge, Massachusetts|Fresh Pond]] in the western part of the city. ==Demographics== {{Historical populations | type=USA | align=right | 1790|2115 | 1800|2453 | 1810|2323 | 1820|3295 | 1830|6072 | 1840|8409 |
1850|15215 | 1860|26060 | 1870|39634 | 1880|52669 | 1890|70028 | 1900|91886 | 1910|104839 | 1920|109694 | 1930|113643 | 1940|110879 | 1950|120740 | 1960|107716 | 1970|100361 | 1980|95322 | 1990|95802 | 2000|101355 | 2010|105162 | footnote= {{Historical populations/Massachusetts municipalities references}}<ref name="1950_Census_Urban_populations_since_1790">{{cite journal | title=1950 Census of Population | volume=1: Number of Inhabitants | at=Section 6, Pages 21-7 through 21-09, Massachusetts Table 4. Population of Urban Places of 10,000 or more from Earliest Census to 1920 | publisher=Bureau of the Census | accessdate=July 12, 2011 | year=1952 | url=http://www2.census.gov/prod2/decennial/documents/23761117v1ch06.pdf}}</ref> }} As of the census{{GR|2}} of 2010, there were 105,162 people, 44,032 households, and 17,420 families residing in the city. The population density was 16,422.08 people per square mile (6,341.98/km�), making Cambridge the fifth most densely populated city in t
he US<ref name=CountyCityDataBook>County and City Data Book: 2000. Washington, DC: US Department of Commerce, Bureau of the Census. Table C-1.</ref> and the second most densely populated city in [[Massachusetts]] behind neighboring [[Somerville, Massachusetts|Somerville]].<ref>[http://www.boston.com/realestate/news/articles/2008/07/13/highest_population_density/ Highest Population Density, The Boston Globe]</ref> There were 47,291 housing units at an average density of 7,354.7 per square mile (2,840.3/km�). The racial makeup of the city was 66.60% [[White (U.S. Census)|White]], 11.70% [[Black (people)|Black]] or [[Race (United States Census)|African American]], 0.20% [[Native American (U.S. Census)|Native American]], 15.10% [[Asian (U.S. Census)|Asian]], 0.01% [[Pacific Islander (U.S. Census)|Pacific Islander]], 2.10% from [[Race (United States Census)|other races]], and 4.30% from two or more races. 7.60% of the population were [[Hispanics in the United States|Hispanic]] or [[Lati
no (U.S. Census)|Latino]] of any race. [[Non-Hispanic Whites]] were 62.1% of the population in 2010,<ref>{{cite web |url=http://quickfacts.census.gov/qfd/states/25/2511000.html |title=Cambridge (city), Massachusetts |work=State & County QuickFacts |publisher=U.S. Census Bureau}}</ref> down from 89.7% in 1970.<ref>{{cite web|title=Massachusetts - Race and Hispanic Origin for Selected Cities and Other Places: Earliest Census to 1990|publisher=U.S. Census Bureau|url=http://www.census.gov/population/www/documentation/twps0076/twps0076.html}}</ref> This rather closely parallels the average [[racial demographics of the United States]] as a whole, although Cambridge has significantly more Asians than the average, and fewer Hispanics and Caucasians. 11.0% were of [[irish people|Irish]], 7.2% English, 6.9% [[italians|Italian]], 5.5% [[West Indian]] and 5.3% [[germans|German]] ancestry according to [[Census 2000]]. 69.4% spoke English, 6.9% Spanish, 3.2% [[Standard Mandarin|Chinese]] or [[Sta
ndard Mandarin|Mandarin]], 3.0% [[portuguese language|Portuguese]], 2.9% [[French-based creole languages|French Creole]], 2.3% French, 1.5% [[korean language|Korean]], and 1.0% [[italian language|Italian]] as their first language. There were 44,032 households out of which 16.9% had children under the age of 18 living with them, 28.9% were married couples living together, 8.4% had a female householder with no husband present, and 60.4% were non-families. 40.7% of all households were made up of individuals and 9.6% had someone living alone who was 65 years of age or older. The average household size was 2.00 and the average family size was 2.76. In the city the population was spread out with 13.3% under the age of 18, 21.2% from 18 to 24, 38.6% from 25 to 44, 17.8% from 45 to 64, and 9.2% who were 65 years of age or older. The median age was 30.5 years. For every 100 females, there were 96.1 males. For every 100 females age 18 and over, there were 94.7 males. The median income for a h
ousehold in the city was $47,979, and the median income for a family was $59,423 (these figures had risen to $58,457 and $79,533 respectively {{as of|2007|alt=as of a 2007 estimate}}<ref>{{cite web|url=http://factfinder.census.gov/servlet/ACSSAFFFacts?_event=Search&geo_id=16000US2418750&_geoContext=01000US%7C04000US24%7C16000US2418750&_street=&_county=cambridge&_cityTown=cambridge&_state=04000US25&_zip=&_lang=en&_sse=on&ActiveGeoDiv=geoSelect&_useEV=&pctxt=fph&pgsl=160&_submenuId=factsheet_1&ds_name=ACS_2007_3YR_SAFF&_ci_nbr=null&qr_name=null®=null%3Anull&_keyword=&_industry= |title=U.S. Census, 2000 |publisher=Factfinder.census.gov |date= |accessdate=2012-04-28}}</ref>). Males had a median income of $43,825 versus $38,489 for females. The per capita income for the city was $31,156. About 8.7% of families and 12.9% of the population were below the poverty line, including 15.1% of those under age 18 and 12.9% of those age 65 or over. Cambridge was ranked as one of the most liberal
cities in America.<ref>{{cite web|author=Aug 16, 2005 12:00 AM |url=http://www.govpro.com/News/Article/31439/ |title=Study Ranks America\u2019s Most Liberal and Conservative Cities |publisher=Govpro.com |date=2005-08-16 |accessdate=2012-04-28}}</ref> Locals living in and near the city jokingly refer to it as "The People's Republic of Cambridge."<ref>[http://www.universalhub.com/glossary/peoples_republic_the.html Wicked Good Guide to Boston English] Accessed February 2, 2009</ref> For 2012, the residential property tax rate in Cambridge is $8.48 per $1,000.<ref>{{cite web|url=http://www.cambridgema.gov/finance/propertytaxinformation/fy12propertytaxinformation.aspx |title=FY12 Property Tax Information - City of Cambridge, Massachusetts |publisher=Cambridgema.gov |date= |accessdate=2012-04-28}}</ref> Cambridge enjoys the highest possible [[bond credit rating]], AAA, with all three Wall Street rating agencies.<ref>http://www.cambridgema.gov/CityOfCambridge_Content/documents/Understanding_
Your_Taxes_2007.pdf</ref> Cambridge is noted for its diverse population, both racially and economically. Residents, known as ''Cantabrigians'', include affluent [[MIT]] and Harvard professors. The first legal applications in America for same-sex marriage licenses were issued at Cambridge's City Hall.<ref>{{cite web|url=http://www.boston.com/news/local/articles/2004/05/17/free_to_marry/ |title=Free to Marry |work=[[The Boston Globe]] |date=2004-05-17 |accessdate=2012-07-18}}</ref> Cambridge is also the birthplace of [[Thailand|Thai]] king [[Bhumibol Adulyadej|Bhumibol Adulyadej (Rama IX)]], who is the world's longest reigning monarch at age 82 (2010), as well as the longest reigning monarch in Thai history. He is also the first king of a foreign country to be born in the United States. ==Government== ===Federal and state representation=== {| class=wikitable ! colspan = 6 | Voter registration and party enrollment {{as of|lc=y|df=US|2008|10|15}}<ref>{{cite web|title = 2008 State Party
Election Party Enrollment Statistics | publisher = Massachusetts Elections Division | format = PDF | accessdate = July 7, 2010 | url = http://www.sec.state.ma.us/ele/elepdf/st_county_town_enroll_breakdown_08.pdf}}</ref> |- ! colspan = 2 | Party ! Number of voters ! Percentage {{American politics/party colors/Democratic/row}} | [[Democratic Party (United States)|Democratic]] | style="text-align:center;"| 37,822 | style="text-align:center;"| 58.43% {{American politics/party colors/Republican/row}} | [[Republican Party (United States)|Republican]] | style="text-align:center;"| 3,280 | style="text-align:center;"| 5.07% {{American politics/party colors/Independent/row}} | Unaffiliated | style="text-align:center;"| 22,935 | style="text-align:center;"| 35.43% {{American politics/party colors/Libertarian/row}} | Minor Parties | style="text-align:center;"| 690 | style="text-align:center;"| 1.07% |- ! colspan = 2 | Total ! style="text-align:center;"| 64,727 ! style="text-align:center;"| 100%
|} Cambridge is part of [[Massachusetts's 8th congressional district]], represented by Democrat [[Mike Capuano]], elected in 1998. The state's senior member of the [[United States Senate]] is Democrat [[John Kerry]], elected in 1984. The state's junior member is Republican [[Scott Brown]], [[United States Senate special election in Massachusetts, 2010|elected in 2010]] to fill the vacancy caused by the death of long-time Democratic Senator [[Ted Kennedy]]. The Governor of Massachusetts is Democrat [[Deval Patrick]], elected in 2006 and re-elected in 2010. On the state level, Cambridge is represented in six districts in the [[Massachusetts House of Representatives]]: the 24th Middlesex (which includes parts of Belmont and Arlington), the 25th and 26th Middlesex (the latter which includes a portion of Somerville), the 29th Middlesex (which includes a small part of Watertown), and the Eighth and Ninth Suffolk (both including parts of the City of Boston). The city is represented in the
[[Massachusetts Senate]] as a part of the "First Suffolk and Middlesex" district (this contains parts of Boston, Revere and Winthrop each in Suffolk County); the "Middlesex, Suffolk and Essex" district, which includes Everett and Somerville, with Boston, Chelsea, and Revere of Suffolk, and Saugus in Essex; and the "Second Suffolk and Middlesex" district, containing parts of the City of Boston in Suffolk county, and Cambridge, Belmont and Watertown in Middlesex county.<ref>{{cite web|url=http://www.malegislature.gov/ |title=Index of Legislative Representation by City and Town, from |publisher=Mass.gov |date= |accessdate=2012-04-28}}</ref> In addition to the [[Cambridge Police Department (Massachusetts)|Cambridge Police Department]], the city is patrolled by the Fifth (Brighton) Barracks of Troop H of the [[Massachusetts State Police]].<ref>[http://www.mass.gov/?pageID=eopsterminal&L=5&L0=Home&L1=Law+Enforcement+%26+Criminal+Justice&L2=Law+Enforcement&L3=State+Police+Troops&L4=Troop+H
&sid=Eeops&b=terminalcontent&f=msp_divisions_field_services_troops_troop_h_msp_field_troop_h_station_h5&csid=Eeops Station H-5, SP Brighton]{{dead link|date=April 2012}}</ref> Due, however, to close proximity, the city also practices functional cooperation with the Fourth (Boston) Barracks of Troop H, as well.<ref>[http://www.mass.gov/?pageID=eopsterminal&L=5&L0=Home&L1=Law+Enforcement+%26+Criminal+Justice&L2=Law+Enforcement&L3=State+Police+Troops&L4=Troop+H&sid=Eeops&b=terminalcontent&f=msp_divisions_field_services_troops_troop_h_msp_field_troop_h_station_h4&csid=Eeops Station H-4, SP Boston]{{dead link|date=April 2012}}</ref> ===City government=== [[File:CambridgeMACityHall1.jpg|thumb|right|[[Cambridge, Massachusetts City Hall|Cambridge City Hall]] in the 1980s]] Cambridge has a city government led by a [[List of mayors of Cambridge, Massachusetts|Mayor]] and nine-member City Council. There is also a six-member School Committee which functions alongside the Superintendent of publi
c schools. The councilors and school committee members are elected every two years using the [[single transferable vote]] (STV) system.<ref>{{cite web|url=http://www.cambridgema.gov/election/Proportional_Representation.cfm |title=Proportional Representation Voting in Cambridge |publisher=Cambridgema.gov |date= |accessdate=2012-04-28}}</ref> Once a laborious process that took several days to complete by hand, ballot sorting and calculations to determine the outcome of elections are now quickly performed by computer, after the ballots have been [[Optical scan voting system|optically scanned]]. The mayor is elected by the city councilors from amongst themselves, and serves as the chair of City Council meetings. The mayor also sits on the School Committee. However, the Mayor is not the Chief Executive of the City. Rather, the City Manager, who is appointed by the City Council, serves in that capacity. Under the City's Plan E form of government the city council does not have the power to
appoint or remove city officials who are under direction of the city manager. The city council and its individual members are also forbidden from giving orders to any subordinate of the city manager.<ref>http://www.cambridgema.gov/CityOfCambridge_Content/documents/planE.pdf</ref> [[Robert W. Healy]] is the City Manager; he has served in the position since 1981. In recent history, the media has highlighted the salary of the City Manager as being one of the highest in the State of Massachusetts.<ref>{{cite news |title=Cambridge city manager's salary almost as much as Obama's pay |url=http://www.wickedlocal.com/cambridge/features/x1837730973/Cambridge-city-managers-salary-almost-as-much-as-Obamas |agency= |newspaper=Wicked Local: Cambridge |publisher= |date=August 11, 2011 |accessdate=December 30, 2011 |quote= |archiveurl= |archivedate= |deadurl= |ref=}}</ref> The city council consists of:<ref>{{cite web|url=http://www.cambridgema.gov/ccouncil/citycouncilmembers.aspx |title=City of Ca
mbridge \u2013 City Council Members |publisher=Cambridgema.gov |date= |accessdate=2012-04-28}}</ref>{{Refbegin|3}} *[[Leland Cheung]] (Jan. 2010\u2013present) *Henrietta Davis (Jan. 1996\u2013present)* *Marjorie C. Decker (Jan. 2000\u2013present)<ref>{{cite web |url= http://www.wickedlocal.com/cambridge/news/x738245499/Marjorie-Decker-announces-she-will-run-for-Alice-Wolfs-Cambridge-State-Representative-seat |title= Marjorie Decker announces she will run for Alice Wolf's Cambridge State Representative seat |date= 22 March 2012 |work= Wicked Local Cambridge |publisher= GateHouse Media, Inc. |accessdate= 4 April 2012 }}</ref> *Craig A. Kelley (Jan. 2006\u2013present) *David Maher (Jan. 2000-Jan. 2006, Sept. 2007\u2013present<ref>{{cite web|author=By ewelin, on September 5th, 2007 |url=http://www.cambridgehighlands.com/2007/09/david-p-maher-elected-to-fill-michael-sullivans-vacated-city-council-seat |title=David P. Maher Elected to fill Michael Sullivan\u2019s Vacated City Council Seat \u2022 Cambridge Highla
nds Neighborhood Association |publisher=Cambridgehighlands.com |date=2007-09-05 |accessdate=2012-04-28}}</ref>)** *[[Kenneth Reeves]] (Jan. 1990\u2013present)** *[[E. Denise Simmons]] (Jan. 2002\u2013present)** *[[Timothy J. Toomey, Jr.]] (Jan. 1990\u2013present) *Minka vanBeuzekom (Jan. 2012\u2013present){{Refend}} ''* = Current Mayor''<br> ''** = former Mayor'' ===Fire Department=== The city of Cambridge is protected full-time by the 274 professional firefighters of the Cambridge Fire Department. The current Chief of Department is Gerald R. Reardon. The Cambridge Fire Department operates out of eight fire stations, located throughout the city, under the command of two divisions. The CFD also maintains and operates a front-line fire apparatus fleet of eight engines, four ladders, two Non-Transport Paramedic EMS units, a Haz-Mat unit, a Tactical Rescue unit, a Dive Rescue unit, two Marine units, and numerous special, support, and reserve units. John J. Gelinas, Chief of Operations, is in charge
of day to day operation of the department.<ref>{{cite web|url=http://www2.cambridgema.gov/cfd/ |title=City of Cambridge Fire Department |publisher=.cambridgema.gov |date=2005-03-13 |accessdate=2012-06-26}}</ref> The CFD is rated as a Class 1 fire department by the [[Insurance Services Office]] (ISO), and is one of only 32 fire departments so rated, out of 37,000 departments in the United States. The other class 1 departments in New England are in [[Hartford, Connecticut]] and [[Milford, Connecticut]]. Class 1 signifies the highest level of fire protection according to various criteria.<ref>{{cite web|url=http://www2.cambridgema.gov/CFD/Class1FD.cfm |title=Class 1 Fire Department |publisher=.cambridgema.gov |date=1999-07-01 |accessdate=2012-06-26}}</ref> The CFD responds to approximately 15,000 emergency calls annually. {| class=wikitable |- valign=bottom ! Engine Company ! Ladder Company ! Special Unit ! Division ! Address ! Neighborhood |- | Engine 1 || Ladder 1 || || || 491 Broad
way || Harvard Square |- | Engine 2 || Ladder 3 || Squad 2 || || 378 Massachusetts Ave. || Lafayette Square |- | Engine 3 || Ladder 2 || || || 175 Cambridge St. || East Cambridge |- | Engine 4 || || Squad 4 || || 2029 Massachusetts Ave. || Porter Square |- | Engine 5 || || || Division 1 || 1384 Cambridge St. || Inman Square |- | Engine 6 || || || || 176 River St. || Cambridgeport |- | Engine 8 || Ladder 4 || || Division 2 || 113 Garden St. || Taylor Square |- | Engine 9 || || || || 167 Lexington Ave || West Cambridge |- | Maintenance Facility || || || || 100 Smith Pl. || |} ===Water Department=== Cambridge is unusual among cities inside Route 128 in having a non-[[MWRA]] water supply. City water is obtained from [[Hobbs Brook]] (in [[Lincoln, Massachusetts|Lincoln]] and [[Waltham, Massachusetts|Waltham]]), [[Stony Brook (Boston)|Stony Brook]] (Waltham and [[Weston, Massachusetts|Weston]]), and [[Fresh Pond (Cambridge, Massachusetts)|Fresh Pond]] (Cambridge). The city owns over 1200
acres of land in other towns that includes these reservoirs and portions of their watershed.<ref>{{cite web|url=http://www2.cambridgema.gov/CWD/wat_lands.cfm |title=Cambridge Watershed Lands & Facilities |publisher=.cambridgema.gov |date= |accessdate=2012-04-28}}</ref> Water is treated at Fresh Pond, then pumped uphill to an elevation of {{convert|176|ft|m}} [[above sea level]] at the Payson Park Reservoir ([[Belmont, Massachusetts|Belmont]]); From there, the water is redistributed downhill via gravity to individual users in the city.<ref>{{cite web|url=http://www.cambridgema.gov/CityOfCambridge_Content/documents/CWD_March_2010.pdf |title=Water supply system |format=PDF |date= |accessdate=2012-04-28}}</ref><ref>[http://www.cambridgema.gov/CWD/fpfaqs.cfm Is Fresh Pond really used for drinking water?], Cambridge Water Department</ref> ===County government=== Cambridge is a [[county seat]] of [[Middlesex County, Massachusetts]], along with [[Lowell, Massachusetts|Lowell]]. Though the c
ounty government was abolished in 1997, the county still exists as a geographical and political region. The employees of Middlesex County courts, jails, registries, and other county agencies now work directly for the state. At present, the county's registrars of [[Deed]]s and Probate remain in Cambridge; however, the Superior Court and District Attorney have had their base of operations transferred to [[Woburn, Massachusetts|Woburn]]. Third District court has shifted operations to [[Medford, Massachusetts|Medford]], and the Sheriff's office for the county is still awaiting a near-term relocation.<ref>{{cite news | url=http://www.boston.com/news/local/massachusetts/articles/2008/02/14/court_move_a_hassle_for_commuters/ |title=Court move a hassle for commuters |accessdate=July 25, 2009 |first=Eric |last=Moskowitz |authorlink= |coauthors= |date=February 14, 2008 |work=[[Boston Globe|The Boston Globe]] |pages= |archiveurl= |archivedate= |quote=In a little more than a month, Middlesex Su
perior Court will open in Woburn after nearly four decades at the Edward J. Sullivan Courthouse in Cambridge. With it, the court will bring the roughly 500 people who pass through its doors each day \u2013 the clerical staff, lawyers, judges, jurors, plaintiffs, defendants, and others who use or work in the system.}}</ref><ref>{{cite news | url=http://www.wickedlocal.com/cambridge/homepage/x135741754/Cambridges-Middlesex-Jail-courts-may-be-shuttered-for-good |title=Cambridge's Middlesex Jail, courts may be shuttered for good |accessdate=July 25, 2009 |first=Charlie |last=Breitrose |authorlink= |coauthors= |date=July 7, 2009 |work=Wicked Local News: Cambridge |pages= |archiveurl= |archivedate= |quote=The courts moved out of the building to allow workers to remove asbestos. Superior Court moved to Woburn in March 2008, and in February, the Third District Court moved to Medford.}}</ref> ==Education== [[File:MIT Main Campus Aerial.jpg|thumb|Aerial view of part of [[MIT]]'s main campus]] [[
File:Dunster House.jpg|thumb|[[Dunster House]], Harvard]] ===Higher education=== Cambridge is perhaps best known as an academic and intellectual center, owing to its colleges and universities, which include: *[[Cambridge College]] *[[Cambridge School of Culinary Arts]] *[[Episcopal Divinity School]] *[[Harvard University]] *[[Hult International Business School]] *[[Lesley University]] *[[Longy School of Music]] *[[Massachusetts Institute of Technology]] *[[Le Cordon Bleu College of Culinary Arts in Boston]] [[Nobel laureates by university affiliation|At least 129]] of the world's total 780 [[Nobel Prize]] winners have been, at some point in their careers, affiliated with universities in Cambridge. The [[American Academy of Arts and Sciences]] is also based in Cambridge. ===Primary and secondary public education=== The Cambridge Public School District encompasses 12 elementary schools that follow a variety of different educational systems and philosophies. All but one of the elementa
ry schools extend up to the [[middle school]] grades as well. The 12 elementary schools are: *[[Amigos School]] *Baldwin School *Cambridgeport School *Fletcher-Maynard Academy *Graham and Parks Alternative School *Haggerty School *Kennedy-Longfellow School *King Open School *Martin Luther King, Jr. School *Morse School (a [[Core Knowledge Foundation|Core Knowledge]] school) *Peabody School *Tobin School (a [[Montessori school]]) There are three public high schools serving Cambridge students, including the [[Cambridge Rindge and Latin School]].<ref>{{cite web|url=http://www.cpsd.us/Web/PubInfo/SchoolsAtAGlance06-07.pdf|title=Cambridge Public Schools at a Glance|format=PDF}}{{dead link|date=June 2012}}</ref> and Community Charter School of Cambridge (www.ccscambridge.org) In 2003, the CRLS, also known as Rindge, came close to losing its educational accreditation when it was placed on probation by the [[New England Association of Schools and Colleges]].<ref name="Crimson MCAS">{{cite w
eb|url=http://www.thecrimson.com/article.aspx?ref=512061|title=School Fights Achievement Gap|publisher=The Harvard Crimson|accessdate=May 14, 2009}}</ref> The school has improved under Principal Chris Saheed, graduation rates hover around 98%, and 70% of students gain college admission. Community Charter School of Cambridge serves 350 students, primarily from Boston and Cambridge, and is a tuition free public charter school with a college preparatory curriculum. All students from the class of 2009 and 2010 gained admission to college. Outside of the main public schools are public charter schools including: [[Benjamin Banneker Charter School]], which serves students in grades K-6,<ref>{{cite web|url=http://www.banneker.org/ |title=The Benjamin Banneker Charter Public School |publisher=Banneker.org |date=2012-03-01 |accessdate=2012-04-28}}</ref> [[Community Charter School of Cambridge]],<ref>{{cite web|url=http://www.ccscambridge.org/ |title=Community Charter School of Cambridge |publ
isher=Ccscambridge.org |date= |accessdate=2012-04-28}}</ref> which is located in Kendall Square and serves students in grades 7\u201312, and [[Prospect Hill Academy]], a [[charter school]] whose upper school is in [[Central Square (Cambridge)|Central Square]], though it is not a part of the Cambridge Public School District. ===Primary and secondary private education=== [[File:Cambridge Public Library, Cambridge, Massachusetts.JPG|thumb|right|[[Cambridge Public Library]] original building, part of an expanded facility]] There are also many private schools in the city including: <!-- please keep alphabetical --> *[[Boston Archdiocesan Choir School]] (BACS) *[[Buckingham Browne & Nichols]] (BB&N) *[[Cambridge montessori school|Cambridge Montessori School]] (CMS) *Cambridge [[Religious Society of Friends|Friends]] School. Thomas Waring served as founding headmaster of the school. *Fayerweather Street School (FSS)[http://www.fayerweather.org/ ] *[[International School of Boston]] (ISB, form
erly �cole Bilingue) *[[Matignon High School]] *[[North Cambridge Catholic High School]] (re-branded as Cristo Rey Boston and relocated to Dorchester, MA in 2010) *[[Shady Hill School]] *St. Peter School ==Economy== [[File:Cambridge Skyline.jpg|thumb|Buildings of [[Kendall Square]], center of Cambridge's [[biotech]] economy, seen from the [[Charles River]]]] Manufacturing was an important part of the economy in the late 19th and early 20th century, but educational institutions are the city's biggest employers today. Harvard and [[Massachusetts Institute of Technology|MIT]] together employ about 20,000.<ref name="2008top25">[http://www2.cambridgema.gov/cdd/data/labor/top25/top25_2008.html Top 25 Cambridge Employers: 2008], City of Cambridge</ref> As a cradle of technological innovation, Cambridge was home to technology firms [[Analog Devices]], [[Akamai Technologies|Akamai]], [[BBN Technologies|Bolt, Beranek, and Newman (BBN Technologies)]] (now part of Raytheon), [[General Radio|Ge
neral Radio (later GenRad)]], [[Lotus Development Corporation]] (now part of [[IBM]]), [[Polaroid Corporation|Polaroid]], [[Symbolics]], and [[Thinking Machines]]. In 1996, [[Polaroid Corporation|Polaroid]], [[Arthur D. Little]], and [[Lotus Development Corporation|Lotus]] were top employers with over 1,000 employees in Cambridge, but faded out a few years later. Health care and biotechnology firms such as [[Genzyme]], [[Biogen Idec]], [[Millennium Pharmaceuticals]], [[Sanofi]], [[Pfizer]] and [[Novartis]]<ref>{{cite news |title=Novartis doubles plan for Cambridge |author=Casey Ross and Robert Weisman |first= |last= |authorlink= |authorlink2= |url=http://articles.boston.com/2010-10-27/business/29323650_1_french-drug-maker-astrazeneca-plc-research-operations |agency= |newspaper=[[The Boston Globe]] |publisher= |isbn= |issn= |pmid= |pmd= |bibcode= |doi= |date=October 27, 2010 |page= |pages= |accessdate=April 12, 2011|quote=Already Cambridge\u2019s largest corporate employer, the Swiss fi
rm expects to hire an additional 200 to 300 employees over the next five years, bringing its total workforce in the city to around 2,300. Novartis\u2019s global research operations are headquartered in Cambridge, across Massachusetts Avenue from the site of the new four-acre campus. |archiveurl= |archivedate= |ref=}}</ref> have significant presences in the city. Though headquartered in Switzerland, Novartis continues to expand its operations in Cambridge. Other major biotech and pharmaceutical firms expanding their presence in Cambridge include [[GlaxoSmithKline]], [[AstraZeneca]], [[Shire plc|Shire]], and [[Pfizer]].<ref>{{cite news|title=Novartis Doubles Plan for Cambridge|url=http://www.boston.com/business/healthcare/articles/2010/10/27/novartis_doubles_plan_for_cambridge/|accessdate=23 February 2012 | work=The Boston Globe|first1=Casey|last1=Ross|first2=Robert|last2=Weisman|date=October 27, 2010}}</ref> Most Biotech firms in Cambridge are located around [[Kendall Square]] and [[Eas
t Cambridge, Massachusetts|East Cambridge]], which decades ago were the city's center of manufacturing. A number of biotechnology companies are also located in [[University Park at MIT]], a new development in another former manufacturing area. None of the high technology firms that once dominated the economy was among the 25 largest employers in 2005, but by 2008 high tech companies [[Akamai Technologies|Akamai]] and [[ITA Software]] had grown to be among the largest 25 employers.<ref name="2008top25" /> [[Google]],<ref>{{cite web|url=http://www.google.com/corporate/address.html |title=Google Offices |publisher=Google.com |date= |accessdate=2012-07-18}}</ref> [[IBM Research]], and [[Microsoft Research]] maintain offices in Cambridge. In late January 2012\u2014less than a year after acquiring [[Billerica, Massachusetts|Billerica]]-based analytic database management company, [[Vertica]]\u2014[[Hewlett-Packard]] announced it would also be opening its first offices in Cambridge.<ref>{{cite we
b|last=Huang|first=Gregory|title=Hewlett-Packard Expands to Cambridge via Vertica\u2019s "Big Data" Center|url=http://www.xconomy.com/boston/2012/01/23/hewlett-packard-expands-to-cambridge-via-verticas-big-data-center/?single_page=true}}</ref> Around this same time, e-commerce giants [[Staples Inc.|Staples]]<ref>{{cite web|title=Staples to bring e-commerce office to Cambridge's Kendall Square Read more: Staples to bring e-commerce office to Cambridge's Kendall Square - Cambridge, Massachusetts - Cambridge Chronicle http://www.wickedlocal.com/cambridge/news/x690035936/Staples-to-bring-E-commerce-office-to-Cambridges-Kendall-Square#ixzz1nDY39Who|url=http://www.wickedlocal.com/cambridge/news/x690035936/Staples-to-bring-E-commerce-office-to-Cambridges-Kendall-Square#axzz1kg3no7Zg}}</ref> and [[Amazon.com]]<ref>{{cite web|title=Amazon Seeks Brick-And-Mortar Presence In Boston Area|url=http://www.wbur.org/2011/12/22/amazon-boston}}</ref> said they would be opening research and innovation cen
ters in Kendall Square. Video game developer [[Harmonix Music Systems]] is based in [[Central Square (Cambridge)|Central Square]]. The proximity of Cambridge's universities has also made the city a center for nonprofit groups and think tanks, including the [[National Bureau of Economic Research]], the [[Smithsonian Astrophysical Observatory]], the [[Lincoln Institute of Land Policy]], [[Cultural Survival]], and [[One Laptop per Child]]. In September 2011, an initiative by the City of Cambridge called the "[[Entrepreneur Walk of Fame]]" was launched. It seeks to highlight individuals who have made contributions to innovation in the global business community.<ref>{{cite news |title=Stars of invention |author= |first=Kathleen |last=Pierce |url=http://articles.boston.com/2011-09-16/business/30165912_1_gates-and-jobs-microsoft-granite-stars |agency= |newspaper=The Boston Globe|date=September 16, 2011 |page= |pages= |at= |accessdate=October 1, 2011}}</ref> ===Top employers=== The top ten
employers in the city are:<ref>{{cite web|url=http://cambridgema.gov/citynewsandpublications/news/2012/01/fy11comprehensiveannualfinancialreportnowavailable.aspx |title=City of Cambridge, Massachusetts Comprehensive Annual Financial Report July 1, 2010\u2014June 30, 2011 |publisher=Cambridgema.gov |date=2011-06-30 |accessdate=2012-04-28}}</ref> {| class="wikitable" |- ! # ! Employer ! # of employees |- | 1 |[[Harvard University]] |10,718 |- |2 |[[Massachusetts Institute of Technology]] |7,604 |- |3 |City of Cambridge |2,922 |- |4 |[[Novartis]] Institutes for BioMedical Research |2,095 |- |5 |[[Mount Auburn Hospital]] |1,665 |- |6 |[[Vertex Pharmaceuticals]] |1,600 |- |7 |[[Genzyme]] |1,504 |- |8 |[[Biogen Idec]] |1,350 |- |9 |[[Federal government of the United States|Federal Government]] |1,316 |- |10 |[[Pfizer]] |1,300 |} ==Transportation== {{See also|Boston transportation}} ===Road=== [[File:Harvard Square at Peabody Street and Mass Avenue.jpg|thumb|[[Massachusetts Avenue (Boston)|Ma
ssachusetts Avenue]] in [[Harvard Square]]]] Several major roads lead to Cambridge, including [[Massachusetts State Highway 2|Route 2]], [[Massachusetts State Highway 16|Route 16]] and the [[Massachusetts State Highway 28|McGrath Highway (Route 28)]]. The [[Massachusetts Turnpike]] does not pass through Cambridge, but provides access by an exit in nearby [[Allston, Massachusetts|Allston]]. Both [[U.S. Route 1]] and [[I-93 (MA)]] also provide additional access on the eastern end of Cambridge at Leverett Circle in [[Boston]]. [[Massachusetts State Highway 2A|Route 2A]] runs the length of the city, chiefly along Massachusetts Avenue. The Charles River forms the southern border of Cambridge and is crossed by 11 bridges connecting Cambridge to Boston, including the [[Longfellow Bridge]] and the [[Harvard Bridge]], eight of which are open to motorized road traffic. Cambridge has an irregular street network because many of the roads date from the colonial era. Contrary to popular belief, t
he road system did not evolve from longstanding cow-paths. Roads connected various village settlements with each other and nearby towns, and were shaped by geographic features, most notably streams, hills, and swampy areas. Today, the major "squares" are typically connected by long, mostly straight roads, such as Massachusetts Avenue between [[Harvard Square]] and [[Central Square (Cambridge)|Central Square]], or Hampshire Street between [[Kendall Square]] and [[Inman Square]]. ===Mass transit=== [[File:Central MBTA station.jpg|thumb|[[Central (MBTA)|Central station on the MBTA Red Line]]]] Cambridge is well served by the [[MBTA]], including the [[Porter (MBTA station)|Porter Square stop]] on the regional [[MBTA Commuter Rail|Commuter Rail]], the [[Lechmere (MBTA station)|Lechmere stop]] on the [[Green Line (MBTA)|Green Line]], and five stops on the [[Red Line (MBTA)|Red Line]] ([[Alewife Station (MBTA)|Alewife]], [[Porter (MBTA)|Porter Square]], [[Harvard (MBTA station)|Harvard Squ
are]], [[Central (MBTA station)|Central Square]], and [[Kendall/MIT (MBTA station)|Kendall Square/MIT]]). Alewife Station, the current terminus of the Red Line, has a large multi-story parking garage (at a rate of $7 per day {{as of|lc=y|2009}}).<ref>{{cite web|url=http://www.mbta.com/schedules_and_maps/subway/lines/stations/?stopId=10029 |title=> Schedules & Maps > Subway > Alewife Station |publisher=MBTA |date= |accessdate=2012-04-28}}</ref> The [[Harvard Bus Tunnel]], under Harvard Square, reduces traffic congestion on the surface, and connects to the Red Line underground. This tunnel was originally opened for streetcars in 1912, and served trackless trolleys and buses as the routes were converted. The tunnel was partially reconfigured when the Red Line was extended to Alewife in the early 1980s. Outside of the state-owned transit agency, the city is also served by the Charles River Transportation Management Agency (CRTMA) shuttles which are supported by some of the largest compa
nies operating in city, in addition to the municipal government itself.<ref>{{cite web |url=http://www.charlesrivertma.org/members.htm |title=Charles River TMA Members |author=Staff writer |date=(As of) January 1, 2013 |work=CRTMA |publisher= |language= |trans_title= |type= |archiveurl= |archivedate= |deadurl= |accessdate=January 1, 2013 |quote= |ref= |separator= |postscript=}} </ref> ===Cycling=== Cambridge has several [[bike path]]s, including one along the Charles River,<ref>{{cite web|url=http://www.mass.gov/dcr/parks/metroboston/maps/bikepaths_dudley.gif |title=Dr. Paul Dudley White Bikepath |date= |accessdate=2012-04-28}}</ref> and the [[Cambridge Linear Park|Linear Park]] connecting the [[Minuteman Bikeway]] at Alewife with the [[Somerville Community Path]]. Bike parking is common and there are bike lanes on many streets, although concerns have been expressed regarding the suitability of many of the lanes. On several central MIT streets, bike lanes transfer onto the sidewalk.
Cambridge bans cycling on certain sections of sidewalk where pedestrian traffic is heavy.<ref>{{cite web|url=http://www.cambridgema.gov/cdd/et/bike/bike_ban.html |title=Sidewalk Bicycling Banned Areas \u2013 Cambridge Massachusetts |publisher=Cambridgema.gov |date= |accessdate=2012-04-28}}</ref><ref>{{cite web|url=http://www.cambridgema.gov/cdd/et/bike/bike_reg.html |title=Traffic Regulations for Cyclists \u2013 Cambridge Massachusetts |publisher=Cambridgema.gov |date=1997-05-01 |accessdate=2012-04-28}}</ref> While ''[[Bicycling Magazine]]'' has rated Boston as one of the worst cities in the nation for bicycling (In their words, for "lousy roads, scarce and unconnected bike lanes and bike-friendly gestures from City Hall that go nowhere\u2014such as hiring a bike coordinator in 2001, only to cut the position two years later"),<ref>[http://www.bicycling.com/article/1,6610,s1-2-16-14593-11,00.html Urban Treasures \u2013 bicycling.com]{{dead link|date=April 2012}}</ref> it has listed Cambridge as
an honorable mention as one of the best<ref>[http://www.bicycling.com/article/1,6610,s1-2-16-14593-9,00.html Urban Treasures \u2013 bicycling.com]{{dead link|date=April 2012}}</ref> and was called by the magazine "Boston's Great Hope." Cambridge has an active, official bicycle committee. ===Walking=== [[File:Weeks Footbridge Cambridge, MA.jpg|thumb|The [[John W. Weeks Bridge|Weeks Bridge]] provides a pedestrian-only connection between Boston's Allston-Brighton neighborhood and Cambridge over the Charles River]] Walking is a popular activity in Cambridge. Per year 2000 data, of the communities in the U.S. with more than 100,000 residents, Cambridge has the highest percentage of commuters who walk to work.<ref>{{cite web|url=http://www.bikesatwork.com/carfree/census-lookup.php?state_select=ALL_STATES&lower_pop=100000&upper_pop=99999999&sort_num=2&show_rows=25&first_row=0 |title=The Carfree Census Database: Result of search for communities in any state with population over 100,000, sorte
d in descending order by % Pedestrian Commuters |publisher=Bikesatwork.com |date= |accessdate=2012-04-28}}</ref> Cambridge receives a "Walk Score" of 100 out of 100 possible points.<ref>[http://www.walkscore.com/get-score.php?street=cambridge%2C+ma&go=Go Walk Score site] Accessed July 28, 2009</ref> Cambridge's major historic squares have been recently changed into a modern walking landscape, which has sparked a traffic calming program based on the needs of pedestrians rather than of motorists. ===Intercity=== The Boston intercity bus and train stations at [[South Station]], Boston, and [[Logan International Airport]] in [[East Boston]], are accessible by [[Red Line (MBTA)|subway]]. The [[Fitchburg Line]] rail service from [[Porter (MBTA station)|Porter Square]] connects to some western suburbs. Since October 2010, there has also been intercity bus service between [[Alewife (MBTA station)|Alewife Station]] (Cambridge) and [[New York City]].<ref>{{cite web|last=Thomas |first=Sarah |u
rl=http://www.boston.com/yourtown/news/cambridge/2010/10/warren_mbta_welcome_world_wide.html |title=NYC-bound buses will roll from Newton, Cambridge |publisher=Boston.com |date=2010-10-19 |accessdate=2012-04-28}}</ref> ==Media== ===Newspapers=== Cambridge is served by several weekly newspapers. The most prominent is the ''[[Cambridge Chronicle]]'', which is also the oldest surviving weekly paper in the United States. ===Radio=== Cambridge is home to the following commercially licensed and student-run radio stations: {| class=wikitable |- ! [[Callsign]] !! Frequency !! City/town !! Licensee !! Format |- | [[WHRB]] || align=right | 95.3 FM || Cambridge (Harvard) || Harvard Radio Broadcasting Co., Inc. || [[Variety (US radio)|Musical variety]] |- | [[WJIB]] || align=right | 740 AM || Cambridge || Bob Bittner Broadcasting || [[Adult Standards]]/Pop |- | [[WMBR]] || align=right | 88.1 FM || Cambridge (MIT) || Technology Broadcasting Corporation || [[College radio]] |} ===Television=
== Cambridge Community Television (CCTV) has served the Cambridge community since its inception in 1988. CCTV operates Cambridge's public access television facility and programs three television channels, 8, 9, and 96 on the Cambridge cable system (Comcast). ===Social media=== As of 2011, a growing number of social media efforts provide means for participatory engagement with the locality of Cambridge, such as Localocracy<ref>"Localocracy is an online town common where registered voters using real names can weigh in on local issues." [http://cambridge.localocracy.com/ Localocracy Cambridge, Massachusetts]. Accessed 2011-10-01</ref> and [[foursquare (website)|Foursquare]]. ==Culture, art and architecture== [[File:Fogg.jpg|thumb|[[Fogg Museum]], Harvard]] ===Museums=== * [[Harvard Art Museum]], including the [[Busch-Reisinger Museum]], a collection of Germanic art the [[Fogg Art Museum]], a comprehensive collection of Western art, and the [[Arthur M. Sackler Museum]], a collection of
Middle East and Asian art * [[Harvard Museum of Natural History]], including the [[Glass Flowers]] collection * [[Peabody Museum of Archaeology and Ethnology]], Harvard *[[Semitic Museum]], Harvard * [[MIT Museum]] * [[List Visual Arts Center]], MIT ===Public art=== Cambridge has a large and varied collection of permanent public art, both on city property (managed by the Cambridge Arts Council),<ref>{{cite web|url=http://www.cambridgema.gov/CAC/Public/overview.cfm |title=CAC Public Art Program |publisher=Cambridgema.gov |date=2007-03-13 |accessdate=2012-04-28}}</ref> and on the campuses of Harvard<ref>{{cite web|url=http://ofa.fas.harvard.edu/visualarts/pubart.php |title=Office for the Arts at Harvard: Public Art |publisher=Ofa.fas.harvard.edu |date= |accessdate=2012-04-28}}</ref> and MIT.<ref>{{cite web|url=http://listart.mit.edu/map |title=MIT Public Art Collection Map |publisher=Listart.mit.edu |date= |accessdate=2012-04-28}}</ref> Temporary public artworks are displayed as part
of the annual Cambridge River Festival on the banks of the Charles River, during winter celebrations in Harvard and Central Squares, and at university campus sites. Experimental forms of public artistic and cultural expression include the Central Square World's Fair, the Somerville-based annual Honk! Festival,<ref>{{cite web|url=http://honkfest.org/ |title= Honk Fest}}</ref> and [[If This House Could Talk]],<ref>{{cite web|url=http://cambridgehistory.org/discover/ifthishousecouldtalk/index.html |title=The Cambridge Historical Society}}</ref> a neighborhood art and history event. {{or|date=April 2012}} {{Citation needed|date=April 2012}} An active tradition of street musicians and other performers in Harvard Square entertains an audience of tourists and local residents during the warmer months of the year. The performances are coordinated through a public process that has been developed collaboratively by the performers,<ref>{{cite web|url=http://www.buskersadvocates.org/ | title= St
reet Arts & Buskers Advocates}}</ref> city administrators, private organizations and business groups.<ref>{{cite web|url=http://harvardsquare.com/Home/Arts-and-Entertainment/Street-Arts-and-Buskers-Advocates.aspx |title=Street Arts and Buskers Advocates |publisher=Harvardsquare.com |date= |accessdate=2012-04-28}}</ref> [[File:Longfellow National Historic Site, Cambridge, Massachusetts.JPG|thumb|right|The [[Longfellow National Historic Site]]]] [[File:Wfm stata center.jpg|thumb|[[Stata Center]], MIT]] [[File:Simmons Hall, MIT, Cambridge, Massachusetts.JPG|thumb|[[List of MIT undergraduate dormitories|Simmons Hall]], MIT]] ===Architecture=== Despite intensive urbanization during the late 19th century and 20th century, Cambridge has preserved an unusual number of historic buildings, including some dating to the 17th century. The city also contains an abundance of innovative contemporary architecture, largely built by Harvard and MIT. ;Notable historic buildings in the city include: * T
he [[Asa Gray House]] (1810) * [[Austin Hall, Harvard University]] (1882\u201384) * [[Cambridge, Massachusetts City Hall|Cambridge City Hall]] (1888\u201389) * [[Cambridge Public Library]] (1888) * [[Christ Church, Cambridge]] (1761) * [[Cooper-Frost-Austin House]] (1689\u20131817) * [[Elmwood (Cambridge, Massachusetts)|Elmwood House]] (1767), residence of the [[President of Harvard University]] * [[First Church of Christ, Scientist (Cambridge, Massachusetts)|First Church of Christ, Scientist]] (1924\u201330) * [[The First Parish in Cambridge]] (1833) * [[Harvard-Epworth United Methodist Church]] (1891\u201393) * [[Harvard Lampoon Building]] (1909) * The [[Hooper-Lee-Nichols House]] (1685\u20131850) * [[Longfellow National Historic Site]] (1759), former home of poet [[Henry Wadsworth Longfellow]] * [[The Memorial Church of Harvard University]] (1932) * [[Memorial Hall, Harvard University]] (1870\u201377) * [[Middlesex County Courthouse (Massachusetts)|Middlesex County Courthouse]] (1814\u201348) * [[Urban
Rowhouse (40-48 Pearl Street, Cambridge, Massachusetts)|Urban Rowhouse]] (1875) * [[spite house|O'Reilly Spite House]] (1908), built to spite a neighbor who would not sell his adjacent land<ref name="existing">Bloom, Jonathan. (February 2, 2003) [[Boston Globe]] ''[http://nl.newsbank.com/nl-search/we/Archives?p_product=BG&p_theme=bg&p_action=search&p_maxdocs=200&p_topdoc=1&p_text_direct-0=0F907F2342522B5D&p_field_direct-0=document_id&p_perpage=10&p_sort=YMD_date:D Existing by the Thinnest of Margins. A Concord Avenue Landmark Gives New Meaning to Cozy.]'' Section: City Weekly; Page 11. Location: 260 Concord Ave, Cambridge, MA 02138.</ref> {{See also|List of Registered Historic Places in Cambridge, Massachusetts}} ;Contemporary architecture: * [[List of MIT undergraduate dormitories#Baker House|Baker House]] dormitory, MIT, by Finnish architect [[Alvar Aalto]], one of only two buildings by Aalto in the US * Harvard Graduate Center/Harkness Commons, by [[The Architects Collaborative]]
(TAC, with [[Walter Gropius]]) * [[Carpenter Center for the Visual Arts]], Harvard, the only building in North America by [[Le Corbusier]] * [[Kresge Auditorium]], MIT, by [[Eero Saarinen]] * [[MIT Chapel]], by [[Eero Saarinen]] * [[Design Research Building]], by [[Benjamin Thompson and Associates]] * [[American Academy of Arts and Sciences]], by [[Kallmann McKinnell and Wood]], also architects of Boston City Hall * [[Arthur M. Sackler Museum]], Harvard, one of the few buildings in the U.S. by [[James Stirling (architect)|James Stirling]], winner of the [[Pritzker Prize]] * [[Stata Center]], MIT, by [[Frank Gehry]] * [[List of MIT undergraduate dormitories#Simmons Hall|Simmons Hall]], MIT, by [[Steven Holl]] ===Music=== <!-- make section generic. NEEDS MORE WORK. remove marketing fluff for Ryles. --> The city has an active music scene from classical performances to the latest popular bands. ==Sister cities== Cambridge has 8 active, official [[Twin towns and sister cities|sister cit
ies]], and an unofficial relationship with [[Cambridge]], England:<ref name="peacom">"A message from the Peace Commission" [http://www.cambridgema.gov/peace/newsandpublications/news/detail.aspx?path=%2fsitecore%2fcontent%2fhome%2fpeace%2fnewsandpublications%2fnews%2f2008%2f02%2finformationoncambridgessistercities].</ref> *{{Flagicon|PRT}} [[Coimbra]], [[Portugal]] *{{Flagicon|CUB}} [[Cienfuegos]], [[Cuba]] *{{Flagicon|ITA}} [[Gaeta]], [[Italy]] *{{Flagicon|IRL}} [[Galway]], [[Republic of Ireland|Ireland]] *{{Flagicon|ARM}} [[Yerevan]], [[Armenia]]<ref>{{cite web|url=http://www.cysca.org/ |title=Cambridge-Yerevan Sister City Association |publisher=Cysca.org |date= |accessdate=2012-04-28}}</ref> *{{Flagicon|SLV}} [[San Jos� Las Flores, Chalatenango|San Jos� Las Flores]], [[El Salvador]] *{{Flagicon|JPN}} [[Tsukuba, Ibaraki|Tsukuba Science City]], Japan *{{Flagicon|POL}} [[Krak�w]], [[Poland]] *{{Flagicon|CHN}} [[Haidian District]], [[China]] Ten other official sister city relations
hips are inactive: [[Dublin]], Ireland; [[Ischia]], [[Catania]], and [[Florence]], Italy; [[Krak�w]], Poland; [[Santo Domingo Oeste]], Dominican Republic; [[Southwark]], London, England; [[Yuseong]], Daejeon, Korea; and [[Haidian District|Haidian]], Beijing, China.<ref name="peacom"/> There has also been an unofficial relationship with: *{{Flagicon|GBR}} [[Cambridge]], England, UK<ref>{{cite web|url=http://www.cambridgema.gov/peace/newsandpublications/news/detail.aspx?path=%2fsitecore%2fcontent%2fhome%2fpeace%2fnewsandpublications%2fnews%2f2008%2f02%2finformationoncambridgessistercities |title="Sister Cities", Cambridge Peace Commission |publisher=Cambridgema.gov |date=2008-02-15 |accessdate=2012-07-18}}</ref> ==Zip codes== *02138\u2014Harvard Square/West Cambridge *02139\u2014Central Square/Inman Square/MIT *02140\u2014Porter Square/North Cambridge *02141\u2014East Cambridge *02142\u2014Kendall Square ==References== {{reflist|30em}} ==General references== * ''History of Middlesex County, Massach
usetts'', [http://books.google.com/books?id=QGolOAyd9RMC&dq=intitle:History+intitle:of+intitle:Middlesex+intitle:County+intitle:Massachusetts&lr=&num=50&as_brr=0&source=gbs_other_versions_sidebar_s&cad=5 Volume 1 (A-H)], [http://books.google.com/books?id=hNaAnwRMedUC&pg=PA506&dq=intitle:History+intitle:of+intitle:Middlesex+intitle:County+intitle:Massachusetts&lr=&num=50&as_brr=0#PPA3,M1 Volume 2 (L-W)] compiled by Samuel Adams Drake, published 1879\u20131880. ** [http://books.google.com/books?id=QGolOAyd9RMC&printsec=titlepage#PPA305,M1 Cambridge article] by Rev. Edward Abbott in volume 1, pages 305\u2013358. *Eliot, Samuel Atkins. ''A History of Cambridge, Massachusetts: 1630\u20131913''. Cambridge: The Cambridge Tribune, 1913. *Hiestand, Emily. "Watershed: An Excursion in Four Parts" The Georgia Review Spring 1998 pages 7\u201328 *[[Lucius Robinson Paige|Paige, Lucius]]. ''History of Cambridge, Massachusetts: 1630\u20131877''. Cambridge: The Riverside Press, 1877. *Survey of Architectural Histor
y in Cambridge: Mid Cambridge, 1967, Cambridge Historical Commission, Cambridge, Mass.{{ISBN missing}} *Survey of Architectural History in Cambridge: Cambridgeport, 1971 ISBN 0-262-53013-9, Cambridge Historical Commission, Cambridge, Mass. *Survey of Architectural History in Cambridge: Old Cambridge, 1973 ISBN 0-262-53014-7, Cambridge Historical Commission, Cambridge, Mass. *Survey of Architectural History in Cambridge: Northwest Cambridge, 1977 ISBN 0-262-53032-5, Cambridge Historical Commission, Cambridge, Mass. *Survey of Architectural History in Cambridge: East Cambridge, 1988 (revised) ISBN 0-262-53078-3, Cambridge Historical Commission, Cambridge, Mass. *{{cite book|last=Sinclair|first=Jill|title=Fresh Pond: The History of a Cambridge Landscape|publisher=MIT Press|location=Cambridge, Mass.|date=April 2009|isbn=978-0-262-19591-1 }} *{{cite book|last=Seaburg|first=Alan|title=Cambridge on the Charles|url=http://books.google.com/books?id=c7_oCS782-8C|publisher=Anne Miniver Press|l
ocation=Billerica, Mass.|year=2001|author=Seaburg, A. and Dahill, T. and Rose, C.H.|isbn=978-0-9625794-9-3}} ==External links== {{Commons category}} <!-- for current and future use if material is uploaded --> {{Wikivoyage|Cambridge (Massachusetts)}} {{Portal|Boston}} {{Commons category|Cambridge, Massachusetts}} *{{Official website|http://www.cambridgema.gov/}} *[http://www.cambridge-usa.org/ Cambridge Office for Tourism] *[http://www.city-data.com/city/Cambridge-Massachusetts.html City-Data.com] *[http://www.epodunk.com/cgi-bin/genInfo.php?locIndex=2894 ePodunk: Profile for Cambridge, Massachusetts] *{{dmoz|Regional/North_America/United_States/Massachusetts/Localities/C/Cambridge}} <br/><!--this break is to put visual space between the last information and the following template if needed--> ===Maps=== *[http://www.cambridgema.gov/GIS/FindMapAtlas.cfm Cambridge Maps] *[http://www.cambridgema.gov/GIS City of Cambridge Geographic Information System (GIS)] *[http://www.salemdeeds.com/
atlases_results.asp?ImageType=index&atlastype=MassWorld&atlastown=&atlas=MASSACHUSETTS+1871&atlas_desc=MASSACHUSETTS+1871 ''1871 Atlas of Massachusetts''.] by Wall & Gray. [http://www.salemdeeds.com/atlases_pages.asp?ImageName=PAGE_0010_0011.jpg&atlastype=MassWorld&atlastown=&atlas=MASSACHUSETTS+1871&atlas_desc=MASSACHUSETTS+1871&pageprefix= Map of Massachusetts.] [http://www.salemdeeds.com/atlases_pages.asp?ImageName=PAGE_0044_0045.jpg&atlastype=MassWorld&atlastown=&atlas=MASSACHUSETTS+1871&atlas_desc=MASSACHUSETTS+1871&pageprefix= Map of Middlesex County.] *Dutton, E.P. [http://maps.bpl.org/details_10717/?srch_query=Dutton%2C+E.P.&srch_fields=all&srch_author=on&srch_style=exact&srch_fa=save&srch_ok=Go+Search Chart of Boston Harbor and Massachusetts Bay with Map of Adjacent Country.] Published 1867. A good map of roads and rail lines around Cambridge. *[http://www.citymap.com/cambridge/index.htm Cambridge Citymap \u2013 Community, Business, and Visitor Map.] *[http://docs.unh.edu/town
s/CambridgeMassachusettsMapList.htm Old USGS maps of Cambridge area.] {{Greater Boston}} {{Middlesex County, Massachusetts}} {{Massachusetts}} {{New England}} {{Massachusetts cities and mayors of 100,000 population}} [[Category:Cambridge, Massachusetts| ]] [[Category:University towns in the United States]] [[Category:County seats in Massachusetts]] [[Category:Populated places established in 1630]] [[Category:Charles River]] [[Category:Place names of English origin in the United States]] [[af:Cambridge, Massachusetts]] [[ar:\u0643\u0627\u0645\u0628\u0631\u064a\u062f\u062c\u060c \u0645\u0627\u0633\u0627\u062a\u0634\u0648\u0633\u062a\u0633]] [[zh-min-nan:Cambridge, Massachusetts]] [[be:\u0413\u043e\u0440\u0430\u0434 \u041a\u0435\u043c\u0431\u0440\u044b\u0434\u0436, \u041c\u0430\u0441\u0430\u0447\u0443\u0441\u0435\u0442\u0441]] [[be-x-old:\u041a\u0435\u043c\u0431\u0440\u044b\u0434\u0436 (\u041c\u0430\u0441\u0430\u0447\u0443\u0441\u044d\u0442\u0441)]] [[bg:\u041a\u0435\u0439\u043c\u0431\u0440\u0438\u0434\u0436 (\u041c\u0430\u0441\u0430\u0447\u0443\u0437\u0435\u0442\u0441)]] [[br:Cambridge (Massachusetts)]] [[ca:Cambridge (Massachusetts)]] [[cs:Cambridge (Massachusetts)]] [[cy:Cambridge, Massachusetts]] [[da:Cambridge (Massachusetts)]] [[de:Cambridge (Massachusetts)]] [[et:Cambridge (Massachusetts)
]] [[es:Cambridge (Massachusetts)]] [[eo:Kembri\u011do (Masa\u0109useco)]] [[eu:Cambridge (Massachusetts)]] [[fa:\u06a9\u0645\u0628\u0631\u06cc\u062c (\u0645\u0627\u0633\u0627\u0686\u0648\u0633\u062a)]] [[fr:Cambridge (Massachusetts)]] [[gd:Cambridge (MA)]] [[ko:\ucf00\uc784\ube0c\ub9ac\uc9c0 (\ub9e4\uc0ac\ucd94\uc138\uce20 \uc8fc)]] [[hy:\u0554\u0565\u0574\u0562\u0580\u056b\u057b (\u0544\u0561\u057d\u0561\u0579\u0578\u0582\u057d\u0565\u0569\u057d)]] [[id:Cambridge, Massachusetts]] [[it:Cambridge (Massachusetts)]] [[he:\u05e7\u05d9\u05d9\u05de\u05d1\u05e8\u05d9\u05d3\u05d2' (\u05de\u05e1\u05e6'\u05d5\u05e1\u05d8\u05e1)]] [[jv:Cambridge, Massachusetts]] [[kk:\u041a\u044d\u043c\u0431\u0440\u0438\u0434\u0436 (\u041c\u0430\u0441\u0441\u0430\u0447\u0443\u0441\u0435\u0442\u0441)]] [[kw:Cambridge, Massachusetts]] [[sw:Cambridge, Massachusetts]] [[ht:Cambridge, Massachusetts]] [[la:Cantabrigia (Massachusetta)]] [[lv:Keimbrid\u017ea]] [[lb:Cambridge (Massachusetts)]] [[hu:Cambridge (Massachusetts)]] [[mr:\u0915\u0947\u0902\u092c\u094d\u0930\u093f\u091c, \u092e\u0945\u0938\u0947\u091a\u094d\u092f\u0941\u0938\u0947\u091f\u094d\u0938]] [[ms:Cambridge, Massachusetts]] [[nl:Cambridge (Massachusetts)]] [[ja:\u30b1\u30f3\u30d6\u30ea\u30c3\u30b8 (\u30de\u30b5\u30c1\u30e5\u30fc\u30bb\u30c3\u30c4\u5dde)]] [[no:Cambridge (Massachusetts)]] [[pl:Cambridge (Massachusetts)]] [[pt:Cambridge (Massachusetts)]] [[ro:Cambri
dge, Massachusetts]] [[ru:\u041a\u0435\u043c\u0431\u0440\u0438\u0434\u0436 (\u041c\u0430\u0441\u0441\u0430\u0447\u0443\u0441\u0435\u0442\u0441)]] [[scn:Cambridge (Massachusetts), USA]] [[simple:Cambridge, Massachusetts]] [[sk:Cambridge (Massachusetts)]] [[sl:Cambridge, Massachusetts]] [[sr:\u041a\u0435\u043c\u0431\u0440\u0438\u045f (\u041c\u0430\u0441\u0430\u0447\u0443\u0441\u0435\u0442\u0441)]] [[fi:Cambridge (Massachusetts)]] [[sv:Cambridge, Massachusetts]] [[tl:Cambridge, Massachusetts]] [[ta:\u0b95\u0bc7\u0bae\u0bcd\u0baa\u0bbf\u0bb0\u0bbf\u0b9c\u0bcd, \u0bae\u0bbe\u0b9a\u0b9a\u0bc2\u0b9a\u0bc6\u0b9f\u0bcd\u0bb8\u0bcd]] [[th:\u0e40\u0e04\u0e21\u0e1a\u0e23\u0e34\u0e14\u0e08\u0e4c (\u0e23\u0e31\u0e10\u0e41\u0e21\u0e2a\u0e0b\u0e32\u0e0a\u0e39\u0e40\u0e0b\u0e15\u0e2a\u0e4c)]] [[tg:\u041a\u0435\u043c\u0431\u0440\u0438\u04b7 (\u041c\u0430\u0441\u0441\u0430\u0447\u0443\u0441\u0435\u0442\u0441)]] [[tr:Cambridge, Massachusetts]] [[uk:\u041a\u0435\u043c\u0431\u0440\u0438\u0434\u0436 (\u041c\u0430\u0441\u0441\u0430\u0447\u0443\u0441\u0435\u0442\u0441)]] [[vi:Cambridge, Massachusetts]] [[vo:Cambridge (Massachusetts)]] [[war:Cambridge, Massachusetts]] [[yi:\u05e7\u05e2\u05de\u05d1\u05e8\u05d9\u05d3\u05d6\u05e9, \u05de\u05d0\u05e1\u05d0\u05d8\u05e9\u05d5\u05e1\u05e2\u05d8\u05e1]] [[zh:\u5251\u6865 (\u9a6c\u8428\u8bf8\u585e\u5dde)]]
\ No newline at end of file