diff --git a/dotnet/.gitignore b/dotnet/.gitignore new file mode 100644 index 00000000..4872502a --- /dev/null +++ b/dotnet/.gitignore @@ -0,0 +1,277 @@ + +# Created by https://www.gitignore.io/api/aspnetcore +# Edit at https://www.gitignore.io/?templates=aspnetcore + +### ASPNETCore ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +project.fragment.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/ + +# End of https://www.gitignore.io/api/aspnetcore + +*.css.map \ No newline at end of file diff --git a/dotnet/README b/dotnet/README new file mode 100644 index 00000000..e69de29b diff --git a/dotnet/cikling-convert/App.razor b/dotnet/cikling-convert/App.razor new file mode 100644 index 00000000..651131de --- /dev/null +++ b/dotnet/cikling-convert/App.razor @@ -0,0 +1,10 @@ + + + + + + +

Sorry, there's nothing at this address.

+
+
+
diff --git a/dotnet/cikling-convert/Pages/Index.razor b/dotnet/cikling-convert/Pages/Index.razor new file mode 100644 index 00000000..1a57b5df --- /dev/null +++ b/dotnet/cikling-convert/Pages/Index.razor @@ -0,0 +1,39 @@ +@page "/" +@page "/index.html" +@using LibHokchew.Shared; +@using System.Text.RegularExpressions; + +

戚林转榕拼(福州市区)

+ +

输入:戚林反切字

+

例:柳香 下平;他賓

+ + +
+

输出:推测福州市区发音

