Smdn.Text.Ondulish version 4.1.0
·
5 commits
to main
since this release
Released package
Release notes
The full release notes are available at gist.
Change log
Change log in this release:
- 2024-02-12 update assembly version
- 2024-02-12 use IgnoreCase comparison instead of ToLower
- 2024-02-12 add target framework net8.0
- 2024-02-12 fix or suppress code analyzer warnings
- 2024-02-12 modify csproj to suppress code analyzer warnings
API changes
API changes in this release:
diff --git a/doc/api-list/Smdn.Text.Ondulish/Smdn.Text.Ondulish-net6.0.apilist.cs b/doc/api-list/Smdn.Text.Ondulish/Smdn.Text.Ondulish-net6.0.apilist.cs
index f70fbf7..259680f 100644
--- a/doc/api-list/Smdn.Text.Ondulish/Smdn.Text.Ondulish-net6.0.apilist.cs
+++ b/doc/api-list/Smdn.Text.Ondulish/Smdn.Text.Ondulish-net6.0.apilist.cs
@@ -1,234 +1,234 @@
-// Smdn.Text.Ondulish.dll (Smdn.Text.Ondulish-4.0.2)
+// Smdn.Text.Ondulish.dll (Smdn.Text.Ondulish-4.1.0)
// Name: Smdn.Text.Ondulish
-// AssemblyVersion: 4.0.2.0
-// InformationalVersion: 4.0.2+7eedf34a0e35f2209f6384d70422e3e8bc328dc1
+// AssemblyVersion: 4.1.0.0
+// InformationalVersion: 4.1.0+20aa8508b133445efe9312740710d77962b09559
// TargetFramework: .NETCoreApp,Version=v6.0
// Configuration: Release
// Referenced assemblies:
// Smdn.Fundamental.Csv, Version=3.1.0.0, Culture=neutral
// Smdn.Fundamental.String.Replacement, Version=3.0.2.0, Culture=neutral
// Smdn.Text.Ondulish.Dictionaries, Version=4.0.0.0, Culture=neutral
// System.Collections, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// System.Linq, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// System.Runtime.InteropServices, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// System.Threading, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
#nullable enable annotations
using System;
using System.Collections.Generic;
using System.IO;
using MeCab;
namespace MeCab {
public class DictionaryInfo : IDisposable {
protected bool swigCMemOwn;
public DictionaryInfo() {}
public string charset { get; }
public string filename { get; }
public uint lsize { get; }
public DictionaryInfo next { get; }
public uint rsize { get; }
public uint size { get; }
public int type { get; }
public ushort version { get; }
protected virtual void Dispose(bool disposing) {}
public void Dispose() {}
~DictionaryInfo() {}
}
public class Lattice : IDisposable {
protected bool swigCMemOwn;
public Lattice() {}
protected virtual void Dispose(bool disposing) {}
public void Dispose() {}
~Lattice() {}
public virtual double Z() {}
public virtual void add_request_type(int request_type) {}
public virtual Node begin_nodes(uint pos) {}
public virtual Node bos_node() {}
public virtual int boundary_constraint(uint pos) {}
public virtual void clear() {}
public virtual Node end_nodes(uint pos) {}
public virtual string enumNBestAsString(uint N) {}
public virtual Node eos_node() {}
public virtual string feature_constraint(uint pos) {}
public virtual bool has_constraint() {}
public virtual bool has_request_type(int request_type) {}
public virtual bool is_available() {}
public virtual Node newNode() {}
public virtual bool next() {}
public virtual void remove_request_type(int request_type) {}
public virtual int request_type() {}
public virtual string sentence() {}
public virtual void set_Z(double Z) {}
public virtual void set_boundary_constraint(uint pos, int boundary_constraint_type) {}
public virtual void set_feature_constraint(uint begin_pos, uint end_pos, string feature) {}
public virtual void set_request_type(int request_type) {}
public virtual void set_result(string result) {}
public void set_sentence(string sentence) {}
public virtual void set_theta(float theta) {}
public virtual void set_what(string str) {}
public virtual uint size() {}
public virtual float theta() {}
public virtual string toString() {}
public virtual string toString(Node node) {}
public virtual string what() {}
}
public class MeCab {
public static readonly int MECAB_ALLOCATE_SENTENCE = 64;
public static readonly int MECAB_ALL_MORPHS = 32;
public static readonly int MECAB_ALTERNATIVE = 16;
public static readonly int MECAB_ANY_BOUNDARY = 0;
public static readonly int MECAB_BOS_NODE = 2;
public static readonly int MECAB_EON_NODE = 4;
public static readonly int MECAB_EOS_NODE = 3;
public static readonly int MECAB_INSIDE_TOKEN = 2;
public static readonly int MECAB_MARGINAL_PROB = 8;
public static readonly int MECAB_NBEST = 2;
public static readonly int MECAB_NOR_NODE = 0;
public static readonly int MECAB_ONE_BEST = 1;
public static readonly int MECAB_PARTIAL = 4;
public static readonly int MECAB_SYS_DIC = 0;
public static readonly int MECAB_TOKEN_BOUNDARY = 1;
public static readonly int MECAB_UNK_DIC = 2;
public static readonly int MECAB_UNK_NODE = 1;
public static readonly int MECAB_USR_DIC = 1;
public static readonly string VERSION = "0.996";
public MeCab() {}
}
public class Model : IDisposable {
public static string version() {}
protected bool swigCMemOwn;
public Model() {}
public Model(string argc) {}
protected virtual void Dispose(bool disposing) {}
public void Dispose() {}
~Model() {}
public virtual Lattice createLattice() {}
public virtual Tagger createTagger() {}
public virtual DictionaryInfo dictionary_info() {}
public virtual Node lookup(string begin, string end, Lattice lattice) {}
public virtual bool swap(Model model) {}
public virtual int transition_cost(ushort rcAttr, ushort lcAttr) {}
}
public class Node : IDisposable {
protected bool swigCMemOwn;
public float alpha { get; }
public float beta { get; }
public Node bnext { get; }
public byte char_type { get; }
public int cost { get; }
public Node enext { get; }
public string feature { get; }
public uint id { get; }
public byte isbest { get; }
public ushort lcAttr { get; }
public ushort length { get; }
public Path lpath { get; }
public Node next { get; }
public ushort posid { get; }
public Node prev { get; }
public float prob { get; set; }
public ushort rcAttr { get; }
public ushort rlength { get; }
public Path rpath { get; }
public byte stat { get; }
public string surface { get; }
public short wcost { get; }
protected virtual void Dispose(bool disposing) {}
public void Dispose() {}
~Node() {}
}
public class Path : IDisposable {
protected bool swigCMemOwn;
public int cost { get; }
public Path lnext { get; }
public Node lnode { get; }
public float prob { get; set; }
public Path rnext { get; }
public Node rnode { get; }
protected virtual void Dispose(bool disposing) {}
public void Dispose() {}
~Path() {}
}
public class Tagger : IDisposable {
public static bool parse(Model model, Lattice lattice) {}
public static string version() {}
protected bool swigCMemOwn;
public Tagger() {}
public Tagger(string argc) {}
protected virtual void Dispose(bool disposing) {}
public void Dispose() {}
~Tagger() {}
public virtual bool all_morphs() {}
public virtual DictionaryInfo dictionary_info() {}
public virtual string formatNode(Node node) {}
public virtual int lattice_level() {}
public virtual string next() {}
public virtual Node nextNode() {}
public virtual bool parse(Lattice lattice) {}
public virtual string parse(string str) {}
public virtual string parseNBest(uint N, string str) {}
public virtual bool parseNBestInit(string str) {}
public virtual Node parseToNode(string str) {}
public string parseToString(string str) {}
public string parseToString(string str, uint length) {}
public virtual bool partial() {}
public virtual int request_type() {}
public virtual void set_all_morphs(bool all_morphs) {}
public virtual void set_lattice_level(int level) {}
public virtual void set_partial(bool @partial) {}
public virtual void set_request_type(int request_type) {}
public virtual void set_theta(float theta) {}
public virtual float theta() {}
public virtual string what() {}
}
}
namespace Smdn.Text.Ondulish {
public static class KanaUtils {
public static string ConvertWideHiraganaToKatakana(string input) {}
public static string ConvertWideKatakanaToHiragana(string input) {}
public static string ConvertWideKatakanaToNarrowKatakana(string input) {}
}
public class Translator : IDisposable {
public static Tagger CreateTaggerForBundledDictionary() {}
public Translator() {}
public Translator(Tagger tagger, bool shouldDisposeTagger) {}
public IReadOnlyDictionary<string, string> PhraseDictionary { get; }
public IReadOnlyDictionary<string, string> WordDictionary { get; }
protected virtual void Dispose(bool disposing) {}
public void Dispose() {}
public string Translate(string input, bool convertKatakanaToNarrow = true) {}
public void Translate(TextReader input, TextWriter output, bool convertKatakanaToNarrow = true) {}
public void Translate(string input, TextWriter output, bool convertKatakanaToNarrow = true) {}
}
}
-// API list generated by Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks v1.2.1.0.
-// Smdn.Reflection.ReverseGenerating.ListApi.Core v1.2.0.0 (https://github.com/smdn/Smdn.Reflection.ReverseGenerating)
+// API list generated by Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks v1.4.0.0.
+// Smdn.Reflection.ReverseGenerating.ListApi.Core v1.3.0.0 (https://github.com/smdn/Smdn.Reflection.ReverseGenerating)
diff --git a/doc/api-list/Smdn.Text.Ondulish/Smdn.Text.Ondulish-net8.0.apilist.cs b/doc/api-list/Smdn.Text.Ondulish/Smdn.Text.Ondulish-net8.0.apilist.cs
new file mode 100644
index 0000000..f46cb72
--- /dev/null
+++ b/doc/api-list/Smdn.Text.Ondulish/Smdn.Text.Ondulish-net8.0.apilist.cs
@@ -0,0 +1,234 @@
+// Smdn.Text.Ondulish.dll (Smdn.Text.Ondulish-4.1.0)
+// Name: Smdn.Text.Ondulish
+// AssemblyVersion: 4.1.0.0
+// InformationalVersion: 4.1.0+20aa8508b133445efe9312740710d77962b09559
+// TargetFramework: .NETCoreApp,Version=v8.0
+// Configuration: Release
+// Referenced assemblies:
+// Smdn.Fundamental.Csv, Version=3.1.0.0, Culture=neutral
+// Smdn.Fundamental.String.Replacement, Version=3.0.2.0, Culture=neutral
+// Smdn.Text.Ondulish.Dictionaries, Version=4.0.0.0, Culture=neutral
+// System.Collections, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+// System.Linq, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+// System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+// System.Runtime.InteropServices, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+// System.Threading, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+#nullable enable annotations
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using MeCab;
+
+namespace MeCab {
+ public class DictionaryInfo : IDisposable {
+ protected bool swigCMemOwn;
+
+ public DictionaryInfo() {}
+
+ public string charset { get; }
+ public string filename { get; }
+ public uint lsize { get; }
+ public DictionaryInfo next { get; }
+ public uint rsize { get; }
+ public uint size { get; }
+ public int type { get; }
+ public ushort version { get; }
+
+ protected virtual void Dispose(bool disposing) {}
+ public void Dispose() {}
+ ~DictionaryInfo() {}
+ }
+
+ public class Lattice : IDisposable {
+ protected bool swigCMemOwn;
+
+ public Lattice() {}
+
+ protected virtual void Dispose(bool disposing) {}
+ public void Dispose() {}
+ ~Lattice() {}
+ public virtual double Z() {}
+ public virtual void add_request_type(int request_type) {}
+ public virtual Node begin_nodes(uint pos) {}
+ public virtual Node bos_node() {}
+ public virtual int boundary_constraint(uint pos) {}
+ public virtual void clear() {}
+ public virtual Node end_nodes(uint pos) {}
+ public virtual string enumNBestAsString(uint N) {}
+ public virtual Node eos_node() {}
+ public virtual string feature_constraint(uint pos) {}
+ public virtual bool has_constraint() {}
+ public virtual bool has_request_type(int request_type) {}
+ public virtual bool is_available() {}
+ public virtual Node newNode() {}
+ public virtual bool next() {}
+ public virtual void remove_request_type(int request_type) {}
+ public virtual int request_type() {}
+ public virtual string sentence() {}
+ public virtual void set_Z(double Z) {}
+ public virtual void set_boundary_constraint(uint pos, int boundary_constraint_type) {}
+ public virtual void set_feature_constraint(uint begin_pos, uint end_pos, string feature) {}
+ public virtual void set_request_type(int request_type) {}
+ public virtual void set_result(string result) {}
+ public void set_sentence(string sentence) {}
+ public virtual void set_theta(float theta) {}
+ public virtual void set_what(string str) {}
+ public virtual uint size() {}
+ public virtual float theta() {}
+ public virtual string toString() {}
+ public virtual string toString(Node node) {}
+ public virtual string what() {}
+ }
+
+ public class MeCab {
+ public static readonly int MECAB_ALLOCATE_SENTENCE = 64;
+ public static readonly int MECAB_ALL_MORPHS = 32;
+ public static readonly int MECAB_ALTERNATIVE = 16;
+ public static readonly int MECAB_ANY_BOUNDARY = 0;
+ public static readonly int MECAB_BOS_NODE = 2;
+ public static readonly int MECAB_EON_NODE = 4;
+ public static readonly int MECAB_EOS_NODE = 3;
+ public static readonly int MECAB_INSIDE_TOKEN = 2;
+ public static readonly int MECAB_MARGINAL_PROB = 8;
+ public static readonly int MECAB_NBEST = 2;
+ public static readonly int MECAB_NOR_NODE = 0;
+ public static readonly int MECAB_ONE_BEST = 1;
+ public static readonly int MECAB_PARTIAL = 4;
+ public static readonly int MECAB_SYS_DIC = 0;
+ public static readonly int MECAB_TOKEN_BOUNDARY = 1;
+ public static readonly int MECAB_UNK_DIC = 2;
+ public static readonly int MECAB_UNK_NODE = 1;
+ public static readonly int MECAB_USR_DIC = 1;
+ public static readonly string VERSION = "0.996";
+
+ public MeCab() {}
+ }
+
+ public class Model : IDisposable {
+ public static string version() {}
+
+ protected bool swigCMemOwn;
+
+ public Model() {}
+ public Model(string argc) {}
+
+ protected virtual void Dispose(bool disposing) {}
+ public void Dispose() {}
+ ~Model() {}
+ public virtual Lattice createLattice() {}
+ public virtual Tagger createTagger() {}
+ public virtual DictionaryInfo dictionary_info() {}
+ public virtual Node lookup(string begin, string end, Lattice lattice) {}
+ public virtual bool swap(Model model) {}
+ public virtual int transition_cost(ushort rcAttr, ushort lcAttr) {}
+ }
+
+ public class Node : IDisposable {
+ protected bool swigCMemOwn;
+
+ public float alpha { get; }
+ public float beta { get; }
+ public Node bnext { get; }
+ public byte char_type { get; }
+ public int cost { get; }
+ public Node enext { get; }
+ public string feature { get; }
+ public uint id { get; }
+ public byte isbest { get; }
+ public ushort lcAttr { get; }
+ public ushort length { get; }
+ public Path lpath { get; }
+ public Node next { get; }
+ public ushort posid { get; }
+ public Node prev { get; }
+ public float prob { get; set; }
+ public ushort rcAttr { get; }
+ public ushort rlength { get; }
+ public Path rpath { get; }
+ public byte stat { get; }
+ public string surface { get; }
+ public short wcost { get; }
+
+ protected virtual void Dispose(bool disposing) {}
+ public void Dispose() {}
+ ~Node() {}
+ }
+
+ public class Path : IDisposable {
+ protected bool swigCMemOwn;
+
+ public int cost { get; }
+ public Path lnext { get; }
+ public Node lnode { get; }
+ public float prob { get; set; }
+ public Path rnext { get; }
+ public Node rnode { get; }
+
+ protected virtual void Dispose(bool disposing) {}
+ public void Dispose() {}
+ ~Path() {}
+ }
+
+ public class Tagger : IDisposable {
+ public static bool parse(Model model, Lattice lattice) {}
+ public static string version() {}
+
+ protected bool swigCMemOwn;
+
+ public Tagger() {}
+ public Tagger(string argc) {}
+
+ protected virtual void Dispose(bool disposing) {}
+ public void Dispose() {}
+ ~Tagger() {}
+ public virtual bool all_morphs() {}
+ public virtual DictionaryInfo dictionary_info() {}
+ public virtual string formatNode(Node node) {}
+ public virtual int lattice_level() {}
+ public virtual string next() {}
+ public virtual Node nextNode() {}
+ public virtual bool parse(Lattice lattice) {}
+ public virtual string parse(string str) {}
+ public virtual string parseNBest(uint N, string str) {}
+ public virtual bool parseNBestInit(string str) {}
+ public virtual Node parseToNode(string str) {}
+ public string parseToString(string str) {}
+ public string parseToString(string str, uint length) {}
+ public virtual bool partial() {}
+ public virtual int request_type() {}
+ public virtual void set_all_morphs(bool all_morphs) {}
+ public virtual void set_lattice_level(int level) {}
+ public virtual void set_partial(bool @partial) {}
+ public virtual void set_request_type(int request_type) {}
+ public virtual void set_theta(float theta) {}
+ public virtual float theta() {}
+ public virtual string what() {}
+ }
+}
+
+namespace Smdn.Text.Ondulish {
+ public static class KanaUtils {
+ public static string ConvertWideHiraganaToKatakana(string input) {}
+ public static string ConvertWideKatakanaToHiragana(string input) {}
+ public static string ConvertWideKatakanaToNarrowKatakana(string input) {}
+ }
+
+ public class Translator : IDisposable {
+ public static Tagger CreateTaggerForBundledDictionary() {}
+
+ public Translator() {}
+ public Translator(Tagger tagger, bool shouldDisposeTagger) {}
+
+ public IReadOnlyDictionary<string, string> PhraseDictionary { get; }
+ public IReadOnlyDictionary<string, string> WordDictionary { get; }
+
+ protected virtual void Dispose(bool disposing) {}
+ public void Dispose() {}
+ public string Translate(string input, bool convertKatakanaToNarrow = true) {}
+ public void Translate(TextReader input, TextWriter output, bool convertKatakanaToNarrow = true) {}
+ public void Translate(string input, TextWriter output, bool convertKatakanaToNarrow = true) {}
+ }
+}
+// API list generated by Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks v1.4.0.0.
+// Smdn.Reflection.ReverseGenerating.ListApi.Core v1.3.0.0 (https://github.com/smdn/Smdn.Reflection.ReverseGenerating)
diff --git a/doc/api-list/Smdn.Text.Ondulish/Smdn.Text.Ondulish-netstandard2.1.apilist.cs b/doc/api-list/Smdn.Text.Ondulish/Smdn.Text.Ondulish-netstandard2.1.apilist.cs
index 54385e1..37bee07 100644
--- a/doc/api-list/Smdn.Text.Ondulish/Smdn.Text.Ondulish-netstandard2.1.apilist.cs
+++ b/doc/api-list/Smdn.Text.Ondulish/Smdn.Text.Ondulish-netstandard2.1.apilist.cs
@@ -1,230 +1,230 @@
-// Smdn.Text.Ondulish.dll (Smdn.Text.Ondulish-4.0.2)
+// Smdn.Text.Ondulish.dll (Smdn.Text.Ondulish-4.1.0)
// Name: Smdn.Text.Ondulish
-// AssemblyVersion: 4.0.2.0
-// InformationalVersion: 4.0.2+7eedf34a0e35f2209f6384d70422e3e8bc328dc1
+// AssemblyVersion: 4.1.0.0
+// InformationalVersion: 4.1.0+20aa8508b133445efe9312740710d77962b09559
// TargetFramework: .NETStandard,Version=v2.1
// Configuration: Release
// Referenced assemblies:
// Smdn.Fundamental.Csv, Version=3.1.0.0, Culture=neutral
// Smdn.Fundamental.String.Replacement, Version=3.0.2.0, Culture=neutral
// Smdn.Text.Ondulish.Dictionaries, Version=4.0.0.0, Culture=neutral
// netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
#nullable enable annotations
using System;
using System.Collections.Generic;
using System.IO;
using MeCab;
namespace MeCab {
public class DictionaryInfo : IDisposable {
protected bool swigCMemOwn;
public DictionaryInfo() {}
public string charset { get; }
public string filename { get; }
public uint lsize { get; }
public DictionaryInfo next { get; }
public uint rsize { get; }
public uint size { get; }
public int type { get; }
public ushort version { get; }
protected virtual void Dispose(bool disposing) {}
public void Dispose() {}
~DictionaryInfo() {}
}
public class Lattice : IDisposable {
protected bool swigCMemOwn;
public Lattice() {}
protected virtual void Dispose(bool disposing) {}
public void Dispose() {}
~Lattice() {}
public virtual double Z() {}
public virtual void add_request_type(int request_type) {}
public virtual Node begin_nodes(uint pos) {}
public virtual Node bos_node() {}
public virtual int boundary_constraint(uint pos) {}
public virtual void clear() {}
public virtual Node end_nodes(uint pos) {}
public virtual string enumNBestAsString(uint N) {}
public virtual Node eos_node() {}
public virtual string feature_constraint(uint pos) {}
public virtual bool has_constraint() {}
public virtual bool has_request_type(int request_type) {}
public virtual bool is_available() {}
public virtual Node newNode() {}
public virtual bool next() {}
public virtual void remove_request_type(int request_type) {}
public virtual int request_type() {}
public virtual string sentence() {}
public virtual void set_Z(double Z) {}
public virtual void set_boundary_constraint(uint pos, int boundary_constraint_type) {}
public virtual void set_feature_constraint(uint begin_pos, uint end_pos, string feature) {}
public virtual void set_request_type(int request_type) {}
public virtual void set_result(string result) {}
public void set_sentence(string sentence) {}
public virtual void set_theta(float theta) {}
public virtual void set_what(string str) {}
public virtual uint size() {}
public virtual float theta() {}
public virtual string toString() {}
public virtual string toString(Node node) {}
public virtual string what() {}
}
public class MeCab {
public static readonly int MECAB_ALLOCATE_SENTENCE = 64;
public static readonly int MECAB_ALL_MORPHS = 32;
public static readonly int MECAB_ALTERNATIVE = 16;
public static readonly int MECAB_ANY_BOUNDARY = 0;
public static readonly int MECAB_BOS_NODE = 2;
public static readonly int MECAB_EON_NODE = 4;
public static readonly int MECAB_EOS_NODE = 3;
public static readonly int MECAB_INSIDE_TOKEN = 2;
public static readonly int MECAB_MARGINAL_PROB = 8;
public static readonly int MECAB_NBEST = 2;
public static readonly int MECAB_NOR_NODE = 0;
public static readonly int MECAB_ONE_BEST = 1;
public static readonly int MECAB_PARTIAL = 4;
public static readonly int MECAB_SYS_DIC = 0;
public static readonly int MECAB_TOKEN_BOUNDARY = 1;
public static readonly int MECAB_UNK_DIC = 2;
public static readonly int MECAB_UNK_NODE = 1;
public static readonly int MECAB_USR_DIC = 1;
public static readonly string VERSION = "0.996";
public MeCab() {}
}
public class Model : IDisposable {
public static string version() {}
protected bool swigCMemOwn;
public Model() {}
public Model(string argc) {}
protected virtual void Dispose(bool disposing) {}
public void Dispose() {}
~Model() {}
public virtual Lattice createLattice() {}
public virtual Tagger createTagger() {}
public virtual DictionaryInfo dictionary_info() {}
public virtual Node lookup(string begin, string end, Lattice lattice) {}
public virtual bool swap(Model model) {}
public virtual int transition_cost(ushort rcAttr, ushort lcAttr) {}
}
public class Node : IDisposable {
protected bool swigCMemOwn;
public float alpha { get; }
public float beta { get; }
public Node bnext { get; }
public byte char_type { get; }
public int cost { get; }
public Node enext { get; }
public string feature { get; }
public uint id { get; }
public byte isbest { get; }
public ushort lcAttr { get; }
public ushort length { get; }
public Path lpath { get; }
public Node next { get; }
public ushort posid { get; }
public Node prev { get; }
public float prob { get; set; }
public ushort rcAttr { get; }
public ushort rlength { get; }
public Path rpath { get; }
public byte stat { get; }
public string surface { get; }
public short wcost { get; }
protected virtual void Dispose(bool disposing) {}
public void Dispose() {}
~Node() {}
}
public class Path : IDisposable {
protected bool swigCMemOwn;
public int cost { get; }
public Path lnext { get; }
public Node lnode { get; }
public float prob { get; set; }
public Path rnext { get; }
public Node rnode { get; }
protected virtual void Dispose(bool disposing) {}
public void Dispose() {}
~Path() {}
}
public class Tagger : IDisposable {
public static bool parse(Model model, Lattice lattice) {}
public static string version() {}
protected bool swigCMemOwn;
public Tagger() {}
public Tagger(string argc) {}
protected virtual void Dispose(bool disposing) {}
public void Dispose() {}
~Tagger() {}
public virtual bool all_morphs() {}
public virtual DictionaryInfo dictionary_info() {}
public virtual string formatNode(Node node) {}
public virtual int lattice_level() {}
public virtual string next() {}
public virtual Node nextNode() {}
public virtual bool parse(Lattice lattice) {}
public virtual string parse(string str) {}
public virtual string parseNBest(uint N, string str) {}
public virtual bool parseNBestInit(string str) {}
public virtual Node parseToNode(string str) {}
public string parseToString(string str) {}
public string parseToString(string str, uint length) {}
public virtual bool partial() {}
public virtual int request_type() {}
public virtual void set_all_morphs(bool all_morphs) {}
public virtual void set_lattice_level(int level) {}
public virtual void set_partial(bool @partial) {}
public virtual void set_request_type(int request_type) {}
public virtual void set_theta(float theta) {}
public virtual float theta() {}
public virtual string what() {}
}
}
namespace Smdn.Text.Ondulish {
public static class KanaUtils {
public static string ConvertWideHiraganaToKatakana(string input) {}
public static string ConvertWideKatakanaToHiragana(string input) {}
public static string ConvertWideKatakanaToNarrowKatakana(string input) {}
}
public class Translator : IDisposable {
public static Tagger CreateTaggerForBundledDictionary() {}
public Translator() {}
public Translator(Tagger tagger, bool shouldDisposeTagger) {}
public IReadOnlyDictionary<string, string> PhraseDictionary { get; }
public IReadOnlyDictionary<string, string> WordDictionary { get; }
protected virtual void Dispose(bool disposing) {}
public void Dispose() {}
public string Translate(string input, bool convertKatakanaToNarrow = true) {}
public void Translate(TextReader input, TextWriter output, bool convertKatakanaToNarrow = true) {}
public void Translate(string input, TextWriter output, bool convertKatakanaToNarrow = true) {}
}
}
-// API list generated by Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks v1.2.1.0.
-// Smdn.Reflection.ReverseGenerating.ListApi.Core v1.2.0.0 (https://github.com/smdn/Smdn.Reflection.ReverseGenerating)
+// API list generated by Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks v1.4.0.0.
+// Smdn.Reflection.ReverseGenerating.ListApi.Core v1.3.0.0 (https://github.com/smdn/Smdn.Reflection.ReverseGenerating)
Full changes
Full changes in this release:
diff --git a/src/Smdn.Text.Ondulish/Smdn.Text.Ondulish.csproj b/src/Smdn.Text.Ondulish/Smdn.Text.Ondulish.csproj
index d200f7a..ffd3a95 100644
--- a/src/Smdn.Text.Ondulish/Smdn.Text.Ondulish.csproj
+++ b/src/Smdn.Text.Ondulish/Smdn.Text.Ondulish.csproj
@@ -4,11 +4,19 @@ SPDX-License-Identifier: MIT
-->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFrameworks>net6.0;netstandard2.1</TargetFrameworks>
- <RuntimeIdentifiers>ubuntu.22.04-x64</RuntimeIdentifiers>
- <VersionPrefix>4.0.2</VersionPrefix>
+ <TargetFrameworks>net8.0;net6.0;netstandard2.1</TargetFrameworks>
+ <RuntimeIdentifiers>linux-x64</RuntimeIdentifiers>
+ <RuntimeIdentifiers Condition="
+ $(TargetFramework.StartsWith('net7')) or
+ $(TargetFramework.StartsWith('net6')) or
+ $(TargetFramework.StartsWith('net5')) or
+ $(TargetFramework.StartsWith('netstandard'))
+ ">linux-x64;ubuntu.22.04-x64</RuntimeIdentifiers>
+ <VersionPrefix>4.1.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<PackageValidationBaselineVersion>4.0.0</PackageValidationBaselineVersion>
+ <RootNamespace/> <!-- empty the root namespace so that the namespace is determined only by the directory name, for code style rule IDE0030 -->
+ <NoWarn>CS1591;$(NoWarn)</NoWarn> <!-- CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member' -->
<Nullable>enable</Nullable>
<AssemblyCLSCompliant>false</AssemblyCLSCompliant>
<GenerateNupkgReadmeFileDependsOnTargets>$(GenerateNupkgReadmeFileDependsOnTargets);GenerateReadmeFileContent</GenerateNupkgReadmeFileDependsOnTargets>
@@ -56,13 +64,20 @@ SPDX-License-Identifier: MIT
<Compile Include="$(MeCabBindingsDirectory)src\*.cs" />
-->
- <!-- MeCab shared library -->
+ <!-- MeCab shared library for ubuntu.22.04-x64 -->
<None
Include="$(MeCabBindingsDirectory)runtimes\ubuntu.22.04-x64\native\libmecab.so"
Pack="true"
PackagePath="runtimes\ubuntu.22.04-x64\native\libmecab.so"
CopyToOutputDirectory="PreserveNewest"
/>
+ <!-- MeCab shared library for linux-x64 (substitute ubuntu.22.04-x64 for linux-x64) -->
+ <None
+ Include="$(MeCabBindingsDirectory)runtimes\ubuntu.22.04-x64\native\libmecab.so"
+ Pack="true"
+ PackagePath="runtimes\linux-x64\native\libmecab.so"
+ CopyToOutputDirectory="PreserveNewest"
+ />
<!-- MeCab IPA dictionary files -->
<Content Include="$(MeCabIpaDicDirectory)char.bin" />
diff --git a/src/Smdn.Text.Ondulish/Smdn.Text.Ondulish/Translator.Dictionaries.cs b/src/Smdn.Text.Ondulish/Smdn.Text.Ondulish/Translator.Dictionaries.cs
index 638926a..9b9612b 100644
--- a/src/Smdn.Text.Ondulish/Smdn.Text.Ondulish/Translator.Dictionaries.cs
+++ b/src/Smdn.Text.Ondulish/Smdn.Text.Ondulish/Translator.Dictionaries.cs
@@ -24,12 +24,12 @@ partial class Translator {
y ??= string.Empty;
return x.Length == y.Length
- ? StringComparer.Ordinal.Compare(x, y)
+ ? StringComparer.OrdinalIgnoreCase.Compare(x, y)
: y.Length - x.Length;
}
}
- private static readonly char[] dictionaryPunctuationChars = new[] { '!', '?', '!', '?', '、', '。' };
+ private static readonly char[] DictionaryPunctuationChars = new[] { '!', '?', '!', '?', '、', '。' };
private static SortedList<string, string> LoadDictionary(Stream stream)
{
@@ -46,7 +46,7 @@ partial class Translator {
if (entry.StartsWith('#'))
continue; // comment line
- var key = entries[1].Trim().RemoveChars(dictionaryPunctuationChars);
+ var key = entries[1].Trim().RemoveChars(DictionaryPunctuationChars);
dictionary[KanaUtils.ConvertWideHiraganaToKatakana(key).ToLowerInvariant()] = entries[2].Trim().ToLowerInvariant();
}
@@ -54,7 +54,7 @@ partial class Translator {
return dictionary;
}
- private static readonly IReadOnlyDictionary<string, string> phonemeDictionary =
+ private static readonly IReadOnlyDictionary<string, string> PhonemeDictionary =
new ReadOnlyOrderedDictionary<string, string>(
new[] {
// 最優先
diff --git a/src/Smdn.Text.Ondulish/Smdn.Text.Ondulish/Translator.cs b/src/Smdn.Text.Ondulish/Smdn.Text.Ondulish/Translator.cs
index 7c017b6..cc0c62b 100644
--- a/src/Smdn.Text.Ondulish/Smdn.Text.Ondulish/Translator.cs
+++ b/src/Smdn.Text.Ondulish/Smdn.Text.Ondulish/Translator.cs
@@ -67,20 +67,24 @@ public partial class Translator : IDisposable {
PhraseDictionary = LoadDictionary(stream);
}
+#pragma warning disable CA1031
catch {
- // ignore exceptions
+ // ignore any exceptions
PhraseDictionary = CreateEmptyDictionary();
}
+#pragma warning restore CA1031
try {
using var stream = OndulishDictionaries.OpenWordDictionaryStream();
WordDictionary = LoadDictionary(stream);
}
+#pragma warning disable CA1031
catch {
- // ignore exceptions
+ // ignore any exceptions
WordDictionary = CreateEmptyDictionary();
}
+#pragma warning restore CA1031
static IReadOnlyDictionary<string, string> CreateEmptyDictionary()
=> Enumerable.Empty<(string Key, string Value)>().ToDictionary(static pair => pair.Key, static pair => pair.Value);
@@ -114,10 +118,11 @@ public partial class Translator : IDisposable {
return string.Empty;
var sb = new StringBuilder(input.Length * 2);
+ using var writer = new StringWriter(sb);
Translate(
input: new StringReader(input),
- output: new StringWriter(sb),
+ output: writer,
convertKatakanaToNarrow: convertKatakanaToNarrow
);
@@ -163,17 +168,18 @@ public partial class Translator : IDisposable {
var fragments =
ConvertWithDictionary(
- ConvertToKatakana(line).ToLowerInvariant(),
- PhraseDictionary
+ ConvertToKatakana(line),
+ PhraseDictionary,
+ StringComparison.OrdinalIgnoreCase
)
.SelectMany(f =>
f.ConvertedText is null
- ? ConvertWithDictionary(f.SourceText, WordDictionary)
+ ? ConvertWithDictionary(f.SourceText, WordDictionary, StringComparison.OrdinalIgnoreCase)
: Enumerable.Repeat(f, 1)
)
.SelectMany(f =>
f.ConvertedText is null
- ? ConvertWithDictionary(f.SourceText, phonemeDictionary)
+ ? ConvertWithDictionary(f.SourceText, PhonemeDictionary, StringComparison.OrdinalIgnoreCase)
: Enumerable.Repeat(f, 1)
)
.Select(static f =>
@@ -202,11 +208,17 @@ public partial class Translator : IDisposable {
output.Flush();
}
- private static readonly char[] featureSplitter = new[] { ',' };
+ private static readonly char[] FeatureSplitter = { ',' };
private string ConvertToKatakana(string input)
{
- input = input.Replace(",", ","); // XXX: feature splitter
+ // XXX: feature splitter
+ input = input
+#if SYSTEM_STRING_REPLACE_STRING_STRING_STRINGCOMPARISON
+ .Replace(",", ",", StringComparison.Ordinal);
+#else
+ .Replace(",", ",");
+#endif
var ret = new StringBuilder(input.Length * 2);
@@ -214,7 +226,7 @@ public partial class Translator : IDisposable {
if (node.stat == MeCabConsts.MECAB_BOS_NODE || node.stat == MeCabConsts.MECAB_EOS_NODE)
continue;
- var featureEntries = node.feature.Split(featureSplitter);
+ var featureEntries = node.feature.Split(FeatureSplitter);
if (8 <= featureEntries.Length) {
switch (featureEntries[6]) {
@@ -245,6 +257,7 @@ public partial class Translator : IDisposable {
string input,
int startIndex,
IReadOnlyDictionary<string, string> dictionary,
+ StringComparison comparison,
out int position,
out KeyValuePair<string, string> candidate
)
@@ -253,7 +266,7 @@ public partial class Translator : IDisposable {
candidate = default;
foreach (var entry in dictionary) {
- var pos = input.IndexOf(entry.Key, startIndex, StringComparison.Ordinal);
+ var pos = input.IndexOf(entry.Key, startIndex, comparison);
if (0 <= pos && pos < position) {
position = pos;
@@ -266,12 +279,13 @@ public partial class Translator : IDisposable {
private static IEnumerable<TextFragment> ConvertWithDictionary(
string input,
- IReadOnlyDictionary<string, string> dictionary
+ IReadOnlyDictionary<string, string> dictionary,
+ StringComparison comparison
)
{
var offset = 0;
- while (FindMostLeftAndLongestCandidate(input, offset, dictionary, out var position, out var candidate)) {
+ while (FindMostLeftAndLongestCandidate(input, offset, dictionary, comparison, out var position, out var candidate)) {
if (offset < position)
yield return new TextFragment(input.Substring(offset, position - offset), null);
Notes
Full Changelog: releases/Smdn.Text.Ondulish-4.0.2...releases/Smdn.Text.Ondulish-4.1.0