diff --git a/UnicodeCharacterInspector/CharacterInfoViewModel.cs b/UnicodeCharacterInspector/CharacterInfoViewModel.cs
index 5122c89..8b2b684 100644
--- a/UnicodeCharacterInspector/CharacterInfoViewModel.cs
+++ b/UnicodeCharacterInspector/CharacterInfoViewModel.cs
@@ -53,6 +53,7 @@ namespace UnicodeCharacterInspector
UpdateDisplayText();
NotifyPropertyChanged(nameof(CodePoint));
NotifyPropertyChanged(nameof(Name));
+ NotifyPropertyChanged(nameof(NameAliases));
NotifyPropertyChanged(nameof(OldName));
NotifyPropertyChanged(nameof(Definition));
NotifyPropertyChanged(nameof(Category));
@@ -101,6 +102,11 @@ namespace UnicodeCharacterInspector
get { return character != null ? characterInfo.Name : null; }
}
+ public UnicodeNameAliasCollection NameAliases
+ {
+ get { return characterInfo.NameAliases; }
+ }
+
public string OldName
{
get { return character != null ? characterInfo.OldName : null; }
diff --git a/UnicodeCharacterInspector/MainWindow.xaml b/UnicodeCharacterInspector/MainWindow.xaml
index cfb500d..e24541b 100644
--- a/UnicodeCharacterInspector/MainWindow.xaml
+++ b/UnicodeCharacterInspector/MainWindow.xaml
@@ -82,6 +82,7 @@
+
@@ -90,46 +91,54 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/UnicodeInformation.Builder/UnicodeDataProcessor.cs b/UnicodeInformation.Builder/UnicodeDataProcessor.cs
index d526619..5571c79 100644
--- a/UnicodeInformation.Builder/UnicodeDataProcessor.cs
+++ b/UnicodeInformation.Builder/UnicodeDataProcessor.cs
@@ -13,6 +13,7 @@ namespace System.Unicode.Builder
public const string UnicodeDataFileName = "UnicodeData.txt";
public const string PropListFileName = "PropList.txt";
public const string DerivedCorePropertiesFileName = "DerivedCoreProperties.txt";
+ public const string NameAliasesFileName = "NameAliases.txt";
public const string BlocksFileName = "Blocks.txt";
public const string UnihanReadingsFileName = "Unihan_Readings.txt";
public const string UnihanVariantsFileName = "Unihan_Variants.txt";
@@ -37,6 +38,7 @@ namespace System.Unicode.Builder
await ProcessUnicodeDataFile(ucdSource, builder).ConfigureAwait(false);
await ProcessPropListFile(ucdSource, builder).ConfigureAwait(false);
await ProcessDerivedCorePropertiesFile(ucdSource, builder).ConfigureAwait(false);
+ await ProcessNameAliasesFile(ucdSource, builder).ConfigureAwait(false);
await ProcessBlocksFile(ucdSource, builder).ConfigureAwait(false);
await ProcessUnihanReadings(unihanSource, builder).ConfigureAwait(false);
await ProcessUnihanVariants(unihanSource, builder).ConfigureAwait(false);
@@ -196,6 +198,26 @@ namespace System.Unicode.Builder
}
}
+ private static async Task ProcessNameAliasesFile(IDataSource ucdSource, UnicodeInfoBuilder builder)
+ {
+ using (var reader = new UnicodeDataFileReader(await ucdSource.OpenDataFileAsync(NameAliasesFileName).ConfigureAwait(false), ';'))
+ {
+ while (reader.MoveToNextLine())
+ {
+ var ucd = builder.GetUcd(int.Parse(reader.ReadField(), NumberStyles.HexNumber));
+
+ string name = reader.ReadField();
+ string kindName = reader.ReadField();
+ UnicodeNameAliasKind kind;
+
+ if (!EnumHelper.TryGetNamedValue(kindName, out kind))
+ throw new InvalidDataException("Unrecognized name alias: " + kindName + ".3");
+
+ ucd.NameAliases.Add(new UnicodeNameAlias(name, kind));
+ }
+ }
+ }
+
private static async Task ProcessBlocksFile(IDataSource ucdSource, UnicodeInfoBuilder builder)
{
using (var reader = new UnicodeDataFileReader(await ucdSource.OpenDataFileAsync(BlocksFileName).ConfigureAwait(false), ';'))
diff --git a/UnicodeInformation/UnicodeNameAliasKind.cs b/UnicodeInformation/UnicodeNameAliasKind.cs
index 6a0c9e9..bd5568b 100644
--- a/UnicodeInformation/UnicodeNameAliasKind.cs
+++ b/UnicodeInformation/UnicodeNameAliasKind.cs
@@ -2,10 +2,15 @@
{
public enum UnicodeNameAliasKind : byte
{
+ [ValueName("correction")]
Correction = 1,
+ [ValueName("control")]
Control = 2,
+ [ValueName("alternate")]
Alternate = 3,
+ [ValueName("figment")]
Figment = 4,
+ [ValueName("abbreviation")]
Abbreviation = 5
}
}