+
@OutputString
+ +@code{ + private string InputString { get; set; } + + private string OutputString { get { return Convert(InputString); } } + + string Convert(string input) { + if (string.IsNullOrEmpty(input)) { + return ""; + } + var trimmed = Regex.Replace(input, @"\s+", ""); + try { + if (trimmed.Length == 2) { + return CikLingUtil.ToYngPingHokchewToneless(trimmed); + } + if (trimmed.Length == 4) { + return CikLingUtil.ToYngPingHokchew(trimmed); + } + return ""; + } catch (Exception e) { + return "格式不正确: " + e.Message; + } + } + +} \ No newline at end of file diff --git a/dotnet/cikling-convert/Program.cs b/dotnet/cikling-convert/Program.cs new file mode 100644 index 00000000..73d5b666 --- /dev/null +++ b/dotnet/cikling-convert/Program.cs @@ -0,0 +1,25 @@ +using System; +using System.Net.Http; +using System.Collections.Generic; +using System.Threading.Tasks; +using System.Text; +using Microsoft.AspNetCore.Components.WebAssembly.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace cikling_convert +{ + public class Program + { + public static async Task Main(string[] args) + { + var builder = WebAssemblyHostBuilder.CreateDefault(args); + builder.RootComponents.Add("app"); + + builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); + + await builder.Build().RunAsync(); + } + } +} diff --git a/dotnet/cikling-convert/Properties/launchSettings.json b/dotnet/cikling-convert/Properties/launchSettings.json new file mode 100644 index 00000000..33cf68d7 --- /dev/null +++ b/dotnet/cikling-convert/Properties/launchSettings.json @@ -0,0 +1,29 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:37130", + "sslPort": 44388 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "cikling-convert": { + "commandName": "Project", + "launchBrowser": true, + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/dotnet/cikling-convert/Shared/MainLayout.razor b/dotnet/cikling-convert/Shared/MainLayout.razor new file mode 100644 index 00000000..9da6ef9e --- /dev/null +++ b/dotnet/cikling-convert/Shared/MainLayout.razor @@ -0,0 +1,7 @@ +@inherits LayoutComponentBase + +
+
+ @Body +
+
diff --git a/dotnet/cikling-convert/Shared/NavMenu.razor b/dotnet/cikling-convert/Shared/NavMenu.razor new file mode 100644 index 00000000..08526d0d --- /dev/null +++ b/dotnet/cikling-convert/Shared/NavMenu.razor @@ -0,0 +1,27 @@ + + +
+ +
+ +@code { + private bool collapseNavMenu = true; + + private string NavMenuCssClass => collapseNavMenu ? "collapse" : null; + + private void ToggleNavMenu() + { + collapseNavMenu = !collapseNavMenu; + } +} diff --git a/dotnet/cikling-convert/_Imports.razor b/dotnet/cikling-convert/_Imports.razor new file mode 100644 index 00000000..5fad9c73 --- /dev/null +++ b/dotnet/cikling-convert/_Imports.razor @@ -0,0 +1,9 @@ +@using System.Net.Http +@using System.Net.Http.Json +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using Microsoft.AspNetCore.Components.WebAssembly.Http +@using Microsoft.JSInterop +@using cikling_convert +@using cikling_convert.Shared diff --git a/dotnet/cikling-convert/cikling-convert.csproj b/dotnet/cikling-convert/cikling-convert.csproj new file mode 100644 index 00000000..7219af40 --- /dev/null +++ b/dotnet/cikling-convert/cikling-convert.csproj @@ -0,0 +1,19 @@ + + + + netstandard2.1 + 3.0 + + + + + + + + + + + + + + diff --git a/dotnet/cikling-convert/wwwroot/css/app.css b/dotnet/cikling-convert/wwwroot/css/app.css new file mode 100644 index 00000000..c133fd6d --- /dev/null +++ b/dotnet/cikling-convert/wwwroot/css/app.css @@ -0,0 +1,34 @@ +@import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); + +body { + -webkit-font-smoothing: auto !important; +} + +#blazor-error-ui { + background: lightyellow; + bottom: 0; + box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); + display: none; + left: 0; + padding: 0.6rem 1.25rem 0.7rem 1.25rem; + position: fixed; + width: 100%; + z-index: 1000; +} + +#blazor-error-ui .dismiss { + cursor: pointer; + position: absolute; + right: 0.75rem; + top: 0.5rem; +} + +textarea.full-width { + width: 100%; + min-height: 100px; + font-size: 1.2rem; +} + +.output { + min-height: 100px; +} \ No newline at end of file diff --git a/dotnet/cikling-convert/wwwroot/css/open-iconic/FONT-LICENSE b/dotnet/cikling-convert/wwwroot/css/open-iconic/FONT-LICENSE new file mode 100644 index 00000000..8ae8650d --- /dev/null +++ b/dotnet/cikling-convert/wwwroot/css/open-iconic/FONT-LICENSE @@ -0,0 +1,86 @@ +SIL OPEN FONT LICENSE Version 1.1 + +Copyright (c) 2014 Waybury + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/dotnet/cikling-convert/wwwroot/css/open-iconic/ICON-LICENSE b/dotnet/cikling-convert/wwwroot/css/open-iconic/ICON-LICENSE new file mode 100644 index 00000000..af73356f --- /dev/null +++ b/dotnet/cikling-convert/wwwroot/css/open-iconic/ICON-LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Waybury + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/dotnet/cikling-convert/wwwroot/css/open-iconic/README.md b/dotnet/cikling-convert/wwwroot/css/open-iconic/README.md new file mode 100644 index 00000000..e2e831ed --- /dev/null +++ b/dotnet/cikling-convert/wwwroot/css/open-iconic/README.md @@ -0,0 +1,114 @@ +[Open Iconic v1.1.1](http://useiconic.com/open) +=========== + +### Open Iconic is the open source sibling of [Iconic](http://useiconic.com). It is a hyper-legible collection of 223 icons with a tiny footprint—ready to use with Bootstrap and Foundation. [View the collection](http://useiconic.com/open#icons) + + + +## What's in Open Iconic? + +* 223 icons designed to be legible down to 8 pixels +* Super-light SVG files - 61.8 for the entire set +* SVG sprite—the modern replacement for icon fonts +* Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats +* Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats +* PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px. + + +## Getting Started + +#### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](http://useiconic.com/open#icons) and [Reference](http://useiconic.com/open#reference) sections. + +### General Usage + +#### Using Open Iconic's SVGs + +We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute). + +``` +icon name +``` + +#### Using Open Iconic's SVG Sprite + +Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack. + +Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `` *tag and a unique class name for each different icon in the* `` *tag.* + +``` + + + +``` + +Sizing icons only needs basic CSS. All the icons are in a square format, so just set the `` tag with equal width and height dimensions. + +``` +.icon { + width: 16px; + height: 16px; +} +``` + +Coloring icons is even easier. All you need to do is set the `fill` rule on the `` tag. + +``` +.icon-account-login { + fill: #f00; +} +``` + +To learn more about SVG Sprites, read [Chris Coyier's guide](http://css-tricks.com/svg-sprites-use-better-icon-fonts/). + +#### Using Open Iconic's Icon Font... + + +##### …with Bootstrap + +You can find our Bootstrap stylesheets in `font/css/open-iconic-bootstrap.{css, less, scss, styl}` + + +``` + +``` + + +``` + +``` + +##### …with Foundation + +You can find our Foundation stylesheets in `font/css/open-iconic-foundation.{css, less, scss, styl}` + +``` + +``` + + +``` + +``` + +##### …on its own + +You can find our default stylesheets in `font/css/open-iconic.{css, less, scss, styl}` + +``` + +``` + +``` + +``` + + +## License + +### Icons + +All code (including SVG markup) is under the [MIT License](http://opensource.org/licenses/MIT). + +### Fonts + +All fonts are under the [SIL Licensed](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web). diff --git a/dotnet/cikling-convert/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css b/dotnet/cikling-convert/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css new file mode 100644 index 00000000..4664f2e8 --- /dev/null +++ b/dotnet/cikling-convert/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css @@ -0,0 +1 @@ +@font-face{font-family:Icons;src:url(../fonts/open-iconic.eot);src:url(../fonts/open-iconic.eot?#iconic-sm) format('embedded-opentype'),url(../fonts/open-iconic.woff) format('woff'),url(../fonts/open-iconic.ttf) format('truetype'),url(../fonts/open-iconic.otf) format('opentype'),url(../fonts/open-iconic.svg#iconic-sm) format('svg');font-weight:400;font-style:normal}.oi{position:relative;top:1px;display:inline-block;speak:none;font-family:Icons;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.oi:empty:before{width:1em;text-align:center;box-sizing:content-box}.oi.oi-align-center:before{text-align:center}.oi.oi-align-left:before{text-align:left}.oi.oi-align-right:before{text-align:right}.oi.oi-flip-horizontal:before{-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.oi.oi-flip-vertical:before{-webkit-transform:scale(1,-1);-ms-transform:scale(-1,1);transform:scale(1,-1)}.oi.oi-flip-horizontal-vertical:before{-webkit-transform:scale(-1,-1);-ms-transform:scale(-1,1);transform:scale(-1,-1)}.oi-account-login:before{content:'\e000'}.oi-account-logout:before{content:'\e001'}.oi-action-redo:before{content:'\e002'}.oi-action-undo:before{content:'\e003'}.oi-align-center:before{content:'\e004'}.oi-align-left:before{content:'\e005'}.oi-align-right:before{content:'\e006'}.oi-aperture:before{content:'\e007'}.oi-arrow-bottom:before{content:'\e008'}.oi-arrow-circle-bottom:before{content:'\e009'}.oi-arrow-circle-left:before{content:'\e00a'}.oi-arrow-circle-right:before{content:'\e00b'}.oi-arrow-circle-top:before{content:'\e00c'}.oi-arrow-left:before{content:'\e00d'}.oi-arrow-right:before{content:'\e00e'}.oi-arrow-thick-bottom:before{content:'\e00f'}.oi-arrow-thick-left:before{content:'\e010'}.oi-arrow-thick-right:before{content:'\e011'}.oi-arrow-thick-top:before{content:'\e012'}.oi-arrow-top:before{content:'\e013'}.oi-audio-spectrum:before{content:'\e014'}.oi-audio:before{content:'\e015'}.oi-badge:before{content:'\e016'}.oi-ban:before{content:'\e017'}.oi-bar-chart:before{content:'\e018'}.oi-basket:before{content:'\e019'}.oi-battery-empty:before{content:'\e01a'}.oi-battery-full:before{content:'\e01b'}.oi-beaker:before{content:'\e01c'}.oi-bell:before{content:'\e01d'}.oi-bluetooth:before{content:'\e01e'}.oi-bold:before{content:'\e01f'}.oi-bolt:before{content:'\e020'}.oi-book:before{content:'\e021'}.oi-bookmark:before{content:'\e022'}.oi-box:before{content:'\e023'}.oi-briefcase:before{content:'\e024'}.oi-british-pound:before{content:'\e025'}.oi-browser:before{content:'\e026'}.oi-brush:before{content:'\e027'}.oi-bug:before{content:'\e028'}.oi-bullhorn:before{content:'\e029'}.oi-calculator:before{content:'\e02a'}.oi-calendar:before{content:'\e02b'}.oi-camera-slr:before{content:'\e02c'}.oi-caret-bottom:before{content:'\e02d'}.oi-caret-left:before{content:'\e02e'}.oi-caret-right:before{content:'\e02f'}.oi-caret-top:before{content:'\e030'}.oi-cart:before{content:'\e031'}.oi-chat:before{content:'\e032'}.oi-check:before{content:'\e033'}.oi-chevron-bottom:before{content:'\e034'}.oi-chevron-left:before{content:'\e035'}.oi-chevron-right:before{content:'\e036'}.oi-chevron-top:before{content:'\e037'}.oi-circle-check:before{content:'\e038'}.oi-circle-x:before{content:'\e039'}.oi-clipboard:before{content:'\e03a'}.oi-clock:before{content:'\e03b'}.oi-cloud-download:before{content:'\e03c'}.oi-cloud-upload:before{content:'\e03d'}.oi-cloud:before{content:'\e03e'}.oi-cloudy:before{content:'\e03f'}.oi-code:before{content:'\e040'}.oi-cog:before{content:'\e041'}.oi-collapse-down:before{content:'\e042'}.oi-collapse-left:before{content:'\e043'}.oi-collapse-right:before{content:'\e044'}.oi-collapse-up:before{content:'\e045'}.oi-command:before{content:'\e046'}.oi-comment-square:before{content:'\e047'}.oi-compass:before{content:'\e048'}.oi-contrast:before{content:'\e049'}.oi-copywriting:before{content:'\e04a'}.oi-credit-card:before{content:'\e04b'}.oi-crop:before{content:'\e04c'}.oi-dashboard:before{content:'\e04d'}.oi-data-transfer-download:before{content:'\e04e'}.oi-data-transfer-upload:before{content:'\e04f'}.oi-delete:before{content:'\e050'}.oi-dial:before{content:'\e051'}.oi-document:before{content:'\e052'}.oi-dollar:before{content:'\e053'}.oi-double-quote-sans-left:before{content:'\e054'}.oi-double-quote-sans-right:before{content:'\e055'}.oi-double-quote-serif-left:before{content:'\e056'}.oi-double-quote-serif-right:before{content:'\e057'}.oi-droplet:before{content:'\e058'}.oi-eject:before{content:'\e059'}.oi-elevator:before{content:'\e05a'}.oi-ellipses:before{content:'\e05b'}.oi-envelope-closed:before{content:'\e05c'}.oi-envelope-open:before{content:'\e05d'}.oi-euro:before{content:'\e05e'}.oi-excerpt:before{content:'\e05f'}.oi-expand-down:before{content:'\e060'}.oi-expand-left:before{content:'\e061'}.oi-expand-right:before{content:'\e062'}.oi-expand-up:before{content:'\e063'}.oi-external-link:before{content:'\e064'}.oi-eye:before{content:'\e065'}.oi-eyedropper:before{content:'\e066'}.oi-file:before{content:'\e067'}.oi-fire:before{content:'\e068'}.oi-flag:before{content:'\e069'}.oi-flash:before{content:'\e06a'}.oi-folder:before{content:'\e06b'}.oi-fork:before{content:'\e06c'}.oi-fullscreen-enter:before{content:'\e06d'}.oi-fullscreen-exit:before{content:'\e06e'}.oi-globe:before{content:'\e06f'}.oi-graph:before{content:'\e070'}.oi-grid-four-up:before{content:'\e071'}.oi-grid-three-up:before{content:'\e072'}.oi-grid-two-up:before{content:'\e073'}.oi-hard-drive:before{content:'\e074'}.oi-header:before{content:'\e075'}.oi-headphones:before{content:'\e076'}.oi-heart:before{content:'\e077'}.oi-home:before{content:'\e078'}.oi-image:before{content:'\e079'}.oi-inbox:before{content:'\e07a'}.oi-infinity:before{content:'\e07b'}.oi-info:before{content:'\e07c'}.oi-italic:before{content:'\e07d'}.oi-justify-center:before{content:'\e07e'}.oi-justify-left:before{content:'\e07f'}.oi-justify-right:before{content:'\e080'}.oi-key:before{content:'\e081'}.oi-laptop:before{content:'\e082'}.oi-layers:before{content:'\e083'}.oi-lightbulb:before{content:'\e084'}.oi-link-broken:before{content:'\e085'}.oi-link-intact:before{content:'\e086'}.oi-list-rich:before{content:'\e087'}.oi-list:before{content:'\e088'}.oi-location:before{content:'\e089'}.oi-lock-locked:before{content:'\e08a'}.oi-lock-unlocked:before{content:'\e08b'}.oi-loop-circular:before{content:'\e08c'}.oi-loop-square:before{content:'\e08d'}.oi-loop:before{content:'\e08e'}.oi-magnifying-glass:before{content:'\e08f'}.oi-map-marker:before{content:'\e090'}.oi-map:before{content:'\e091'}.oi-media-pause:before{content:'\e092'}.oi-media-play:before{content:'\e093'}.oi-media-record:before{content:'\e094'}.oi-media-skip-backward:before{content:'\e095'}.oi-media-skip-forward:before{content:'\e096'}.oi-media-step-backward:before{content:'\e097'}.oi-media-step-forward:before{content:'\e098'}.oi-media-stop:before{content:'\e099'}.oi-medical-cross:before{content:'\e09a'}.oi-menu:before{content:'\e09b'}.oi-microphone:before{content:'\e09c'}.oi-minus:before{content:'\e09d'}.oi-monitor:before{content:'\e09e'}.oi-moon:before{content:'\e09f'}.oi-move:before{content:'\e0a0'}.oi-musical-note:before{content:'\e0a1'}.oi-paperclip:before{content:'\e0a2'}.oi-pencil:before{content:'\e0a3'}.oi-people:before{content:'\e0a4'}.oi-person:before{content:'\e0a5'}.oi-phone:before{content:'\e0a6'}.oi-pie-chart:before{content:'\e0a7'}.oi-pin:before{content:'\e0a8'}.oi-play-circle:before{content:'\e0a9'}.oi-plus:before{content:'\e0aa'}.oi-power-standby:before{content:'\e0ab'}.oi-print:before{content:'\e0ac'}.oi-project:before{content:'\e0ad'}.oi-pulse:before{content:'\e0ae'}.oi-puzzle-piece:before{content:'\e0af'}.oi-question-mark:before{content:'\e0b0'}.oi-rain:before{content:'\e0b1'}.oi-random:before{content:'\e0b2'}.oi-reload:before{content:'\e0b3'}.oi-resize-both:before{content:'\e0b4'}.oi-resize-height:before{content:'\e0b5'}.oi-resize-width:before{content:'\e0b6'}.oi-rss-alt:before{content:'\e0b7'}.oi-rss:before{content:'\e0b8'}.oi-script:before{content:'\e0b9'}.oi-share-boxed:before{content:'\e0ba'}.oi-share:before{content:'\e0bb'}.oi-shield:before{content:'\e0bc'}.oi-signal:before{content:'\e0bd'}.oi-signpost:before{content:'\e0be'}.oi-sort-ascending:before{content:'\e0bf'}.oi-sort-descending:before{content:'\e0c0'}.oi-spreadsheet:before{content:'\e0c1'}.oi-star:before{content:'\e0c2'}.oi-sun:before{content:'\e0c3'}.oi-tablet:before{content:'\e0c4'}.oi-tag:before{content:'\e0c5'}.oi-tags:before{content:'\e0c6'}.oi-target:before{content:'\e0c7'}.oi-task:before{content:'\e0c8'}.oi-terminal:before{content:'\e0c9'}.oi-text:before{content:'\e0ca'}.oi-thumb-down:before{content:'\e0cb'}.oi-thumb-up:before{content:'\e0cc'}.oi-timer:before{content:'\e0cd'}.oi-transfer:before{content:'\e0ce'}.oi-trash:before{content:'\e0cf'}.oi-underline:before{content:'\e0d0'}.oi-vertical-align-bottom:before{content:'\e0d1'}.oi-vertical-align-center:before{content:'\e0d2'}.oi-vertical-align-top:before{content:'\e0d3'}.oi-video:before{content:'\e0d4'}.oi-volume-high:before{content:'\e0d5'}.oi-volume-low:before{content:'\e0d6'}.oi-volume-off:before{content:'\e0d7'}.oi-warning:before{content:'\e0d8'}.oi-wifi:before{content:'\e0d9'}.oi-wrench:before{content:'\e0da'}.oi-x:before{content:'\e0db'}.oi-yen:before{content:'\e0dc'}.oi-zoom-in:before{content:'\e0dd'}.oi-zoom-out:before{content:'\e0de'} \ No newline at end of file diff --git a/dotnet/cikling-convert/wwwroot/css/open-iconic/font/fonts/open-iconic.eot b/dotnet/cikling-convert/wwwroot/css/open-iconic/font/fonts/open-iconic.eot new file mode 100644 index 00000000..f98177db Binary files /dev/null and b/dotnet/cikling-convert/wwwroot/css/open-iconic/font/fonts/open-iconic.eot differ diff --git a/dotnet/cikling-convert/wwwroot/css/open-iconic/font/fonts/open-iconic.otf b/dotnet/cikling-convert/wwwroot/css/open-iconic/font/fonts/open-iconic.otf new file mode 100644 index 00000000..f6bd6846 Binary files /dev/null and b/dotnet/cikling-convert/wwwroot/css/open-iconic/font/fonts/open-iconic.otf differ diff --git a/dotnet/cikling-convert/wwwroot/css/open-iconic/font/fonts/open-iconic.svg b/dotnet/cikling-convert/wwwroot/css/open-iconic/font/fonts/open-iconic.svg new file mode 100644 index 00000000..cf429428 --- /dev/null +++ b/dotnet/cikling-convert/wwwroot/css/open-iconic/font/fonts/open-iconic.svg @@ -0,0 +1,543 @@ + + + + + +Created by FontForge 20120731 at Tue Jul 1 20:39:22 2014 + By P.J. Onori +Created by P.J. Onori with FontForge 2.0 (http://fontforge.sf.net) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dotnet/cikling-convert/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf b/dotnet/cikling-convert/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf new file mode 100644 index 00000000..fab60486 Binary files /dev/null and b/dotnet/cikling-convert/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf differ diff --git a/dotnet/cikling-convert/wwwroot/css/open-iconic/font/fonts/open-iconic.woff b/dotnet/cikling-convert/wwwroot/css/open-iconic/font/fonts/open-iconic.woff new file mode 100644 index 00000000..f9309988 Binary files /dev/null and b/dotnet/cikling-convert/wwwroot/css/open-iconic/font/fonts/open-iconic.woff differ diff --git a/dotnet/cikling-convert/wwwroot/index.html b/dotnet/cikling-convert/wwwroot/index.html new file mode 100644 index 00000000..676dad49 --- /dev/null +++ b/dotnet/cikling-convert/wwwroot/index.html @@ -0,0 +1,23 @@ + + + + + + + 戚林转榕拼 + + + + + + + 载入中...(墙内初次访问非常慢,请先喝杯茶) +
+ An unhandled error has occurred. + Reload + 🗙 +
+ + + + diff --git a/dotnet/shared/CikLingUtil.cs b/dotnet/shared/CikLingUtil.cs new file mode 100644 index 00000000..6a149757 --- /dev/null +++ b/dotnet/shared/CikLingUtil.cs @@ -0,0 +1,523 @@ +using System; +using System.Collections.Generic; +using LibHokchew.Protos; + +namespace LibHokchew.Shared +{ + public static class CikLingUtil + { + private static readonly IDictionary CharToInitial = new Dictionary() { + {'柳', Initial.L}, + {'邊', Initial.B}, + {'边', Initial.B}, + {'求', Initial.G}, + {'氣', Initial.K}, + {'气', Initial.K}, + {'低', Initial.D}, + {'波', Initial.P}, + {'他', Initial.T}, + {'曾', Initial.Z}, + {'日', Initial.N}, + {'時', Initial.S}, + {'时', Initial.S}, + {'鶯', Initial.None}, + {'莺', Initial.None}, + {'蒙', Initial.M}, + {'語', Initial.Ng}, + {'语', Initial.Ng}, + {'出', Initial.C}, + {'非', Initial.H} + }; + + private static readonly IDictionary CharToFinal = new Dictionary() { + {'春', Final.Ung}, + {'公', Final.Ung}, + {'花', Final.Ua}, + {'瓜', Final.Ua}, + {'香', Final.Yong}, + {'姜', Final.Yong}, + {'秋', Final.Iu}, + {'周', Final.Iu}, + {'山', Final.Ang}, + {'干', Final.Ang}, + {'開', Final.Ai}, + {'开', Final.Ai}, + {'哉', Final.Ai}, + {'嘉', Final.A}, + {'佳', Final.A}, + {'賓', Final.Ing}, + {'宾', Final.Ing}, + {'京', Final.Ing}, + {'歡', Final.Uang}, + {'欢', Final.Uang}, + {'官', Final.Uang}, + {'歌', Final.O}, + {'高', Final.O}, + {'須', Final.Y}, + {'须', Final.Y}, + {'車', Final.Y}, + {'车', Final.Y}, + {'杯', Final.Uoi}, + {'盃', Final.Uoi}, + {'孤', Final.U}, + {'姑', Final.U}, + {'燈', Final.Eing}, + {'灯', Final.Eing}, + {'庚', Final.Eing}, + {'光', Final.Uong}, + {'輝', Final.Ui}, + {'辉', Final.Ui}, + {'龜', Final.Ui}, + {'龟', Final.Ui}, + {'燒', Final.Ieu}, + {'烧', Final.Ieu}, + {'嬌', Final.Ieu}, + {'娇', Final.Ieu}, + {'銀', Final.Yng}, + {'银', Final.Yng}, + {'恭', Final.Yng}, + {'釭', Final.Ong}, + {'綱', Final.Ong}, + {'纲', Final.Ong}, + {'之', Final.I}, + {'箕', Final.I}, + {'東', Final.Oeng}, + {'东', Final.Oeng}, + {'江', Final.Oeng}, + {'郊', Final.Au}, + {'交', Final.Au}, + {'過', Final.Uo}, + {'过', Final.Uo}, + {'朱', Final.Uo}, + {'西', Final.E}, + {'街', Final.E}, + {'橋', Final.Io}, + {'桥', Final.Io}, + {'嬝', Final.Io}, + {'袅', Final.Io}, + {'雞', Final.Ie}, + {'鸡', Final.Ie}, + {'圭', Final.Ie}, + {'聲', Final.Iang}, + {'声', Final.Iang}, + {'正', Final.Iang}, + {'催', Final.Oey}, + {'初', Final.Oe}, + {'梳', Final.Oe}, + {'天', Final.Ieng}, + {'堅', Final.Ieng}, + {'坚', Final.Ieng}, + {'奇', Final.Ia}, + {'迦', Final.Ia}, + {'歪', Final.Uai}, + {'乖', Final.Uai}, + {'溝', Final.Eu}, + {'沟', Final.Eu}, + {'勾', Final.Eu}, + }; + + private static readonly IDictionary StringToTone = new Dictionary() { + {"上平", Tone.UpLevel}, + {"上上", Tone.UpUp}, + {"上去", Tone.UpFalling}, + {"上入", Tone.UpAbrupt}, + {"下平", Tone.DownLevel}, + {"下上", Tone.UpUp}, // 下上调无字 + {"下去", Tone.DownFalling}, + {"下入", Tone.DownAbrupt} + }; + + private static readonly IDictionary CikLingInitialToYngPing = new Dictionary() { + {Initial.L, "l"}, + {Initial.B, "b"}, + {Initial.G, "g"}, + {Initial.K, "k"}, + {Initial.D, "d"}, + {Initial.P, "p"}, + {Initial.T, "t"}, + {Initial.Z, "z"}, + {Initial.N, "n"}, + {Initial.S, "s"}, + {Initial.None, ""}, + {Initial.M, "m"}, + {Initial.Ng, "ng"}, + {Initial.C, "c"}, + {Initial.H, "h"}, + }; + + private static readonly IDictionary CikLingToneToYngPing = new Dictionary() { + {Tone.UpLevel, "55"}, + {Tone.UpUp, "33"}, + {Tone.UpFalling, "213"}, + {Tone.UpAbrupt, "24"}, + {Tone.DownLevel, "53"}, + {Tone.DownFalling, "242"}, + {Tone.DownAbrupt, "5"}, + }; + + private static readonly ISet YoUoInitials = new HashSet { + Initial.D, + Initial.T, + Initial.N, + Initial.L, + Initial.S, + Initial.Z, + Initial.C + }; + + public static string ToYngPingHokchew(string cikling) { + if (cikling.Length != 4) { + throw new ArgumentException($"{cikling} 不是戚林反切"); + } + var initialChar = cikling[0]; + var finalChar = cikling[1]; + var toneStr = cikling.Substring(2); + if (!CharToInitial.ContainsKey(initialChar)) { + throw new ArgumentException($"{initialChar} 不是戚林声母"); + } + if (!CharToFinal.ContainsKey(finalChar)) { + throw new ArgumentException($"{finalChar} 不是戚林韵母"); + } + if (!StringToTone.ContainsKey(toneStr)) { + throw new ArgumentException($"{toneStr} 不是戚林声调"); + } + var initial = CharToInitial[initialChar]; + var final = CharToFinal[finalChar]; + var tone = StringToTone[toneStr]; + return ToYngPingHokchew(initial, final, tone); + } + + public static string ToYngPingHokchew(Initial initial, Final final, Tone tone) { + return CikLingInitialToYngPing[initial] + + GetYngPingHokchewFinal(MaybeYoToUo(initial, final), tone) + + CikLingToneToYngPing[tone]; + } + + public static string ToYngPingHokchewToneless(string ciklingToneless) { + if (ciklingToneless.Length != 2) { + throw new ArgumentException($"{ciklingToneless} 不是戚林反切"); + } + var initialChar = ciklingToneless[0]; + var finalChar = ciklingToneless[1]; + if (!CharToInitial.ContainsKey(initialChar)) { + throw new ArgumentException($"{initialChar} 不是戚林声母"); + } + if (!CharToFinal.ContainsKey(finalChar)) { + throw new ArgumentException($"{finalChar} 不是戚林韵母"); + } + var initial = CharToInitial[initialChar]; + var final = CharToFinal[finalChar]; + return ToYngPingHokchewToneless(initial, final); + } + + public static string ToYngPingHokchewToneless(Initial initial, Final final) { + return CikLingInitialToYngPing[initial] + GetYngPingHokchewFinal( + MaybeYoToUo(initial, final), + Tone.UpLevel); + } + + private static Final MaybeYoToUo(Initial initial, Final final) { + if (final == Final.Yong && YoUoInitials.Contains(initial)) { + return Final.Uong; + } + if (final == Final.Io && YoUoInitials.Contains(initial)) { + return Final.Uo; + } + return final; + } + + private static string GetYngPingHokchewFinal(Final final, Tone tone) { + switch (tone) { + // 紧 + case Tone.UpLevel: + case Tone.UpUp: + case Tone.DownLevel: + switch (final) { + case Final.Ung: + return "ung"; + case Final.Ua: + return "ua"; + case Final.Yong: + return "yong"; + case Final.Iu: + return "iu"; + case Final.Ang: + return "ang"; + case Final.Ai: + return "ai"; + case Final.A: + return "a"; + case Final.Ing: + return "ing"; + case Final.Uang: + return "uang"; + case Final.O: + return "o"; + case Final.Y: + return "y"; + case Final.Uoi: + return "ui"; + case Final.U: + return "u"; + case Final.Eing: + return "eing"; + case Final.Uong: + return "uong"; + case Final.Ui: + return "ui"; + case Final.Ieu: + return "iu"; + case Final.Yng: + return "yng"; + case Final.Ong: + return "oung"; + case Final.I: + return "i"; + case Final.Oeng: + return "eoyng"; + case Final.Au: + return "au"; + case Final.Uo: + return "uo"; + case Final.E: + return "e"; + case Final.Io: + return "yo"; + case Final.Ie: + return "ie"; + case Final.Iang: + return "iang"; + case Final.Oey: + return "eoy"; + case Final.Oe: + return "eo"; + case Final.Ieng: + return "ieng"; + case Final.Ia: + return "ia"; + case Final.Uai: + return "uai"; + case Final.Eu: + return "eu"; + } + throw new Exception("The impossible happened"); + // 紧入 + case Tone.DownAbrupt: + switch (final) { + case Final.Ung: + return "uk"; + case Final.Ua: + return "uah"; + case Final.Yong: + return "yok"; + case Final.Iu: + return "iuh"; + case Final.Ang: + return "ak"; + case Final.Ai: + return "aih"; + case Final.A: + return "ah"; + case Final.Ing: + return "ik"; + case Final.Uang: + return "uak"; + case Final.O: + return "oh"; + case Final.Y: + return "yh"; + case Final.Uoi: + return "uih"; + case Final.U: + return "uh"; + case Final.Eing: + return "eik"; + case Final.Uong: + return "uok"; + case Final.Ui: + return "uih"; + case Final.Ieu: + return "iuh"; + case Final.Yng: + return "yk"; + case Final.Ong: + return "ouk"; + case Final.I: + return "ih"; + case Final.Oeng: + return "eoyk"; + case Final.Au: + return "auh"; + case Final.Uo: + return "uoh"; + case Final.E: + return "eh"; + case Final.Io: + return "yoh"; + case Final.Ie: + return "ieh"; + case Final.Iang: + return "iak"; + case Final.Oey: + return "eoyh"; + case Final.Oe: + return "eoh"; + case Final.Ieng: + return "iek"; + case Final.Ia: + return "ieh"; + case Final.Uai: + return "uaih"; + case Final.Eu: + return "euh"; + } + throw new Exception("The impossible happened"); + // 松 + case Tone.UpFalling: + case Tone.DownFalling: + switch (final) { + case Final.Ung: + return "oung"; + case Final.Ua: + return "ua"; + case Final.Yong: + return "yong"; + case Final.Iu: + return "iu"; + case Final.Ang: + return "ang"; + case Final.Ai: + return "ai"; + case Final.A: + return "a"; + case Final.Ing: + return "eing"; + case Final.Uang: + return "uang"; + case Final.O: + return "oo"; + case Final.Y: + return "eoy"; + case Final.Uoi: + return "ui"; + case Final.U: + return "ou"; + case Final.Eing: + return "aing"; + case Final.Uong: + return "uong"; + case Final.Ui: + return "ui"; + case Final.Ieu: + return "iu"; + case Final.Yng: + return "eoyng"; + case Final.Ong: + return "ooung"; + case Final.I: + return "ei"; + case Final.Oeng: + return "ooyng"; + case Final.Au: + return "au"; + case Final.Uo: + return "uo"; + case Final.E: + return "a"; + case Final.Io: + return "yo"; + case Final.Ie: + return "ie"; + case Final.Iang: + return "iang"; + case Final.Oey: + return "ooy"; + case Final.Oe: + return "oo"; + case Final.Ieng: + return "ieng"; + case Final.Ia: + return "ia"; + case Final.Uai: + return "uai"; + case Final.Eu: + return "au"; + } + throw new Exception("The impossible happened"); + // 松入 + case Tone.UpAbrupt: + switch (final) { + case Final.Ung: + return "ouk"; + case Final.Ua: + return "uah"; + case Final.Yong: + return "yok"; + case Final.Iu: + return "iuh"; + case Final.Ang: + return "ak"; + case Final.Ai: + return "aih"; + case Final.A: + return "ah"; + case Final.Ing: + return "eik"; + case Final.Uang: + return "uak"; + case Final.O: + return "ooh"; + case Final.Y: + return "eoyh"; + case Final.Uoi: + return "uih"; + case Final.U: + return "ouh"; + case Final.Eing: + return "aik"; + case Final.Uong: + return "uok"; + case Final.Ui: + return "uih"; + case Final.Ieu: + return "iuh"; + case Final.Yng: + return "eoyk"; + case Final.Ong: + return "oouk"; + case Final.I: + return "eih"; + case Final.Oeng: + return "ooyk"; + case Final.Au: + return "auh"; + case Final.Uo: + return "uoh"; + case Final.E: + return "ah"; + case Final.Io: + return "yoh"; + case Final.Ie: + return "ieh"; + case Final.Iang: + return "iak"; + case Final.Oey: + return "ooyh"; + case Final.Oe: + return "ooh"; + case Final.Ieng: + return "iek"; + case Final.Ia: + return "ieh"; + case Final.Uai: + return "uaih"; + case Final.Eu: + return "auh"; + } + throw new Exception("The impossible happened"); + } + throw new Exception("The impossible happened"); + } + + } +} diff --git a/dotnet/shared/protos/phonology.proto b/dotnet/shared/protos/phonology.proto new file mode 100644 index 00000000..5ce56bc1 --- /dev/null +++ b/dotnet/shared/protos/phonology.proto @@ -0,0 +1,127 @@ +syntax = "proto3"; + +package libhokchew; + +option csharp_namespace = "LibHokchew.Protos"; + +enum Final { + FINAL_UNSPECIFIED = 0; + // 春 + UNG = 1; + // 花 + UA = 2; + // 香 + YONG = 3; + // 秋 + IU = 4; + // 山 + ANG = 5; + // 開 + AI = 6; + // 嘉 + A = 7; + // 賓 + ING = 8; + // 歡 + UANG = 9; + // 歌 + O = 10; + // 須 + Y = 11; + // 杯 + UOI = 12; + // 孤 + U = 13; + // 燈 + EING = 14; + // 光 + UONG = 15; + // 輝 + UI = 16; + // 燒 + IEU = 17; + // 銀 + YNG = 18; + // 釭 + ONG = 19; + // 之 + I = 20; + // 東 + OENG = 21; + // 郊 + AU = 22; + // 過 + UO = 23; + // 西 + E = 24; + // 橋 + IO = 25; + // 雞 + IE = 26; + // 聲 + IANG = 27; + // 催 + OEY = 28; + // 初 + OE = 29; + // 天 + IENG = 30; + // 奇 + IA = 31; + // 歪 + UAI = 32; + // 溝 + EU = 33; +} + +enum Initial { + INITIAL_UNSPECIFIED = 0; + // 柳 + L = 1; + // 邊 + B = 2; + // 求 + G = 3; + // 氣 + K = 4; + // 低 + D = 5; + // 波 + P = 6; + // 他 + T = 7; + // 曾 + Z = 8; + // 日 + N = 9; + // 時 + S = 10; + // 鶯 + NONE = 11; + // 蒙 + M = 12; + // 語 + NG = 13; + // 出 + C = 14; + // 非 + H = 15; +} + +enum Tone { + TONE_UNSPECIFIED = 0; + // 上平 + UP_LEVEL = 1; + // 上上 + UP_UP = 2; + // 上去 + UP_FALLING = 3; + // 上入 + UP_ABRUPT = 4; + // 下平 + DOWN_LEVEL = 5; + // 下去 + DOWN_FALLING = 6; + // 下入 + DOWN_ABRUPT = 7; +} diff --git a/dotnet/shared/shared.csproj b/dotnet/shared/shared.csproj new file mode 100644 index 00000000..fc7d2474 --- /dev/null +++ b/dotnet/shared/shared.csproj @@ -0,0 +1,19 @@ + + + + netstandard2.0 + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + +