-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added WanaKanaOptions class, further project structuring
- Loading branch information
1 parent
e30b0bc
commit 6e709c5
Showing
10 changed files
with
133 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Hiragana/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Kana/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Katakana/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Romaji/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Romanization/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Wana/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace WanaKanaNet.Checkers | ||
{ | ||
internal static class HiraganaChecker | ||
{ | ||
public static bool IsHiragana(string input) | ||
{ | ||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace WanaKanaNet.Enums | ||
{ | ||
/// <summary> | ||
/// Represents available IME modes. | ||
/// </summary> | ||
public enum ImeMode | ||
{ | ||
None, | ||
Enabled, | ||
ToHiragana, | ||
ToKatakana | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace WanaKanaNet.Enums | ||
{ | ||
/// <summary> | ||
/// Choice of romanization maps. | ||
/// </summary> | ||
public enum RomanizationMap | ||
{ | ||
Hepburn, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
using System.Runtime.CompilerServices; | ||
|
||
[assembly:InternalsVisibleTo("WanaKanaNet.Tests")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using WanaKanaNet.Enums; | ||
|
||
namespace WanaKanaNet | ||
{ | ||
/// <summary> | ||
/// Represents conversion configuration options for WanaKana. | ||
/// </summary> | ||
public class WanaKanaOptions | ||
{ | ||
/// <summary> | ||
/// Set to true to use obsolete characters, such as ゐ and ゑ. | ||
/// <example> | ||
/// ToHiragana('we', new WanaKanaOptions { UseObsoleteKana = true }) => 'ゑ' | ||
/// </example> | ||
/// </summary> | ||
public bool UseObsoleteKana { get; set; } = false; | ||
|
||
/// <summary> | ||
/// Set to true to pass romaji when using mixed syllables with ToKatakana() or ToHiragana(). | ||
/// <example> | ||
/// ToHiragana('we', new WanaKanaOptions { PassRomaji = true }) => => "only convert the katakana: ひらがな" | ||
/// </example> | ||
/// </summary> | ||
public bool PassRomaji { get; set; } = false; | ||
|
||
/// <summary> | ||
/// Set to true to convert katakana to uppercase using ToRomaji() | ||
/// <example> | ||
/// ToRomaji('ひらがな カタカナ', new WanaKanaOptions { UppercaseKatakana = true }) => "hiragana KATAKANA" | ||
/// </example> | ||
/// </summary> | ||
public bool UppercaseKatakana { get; set; } = false; | ||
|
||
/// <summary> | ||
/// Set to true, 'ToHiragana', or 'ToKatakana' to handle conversion while it is being typed. | ||
/// </summary> | ||
public ImeMode ImeMode { get; set; } = ImeMode.None; | ||
|
||
/// <summary> | ||
/// Choose ToRomaji() romanization map (currently only 'Hepburn'). | ||
/// </summary> | ||
public RomanizationMap Romanization { get; set; } = RomanizationMap.Hepburn; | ||
|
||
/// <summary> | ||
/// Custom map will be merged with default conversion. | ||
/// <example> | ||
/// ToKana('wanakana', new WanaKanaOptions { CustomKanaMapping = { { na, 'に'}, { ka, 'Bana'} }) => 'わにBanaに' | ||
/// </example> | ||
/// </summary> | ||
public IDictionary<string, string> CustomKanaMapping { get; set; } = new Dictionary<string, string>(); | ||
|
||
/// <summary> | ||
/// Custom map will be merged with default conversion. | ||
/// <example> | ||
/// ToRomaji('つじぎり', new WanaKanaOptions { CustomRomajiMapping = { { じ, 'zi'}, { つ, 'tu'}, {り, 'li'} }) }) => 'tuzigili' | ||
/// </example> | ||
/// </summary> | ||
public IDictionary<string, string> CustomRomajiMapping { get; set; } = new Dictionary<string, string>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace WanaKanaNet.Tests.Validators | ||
{ | ||
public class HiraganaValidatorTests | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.