• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision87cb69e06e3d7d461a93b53a55bb65aefd27b85b (tree)
Time2015-07-09 11:49:53
Authorkomutan <t_komuta@nift...>
Commiterkomutan

Log Message

微修正

Change Summary

Incremental Difference

--- a/src/LibNMeCab/Core/PriorityQueue.cs
+++ b/src/LibNMeCab/Core/PriorityQueue.cs
@@ -10,21 +10,16 @@ namespace NMeCab.Core
1010 private class Node
1111 {
1212 public T Value { get; private set; }
13-
14- public int ChiledsCount { get; private set; }
15-
13+ public int ChildsCount { get; private set; }
1614 public Node FirstChild { get; private set; }
17-
1815 public Node LastChild { get; private set; }
19-
2016 public Node Prev { get; private set; }
21-
2217 public Node Next { get; private set; }
2318
2419 public void AddFirstChild(Node first)
2520 {
26- this.ChiledsCount++;
27- if (this.ChiledsCount == 1)
21+ this.ChildsCount++;
22+ if (this.ChildsCount == 1)
2823 {
2924 this.LastChild = first;
3025 }
@@ -39,8 +34,8 @@ namespace NMeCab.Core
3934
4035 public void AddLastChild(Node last)
4136 {
42- this.ChiledsCount++;
43- if (this.ChiledsCount == 1)
37+ this.ChildsCount++;
38+ if (this.ChildsCount == 1)
4439 {
4540 this.FirstChild = last;
4641 }
@@ -55,8 +50,8 @@ namespace NMeCab.Core
5550
5651 public Node PollFirstChild()
5752 {
58- this.ChiledsCount--;
59- if (this.ChiledsCount == 0)
53+ this.ChildsCount--;
54+ if (this.ChildsCount == 0)
6055 {
6156 this.LastChild.Prev = null;
6257 this.LastChild = null;
@@ -128,9 +123,9 @@ namespace NMeCab.Core
128123
129124 private Node Unify(Node node)
130125 {
131- if (node == null || node.ChiledsCount == 0) return null;
126+ if (node == null || node.ChildsCount == 0) return null;
132127
133- Node[] tmp = new Node[node.ChiledsCount / 2]; //擬似的Stack
128+ Node[] tmp = new Node[node.ChildsCount / 2]; //必要な要素数が明らかなのでStackではなく配列
134129
135130 for (int i = 0; i < tmp.Length; i++)
136131 {
@@ -140,12 +135,12 @@ namespace NMeCab.Core
140135 }
141136
142137 Node z;
143- if (node.ChiledsCount == 1)
138+ if (node.ChildsCount == 1) //子要素数が奇数の場合、まだ1つ残っている子要素をここで処理
144139 z = node.PollFirstChild();
145140 else
146141 z = null;
147142
148- for (int i = tmp.Length - 1; i >= 0; i--)
143+ for (int i = tmp.Length - 1; i >= 0; i--) //逆順ループで配列をStackのように振る舞わせる
149144 {
150145 z = this.Merge(tmp[i], z);
151146 }
--- a/src/LibNMeCabMMF/app.config
+++ b/src/LibNMeCab40MMF/bin/Debug/LibNMeCab.dll.config
@@ -1,4 +1,4 @@
1-<?xml version="1.0" encoding="utf-8" ?>
1+<?xml version="1.0" encoding="utf-8" ?>
22 <configuration>
33 <configSections>
44 <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
--- a/src/LibNMeCabMMF/LibNMeCabMMF.csproj
+++ /dev/null
@@ -1,156 +0,0 @@
1-<?xml version="1.0" encoding="utf-8"?>
2-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3- <PropertyGroup>
4- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6- <ProductVersion>8.0.30703</ProductVersion>
7- <SchemaVersion>2.0</SchemaVersion>
8- <ProjectGuid>{B5C3DDEA-F7CE-4A9D-8B28-5FC1B582A4EB}</ProjectGuid>
9- <OutputType>Library</OutputType>
10- <AppDesignerFolder>Properties</AppDesignerFolder>
11- <RootNamespace>NMeCab</RootNamespace>
12- <AssemblyName>LibNMeCab</AssemblyName>
13- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
14- <FileAlignment>512</FileAlignment>
15- </PropertyGroup>
16- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17- <DebugSymbols>true</DebugSymbols>
18- <DebugType>full</DebugType>
19- <Optimize>false</Optimize>
20- <OutputPath>bin\Debug\</OutputPath>
21- <DefineConstants>DEBUG;MMF MMF_DIC MMF_MTX EXT</DefineConstants>
22- <ErrorReport>prompt</ErrorReport>
23- <WarningLevel>4</WarningLevel>
24- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
25- </PropertyGroup>
26- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27- <DebugType>pdbonly</DebugType>
28- <Optimize>true</Optimize>
29- <OutputPath>bin\Release\</OutputPath>
30- <DefineConstants>MMF MMF_DIC MMF_MTX</DefineConstants>
31- <ErrorReport>prompt</ErrorReport>
32- <WarningLevel>4</WarningLevel>
33- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
34- </PropertyGroup>
35- <ItemGroup>
36- <Reference Include="System" />
37- </ItemGroup>
38- <ItemGroup>
39- <Compile Include="..\LibNMeCab\Core\BitUtils.cs">
40- <Link>Core\BitUtils.cs</Link>
41- </Compile>
42- <Compile Include="..\LibNMeCab\Core\CharInfo.cs">
43- <Link>Core\CharInfo.cs</Link>
44- </Compile>
45- <Compile Include="..\LibNMeCab\Core\CharProperty.cs">
46- <Link>Core\CharProperty.cs</Link>
47- </Compile>
48- <Compile Include="..\LibNMeCab\Core\Connector.cs">
49- <Link>Core\Connector.cs</Link>
50- </Compile>
51- <Compile Include="..\LibNMeCab\Core\DoubleArray.cs">
52- <Link>Core\DoubleArray.cs</Link>
53- </Compile>
54- <Compile Include="..\LibNMeCab\Core\IniParser.cs">
55- <Link>Core\IniParser.cs</Link>
56- </Compile>
57- <Compile Include="..\LibNMeCab\Core\MeCabDictionary.cs">
58- <Link>Core\MeCabDictionary.cs</Link>
59- </Compile>
60- <Compile Include="..\LibNMeCab\Core\MeCabPath.cs">
61- <Link>Core\MeCabPath.cs</Link>
62- </Compile>
63- <Compile Include="..\LibNMeCab\Core\NBestGenerator.cs">
64- <Link>Core\NBestGenerator.cs</Link>
65- </Compile>
66- <Compile Include="..\LibNMeCab\Core\PriorityQueue.cs">
67- <Link>Core\PriorityQueue.cs</Link>
68- </Compile>
69- <Compile Include="..\LibNMeCab\Core\StrUtils.cs">
70- <Link>Core\StrUtils.cs</Link>
71- </Compile>
72- <Compile Include="..\LibNMeCab\Core\Token.cs">
73- <Link>Core\Token.cs</Link>
74- </Compile>
75- <Compile Include="..\LibNMeCab\Core\Tokenizer.cs">
76- <Link>Core\Tokenizer.cs</Link>
77- </Compile>
78- <Compile Include="..\LibNMeCab\Core\Utils.cs">
79- <Link>Core\Utils.cs</Link>
80- </Compile>
81- <Compile Include="..\LibNMeCab\Core\Viterbi.cs">
82- <Link>Core\Viterbi.cs</Link>
83- </Compile>
84- <Compile Include="..\LibNMeCab\Core\Writer.cs">
85- <Link>Core\Writer.cs</Link>
86- </Compile>
87- <Compile Include="..\LibNMeCab\Extension\FeatureExtension.cs">
88- <Link>Extension\FeatureExtension.cs</Link>
89- </Compile>
90- <Compile Include="..\LibNMeCab\Extension\IpaDic\IpaDicFeatureExtension.cs">
91- <Link>Extension\IpaDic\IpaDicFeatureExtension.cs</Link>
92- </Compile>
93- <Compile Include="..\LibNMeCab\Extension\UniDic\UniDicFeatureExtension.cs">
94- <Link>Extension\UniDic\UniDicFeatureExtension.cs</Link>
95- </Compile>
96- <Compile Include="..\LibNMeCab\MeCabDictionaryType.cs">
97- <Link>MeCabDictionaryType.cs</Link>
98- </Compile>
99- <Compile Include="..\LibNMeCab\MeCabException.cs">
100- <Link>MeCabException.cs</Link>
101- </Compile>
102- <Compile Include="..\LibNMeCab\MeCabFileFormatException.cs">
103- <Link>MeCabFileFormatException.cs</Link>
104- </Compile>
105- <Compile Include="..\LibNMeCab\MeCabInvalidFileException.cs">
106- <Link>MeCabInvalidFileException.cs</Link>
107- </Compile>
108- <Compile Include="..\LibNMeCab\MeCabLatticeLevel.cs">
109- <Link>MeCabLatticeLevel.cs</Link>
110- </Compile>
111- <Compile Include="..\LibNMeCab\MeCabNode.cs">
112- <Link>MeCabNode.cs</Link>
113- </Compile>
114- <Compile Include="..\LibNMeCab\MeCabNodeStat.cs">
115- <Link>MeCabNodeStat.cs</Link>
116- </Compile>
117- <Compile Include="..\LibNMeCab\MeCabParam.cs">
118- <Link>MeCabParam.cs</Link>
119- </Compile>
120- <Compile Include="..\LibNMeCab\MeCabTagger.cs">
121- <Link>MeCabTagger.cs</Link>
122- </Compile>
123- <Compile Include="..\LibNMeCab\Properties\Settings.Designer.cs">
124- <Link>Properties\Settings.Designer.cs</Link>
125- <AutoGen>True</AutoGen>
126- <DesignTimeSharedInput>True</DesignTimeSharedInput>
127- </Compile>
128- <Compile Include="..\LibNMeCab\Properties\SharedAssemblyInfo.cs">
129- <Link>Properties\SharedAssemblyInfo.cs</Link>
130- </Compile>
131- <Compile Include="..\LibNMeCab\Settings.cs">
132- <Link>Settings.cs</Link>
133- </Compile>
134- <Compile Include="Properties\AssemblyInfo.cs" />
135- </ItemGroup>
136- <ItemGroup>
137- <None Include="..\LibNMeCab\Properties\Settings.settings">
138- <Link>Properties\Settings.settings</Link>
139- <Generator>SettingsSingleFileGenerator</Generator>
140- <LastGenOutput>Settings.Designer.cs</LastGenOutput>
141- </None>
142- <None Include="app.config" />
143- </ItemGroup>
144- <ItemGroup />
145- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
146- <PropertyGroup>
147- <PostBuildEvent>copy /y "$(TargetPath)" "$(SolutionDir)..\bin\MMF\"</PostBuildEvent>
148- </PropertyGroup>
149- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
150- Other similar extension points exist, see Microsoft.Common.targets.
151- <Target Name="BeforeBuild">
152- </Target>
153- <Target Name="AfterBuild">
154- </Target>
155- -->
156-</Project>
\ No newline at end of file
--- a/src/LibNMeCabMMF/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
1-using System.Reflection;
2-using System.Runtime.CompilerServices;
3-using System.Runtime.InteropServices;
4-
5-// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
6-// アセンブリに関連付けられている情報を変更するには、
7-// これらの属性値を変更してください。
8-[assembly: AssemblyTitle("LibNMeCab")]
9-[assembly: AssemblyDescription("")]
10-//[assembly: AssemblyConfiguration("")]
11-//[assembly: AssemblyCompany("")]
12-//[assembly: AssemblyProduct("")]
13-//[assembly: AssemblyCopyright("")]
14-//[assembly: AssemblyTrademark("")]
15-//[assembly: AssemblyCulture("")]
16-
17-// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
18-// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
19-// その型の ComVisible 属性を true に設定してください。
20-[assembly: ComVisible(false)]
21-
22-// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です
23-[assembly: Guid("e16f6fba-3cf5-41fa-9002-5b0f91f87e05")]
24-
25-// アセンブリのバージョン情報は、以下の 4 つの値で構成されています:
26-//
27-// Major Version
28-// Minor Version
29-// Build Number
30-// Revision
31-//
32-// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
33-// 既定値にすることができます:
34-// [assembly: AssemblyVersion("1.0.*")]
35-//[assembly: AssemblyVersion("1.0.0.0")]
36-//[assembly: AssemblyFileVersion("1.0.0.0")]
--- a/src/LibNMeCabTest/PriorityQueueTest.cs
+++ b/src/LibNMeCabTest/PriorityQueueTest.cs
@@ -46,10 +46,10 @@ namespace LibNMeCabTest
4646 var collection = new List<Element>();
4747 var count = 0;
4848
49- for (int i = 0; i < 2; i++)
49+ for (int i = 0; i < 5; i++)
5050 {
5151 //追加 優先度昇順
52- for (int j = 0; j < 3; j++)
52+ for (int j = 0; j < 5; j++)
5353 {
5454 var item = new Element { Priority = j, Order = count };
5555 queue.Push(item);
@@ -82,10 +82,10 @@ namespace LibNMeCabTest
8282 var collection = new List<Element>();
8383 var count = 0;
8484
85- for (int i = 0; i < 2; i++)
85+ for (int i = 0; i < 5; i++)
8686 {
8787 //追加 優先度降順
88- for (int j = 3; j >= 0; j--)
88+ for (int j = 5; j >= 0; j--)
8989 {
9090 var item = new Element { Priority = j, Order = count };
9191 queue.Push(item);
--- a/src/PerformanceTestMMF/PerformanceTestMMF.csproj
+++ b/src/PerformanceTestMMF/PerformanceTestMMF.csproj
@@ -34,10 +34,6 @@
3434 <WarningLevel>4</WarningLevel>
3535 </PropertyGroup>
3636 <ItemGroup>
37- <Reference Include="LibNMeCab, Version=0.0.7.0, Culture=neutral, processorArchitecture=MSIL">
38- <SpecificVersion>False</SpecificVersion>
39- <HintPath>..\LibNMeCab40MMF\bin\Release\LibNMeCab.dll</HintPath>
40- </Reference>
4137 <Reference Include="System" />
4238 </ItemGroup>
4339 <ItemGroup>
@@ -69,6 +65,12 @@
6965 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
7066 </Content>
7167 </ItemGroup>
68+ <ItemGroup>
69+ <ProjectReference Include="..\LibNMeCab40MMF\LibNMeCab40MMF.csproj">
70+ <Project>{86711194-4c2b-4853-830f-07c57f035283}</Project>
71+ <Name>LibNMeCab40MMF</Name>
72+ </ProjectReference>
73+ </ItemGroup>
7274 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
7375 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
7476 Other similar extension points exist, see Microsoft.Common.targets.