diff --git a/plugins/page-toc/CHANGELOG.md b/plugins/page-toc/CHANGELOG.md new file mode 100644 index 0000000..8043746 --- /dev/null +++ b/plugins/page-toc/CHANGELOG.md @@ -0,0 +1,93 @@ +# v3.2.0 +## 02/23/2022 + +1. [](#new) + * Support for HTML or Shortcode based headers with custom `id` attributes to specify an anchor + * Added German translation + +# v3.1.3 +## 01/03/2022 + +1. [](#new) + * Require Grav `v1.7.26` to make use of built in `Plugin::inheritedConfigOption()` + * NOTE: `page-toc v3.1.2` was released prior to `Grav v1.7.26` and has been removed +2. [](#improved) + * Don't force inclusion of `` or `` tags to reduce chance of invalid HTML + * Improved `README.md` + +# v3.1.1 +## 12/16/2021 + +1. [](#bugfix) + * Fixed some blueprint errors that caused errors on save + * Force `start` and `depth` to be integers [#17](https://github.com/trilbymedia/grav-plugin-page-toc/issues/17) + +# v3.1.0 +## 12/09/2021 + +1. [](#new) + * **NEW** Added option to automatically copying to clipboard an anchor URL when clicking on it + +# v3.0.0 +## 12/03/2021 + +1. [](#new) + * **NEW** Support built-in `anchors` with customization of icon/classes/css etc. + * **NEW** `[anchor]` shortcode for creating manual anchors for easy linking to page content + * Moved the vendor-based TOC functionality in-plugin to provide more flexibility and additional features + * Added several more Twig functions for increased flexibility + * Ability to limit the length of a fragment link + * Ability to set a custom prefix for anchor links + * Added `languages.yaml` file for text translations +2. [](#improved) + * Independent control over the levels of anchors that should be built and the TOC displayed + * `page-toc:` page-level configuration can be set in parent pages and trickles down to child pages + * Removed dependency on HTML5 library and use the faster PHP `DOMDocument` class + * Translated text for the "Table of Contents" in the `page-toc.html.twig` template + +# v2.0.0 +## 11/24/2021 + +1. [](#new) + * Added new `components/page-toc.html.twig` that can be extended and the HTML output modified + * Updated core TOC library to latest `3.0.2` version + * Requires PHP `7.3.6` + * Requires Grav `1.7+` + * Added Shortcode-like in-page syntax support. e.g. `[toc]` + +# v1.1.2 +## 06/01/2021 + +1. [](#new) + * Added page-toc blueprints under "Advanced" tab for admin +1. [](#improved) + * Updated to latest `knplabs/knp-menu` library +1. [](#bugfix) + * Added `|raw` filter to twig output in README.md + +# v1.1.1 +## 12/02/2020 + +1. [](#improved) + * Updated to latest `masterminds/html5` and `knplabs/knp-menu` libraries + +# v1.1.0 +## 04/01/2019 + +1. [](#improved) + * Updated to latest `caseyamcl/toc` library +1. [](#bugfix) + * Fixes relative levels [#6](https://github.com/trilbymedia/grav-plugin-page-toc/pull/9) + * Fixes incorrect reference to `end` when it should be `depth` [#7](https://github.com/trilbymedia/grav-plugin-page-toc/pull/7) + +# v1.0.1 +## 03/19/2017 + +1. [](#improved) + * Fixed issue with `end` not being valid, should be `depth`. Updated README + +# v1.0.0 +## 08/01/2017 + +1. [](#new) + * ChangeLog started... diff --git a/plugins/page-toc/LICENSE b/plugins/page-toc/LICENSE new file mode 100644 index 0000000..5234b4e --- /dev/null +++ b/plugins/page-toc/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 Team Grav + +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. diff --git a/plugins/page-toc/README.md b/plugins/page-toc/README.md new file mode 100644 index 0000000..0959c6c --- /dev/null +++ b/plugins/page-toc/README.md @@ -0,0 +1,226 @@ +# Page Toc Plugin (Anchors + Table of Contents) + +The **Page Toc** Plugin is for [Grav CMS](http://github.com/getgrav/grav) that generates anchors based on HTML header tags, and can also create a table of contents from those headers. + +With version `3.0` this plugin is able to automatically generate anchor links with hover-click capability without the need for other plugins (such as the `anchors` plugin). This functionality operates independently from the now optional "table of contents" functionality. + +![](assets/page-toc.png) + +## Installation + +Installing the Page Toc plugin can be done in one of two ways. The GPM (Grav Package Manager) installation method enables you to quickly and easily install the plugin with a simple terminal command, while the manual method enables you to do so via a zip file. + +### GPM Installation (Preferred) + +The simplest way to install this plugin is via the [Grav Package Manager (GPM)](http://learn.getgrav.org/advanced/grav-gpm) through your system's terminal (also called the command line). From the root of your Grav install type: + + bin/gpm install page-toc + +This will install the Page Toc plugin into your `/user/plugins` directory within Grav. Its files can be found under `/your/site/grav/user/plugins/page-toc`. + +### Manual Installation + +To install this plugin, just download the zip version of this repository and unzip it under `/your/site/grav/user/plugins`. Then, rename the folder to `page-toc`. You can find these files on [GitHub](https://github.com/team-grav/grav-plugin-page-toc) or via [GetGrav.org](http://getgrav.org/downloads/plugins#extras). + +You should now have all the plugin files under + + /your/site/grav/user/plugins/page-toc + +## Configuration + +Before configuring this plugin, you should copy the `user/plugins/page-toc/page-toc.yaml` to `user/config/plugins/page-toc.yaml` and only edit that copy. + +Here is the default configuration and an explanation of available options: + +```yaml +enabled: true # Plugin enabled +include_css: true # Include CSS +active: true # Anchor IDs processed and generated for all pages +start: 1 # Start header tag level (1 = h1) for TOC +depth: 6 # Depth from start (2 = 2 levels deep) for TOC +hclass: # Custom Header TOC styling classes +anchors: # Anchor configuration + start: 1 # Start header tag level (1 = h1) + depth: 6 # Depth from start (2 = 2 levels deep) + link: true # Enabled auto-generation of clickable link with fragment + aria: Anchor # Aria label to use + class: # Custom Header anchor styling classes + icon: '#' # Icon to use, can be a symbol, emoji, ascii etc. + position: after # Position to put the anchor, `before|after` + copy_to_clipboard: true # Copy to clipboard functionality (coming soon) + slug_maxlen: 25 # Max length of slugs used for anchors + slug_prefix: # A prefix used in front of generated slugs +``` + +> You can now have `page-toc` automatically add anchors without there being a table of contents being used, just ensure `active` to `true`. + +By default, The plugin is `active` and will add header id attributes anchors for each header level found in a page. You can set `active: false` and then activate on a page basis by adding this to the page frontmatter: + +```yaml +page-toc: + active: true +``` + +You can also configure which header tags to start and depth on when building the id attribute anchors by changing the `start` and `depth` values. This can also be done on a per-page basis. + +For example if you had a start of `3` and a depth of `3` you would get a TOC for `h3`, `h4`, and `h5`. + +## Usage + +### Shortcode-like syntax in your content + +You can use the following shortcode-like syntax in your content: + +```md +[TOC] or [TOC/] or [toc] or [toc /] +``` + +This will replace the shortcode syntax with the Table of Contents with the `components/page-toc.html.twig` Twig template. Either the default one included in the `page-toc` plugin or an overridden version from your theme. + +For example in Quark theme, you will need to create a folder called `components/` under `templates/` so the file will be copied to: + +```shell +user/themes/quark/templates/components/page-toc.html.twig +``` + +NOTE: It's not required to set the TOC plugin `active` if you use the shortcode syntax in your content. That is a good enough indication that you want the plugin to be active. + +### Anchor Shortcode + +Page TOC now includes a `anchor` shortcode that allows you to manually add linkable fragments in your content. +The shortcode will automatically generate the link if no options are provided. Alternatively you can use the bbode syntax of `anchor="some-custom-id"` or you can explicity set it. You can also set a `prefix` and let the shortcode autogenerate the rest. + +For example: + +```markdown + +Ut sed nisl suscipit metus sollicitudin [anchor]ornare[/anchor] nec vitae nulla. In pretium massa ex, in [anchor="vulputate"]vulputate tellus[/anchor] accumsan vel. + +Nullam [anchor id="tempor"]tempor quis lorem[/anchor] venenatis finibus. Curabitur dapibus nulla sed tristique pretium. Nullam tempor quis [anchor prefix="sec2.2-"]lorem venenatis finibus[/anchor]. +``` + +An example of the resulting HTML link looks like: + +```html +tempor quis lorem +``` + +The `inline-anchor` CSS class is used by shortcodes and any manually generated elements so it can be styled as independently from other links or anchored headers. + +### Twig Templating + +When the plugin is `active` it will add anchors to the header tags of the page content as configured. You can simply include the provided Twig template: + +```twig +{% block content %} + {% include 'components/page-toc.html.twig' %} + {{ content|raw }} +{% endblock %} +``` + +You can also add your **Table of Contents** HTML in your Twig template directly with the provided `toc()` Twig function: + +For example: + +```twig +{% if active or toc_config_var('active') %} +
+ {% set table_of_contents = toc(page.content) %} + {% if table_of_contents is not empty %} +

{{ 'PLUGIN_PAGE_TOC.TABLE_OF_CONTENTS'|t }}

+ {{ table_of_contents|raw }} + {% endif %} +
+{% endif %} +``` + +The `toc_ordered()` Twig function does the same things as a the `toc()` function, except it uses an ordered list instead of an unordered one. + +or via the `toc_items()` function which rather than returning HTML directly returns objects and you can manipulate the output as needed: + +```twig +{% macro toc_loop(items) %} + {% import _self as self %} + {% for item in items %} + {% set class = loop.first ? 'first' : loop.last ? 'last' : null %} +
  • + {{ item.label }} + {% if item.children|length > 0 %} + + {% endif %} +
  • + {% endfor %} +{% endmacro %} + +{% if config.get('plugins.page-toc.active') or attribute(page.header, 'page-toc').active %} +
    + {% set table_of_contents = toc_items(page.content) %} + {% if table_of_contents is not empty %} +

    Table of Contents

    + + {% endif %} +
    +{% endif %} +``` + +To explictly build a table of contents for a block of content: + +```markdown +{% block my_content %} +# Header 1 + +## Header 1.1 + +Nullam tempor quis lorem venenatis finibus. Maecenas ut condimentum nibh. Ut sed nisl suscipit metus sollicitudin ornare nec vitae nulla. Integer sed tortor eu ligula interdum rhoncus. Sed pulvinar ut massa et ullamcorper. Curabitur bibendum ante orci, nec porttitor dolor suscipit quis. Nulla et eros enim. + +### Header 1.1.1 + +Integer sed tortor eu ligula interdum rhoncus. + +## Header 1.2 +{% endblock %} + +#### Table O' Contents +{{ toc(block('my_content'), 2, 1) }} +``` + +The `add_anchors()` twig funtion can take a string or a block of content and automatically adds anchors to any headers found per the configuration for the page, but you can override the start and depth. For example here we have a Twig block but we just want to add anchors to the H2 tags: + +```markdown +{% block my_content %} +# Header 1 + +## Header 1.1 + +Nullam tempor quis lorem venenatis finibus. Maecenas ut condimentum nibh. Ut sed nisl suscipit metus sollicitudin ornare nec vitae nulla. Integer sed tortor eu ligula interdum rhoncus. Sed pulvinar ut massa et ullamcorper. Curabitur bibendum ante orci, nec porttitor dolor suscipit quis. Nulla et eros enim. + +### Header 1.1.1 + +Integer sed tortor eu ligula interdum rhoncus. + +## Header 1.2 +{% endblock %} + +#### Anchors Away! +{{ add_anchors(block('my_content'), 2, 1) }} +``` + +### Limiting levels in output + +As well as limiting the levels that the page TOC plugin will use in the table of contents, you can also limit the levels that are actually displayed. To do this you can pass an optional `start`, and `depth` value to the `toc()`, `toc_ordered()` , `toc_items()` and `add_anchors()` Twig functions: + +```twig +{% set table_of_contents = toc(page.content, 3, 3) %} +``` + +This will only display `H3` , and **3** levels deeper (up to `H5`) in the TOC output. + +## Credits + +The majority of this plugin's functionality is provided by the [PHP TOC Generator](https://github.com/caseyamcl/toc) library by [Casey McLaughlin](https://github.com/caseyamcl). So Thanks for making this plugin for Grav possible! + + diff --git a/plugins/page-toc/assets/page-toc-anchors.css b/plugins/page-toc/assets/page-toc-anchors.css new file mode 100644 index 0000000..84c66dc --- /dev/null +++ b/plugins/page-toc/assets/page-toc-anchors.css @@ -0,0 +1,22 @@ +.toc-anchor { + transition: hover 0.5s ease; + position: absolute; + opacity: 0; +} + +.toc-anchor.after { + margin-left: 5px; +} + +.toc-anchor.before { + margin-left: -22px; + padding-right: 8px; +} + +.toc-anchor:after { + content: attr(data-anchor-icon); +} + +:hover > .toc-anchor, .toc-anchor:focus { + opacity: .5; +} \ No newline at end of file diff --git a/plugins/page-toc/assets/page-toc-anchors.js b/plugins/page-toc/assets/page-toc-anchors.js new file mode 100644 index 0000000..ec5c459 --- /dev/null +++ b/plugins/page-toc/assets/page-toc-anchors.js @@ -0,0 +1,10 @@ +document.body.addEventListener('click', (event) => { + if (typeof event.target.dataset.anchorIcon !== 'undefined') { + const href = event.target.href; + navigator.clipboard.writeText(href) + .then(() => {}) + .catch((error) => { + console.error('Unable to copy to clipboard the anchor', error); + }); + } +}, true); \ No newline at end of file diff --git a/plugins/page-toc/assets/page-toc.png b/plugins/page-toc/assets/page-toc.png new file mode 100644 index 0000000..5140719 Binary files /dev/null and b/plugins/page-toc/assets/page-toc.png differ diff --git a/plugins/page-toc/blueprints.yaml b/plugins/page-toc/blueprints.yaml new file mode 100644 index 0000000..38ae211 --- /dev/null +++ b/plugins/page-toc/blueprints.yaml @@ -0,0 +1,170 @@ +name: Page Toc +type: plugin +slug: page-toc +version: 3.2.0 +description: Generate a table of contents and anchors from a page +icon: list +author: + name: Trilby Media, LLC + email: hello@trilby.media + url: http://trilby.media +homepage: http://trilby.media +keywords: grav, plugin, toc, anchors +bugs: https://github.com/trilbymedia/grav-plugin-page-toc/issues +docs: https://github.com/trilbymedia/grav-plugin-page-toc/blob/develop/README.md +license: MIT + +dependencies: + - { name: grav, version: '>=1.7.26' } + +form: + validation: strict + fields: + enabled: + type: toggle + label: PLUGIN_ADMIN.PLUGIN_STATUS + highlight: 1 + default: 1 + options: + 1: PLUGIN_ADMIN.ENABLED + 0: PLUGIN_ADMIN.DISABLED + validate: + type: bool + include_css: + type: toggle + label: PLUGIN_PAGE_TOC.INCLUDE_CSS + highlight: 1 + default: 1 + options: + 1: PLUGIN_ADMIN.ENABLED + 0: PLUGIN_ADMIN.DISABLED + validate: + type: bool + active: + type: toggle + label: PLUGIN_PAGE_TOC.ACTIVE_BY_DEFAULT + highlight: 1 + default: 1 + options: + 1: PLUGIN_ADMIN.ENABLED + 0: PLUGIN_ADMIN.DISABLED + validate: + type: bool + + toc_section: + type: section + title: PLUGIN_PAGE_TOC.TOC_SECTION + underline: true + + fields: + start: + type: select + label: PLUGIN_PAGE_TOC.START_TOC_HEADERS + help: PLUGIN_PAGE_TOC.START_TOC_HEADERS_HELP + size: x-small + classes: fancy + options: + 1: H1 + 2: H2 + 3: H3 + 4: H4 + 5: H5 + 6: H6 + validate: + type: number + depth: + type: range + label: PLUGIN_PAGE_TOC.DEPTH_TOC_HEADERS + help: PLUGIN_PAGE_TOC.DEPTH_TOC_HEADERS_HELP + classes: fancy + validate: + min: 1 + max: 6 + hclass: + type: text + label: PLUGIN_PAGE_TOC.HEADER_CSS_CLASSES + help: PLUGIN_PAGE_TOC.HEADER_CSS_CLASSES_HELP + + anchors_section: + type: section + title: PLUGIN_PAGE_TOC.ANCHORS_SECTION + underline: true + + fields: + anchors.start: + type: select + label: PLUGIN_PAGE_TOC.START_ANCHOR_HEADERS + size: x-small + classes: fancy + options: + 1: H1 + 2: H2 + 3: H3 + 4: H4 + 5: H5 + 6: H6 + validate: + type: number + anchors.depth: + type: range + label: PLUGIN_PAGE_TOC.DEPTH_ANCHOR_HEADERS + help: PLUGIN_PAGE_TOC.DEPTH_ANCHOR_HEADERS_HELP + classes: fancy + validate: + min: 1 + max: 6 + anchors.link: + type: toggle + label: PLUGIN_PAGE_TOC.LINK_ANCHOR_HEADERS + highlight: 1 + default: 1 + options: + 1: Enabled + 0: Disabled + validate: + type: bool + anchors.aria: + type: text + label: PLUGIN_PAGE_TOC.ARIA_LABEL + default: Anchor + anchors.class: + type: text + label: PLUGIN_PAGE_TOC.ANCHORS_CLASS + help: PLUGIN_PAGE_TOC.ANCHORS_CLASS_HELP + anchors.icon: + type: text + label: PLUGIN_PAGE_TOC.ANCHORS_ICON + help: PLUGIN_PAGE_TOC.ANCHORS_ICON_HELP + default: '#' + size: x-small + anchors.position: + type: select + label: PLUGIN_PAGE_TOC.ANCHORS_POSITION + help: PLUGIN_PAGE_TOC.ANCHORS_POSITION_HELP + size: small + default: after + options: + before: PLUGIN_PAGE_TOC.BEFORE_TEXT + after: PLUGIN_PAGE_TOC.AFTER_TEXT + anchors.copy_to_clipboard: + type: toggle + label: PLUGIN_PAGE_TOC.COPY_TO_CLIPBOARD + help: PLUGIN_PAGE_TOC.COPY_TO_CLIPBOARD_HELP + highlight: 1 + default: 1 + options: + 1: Enabled + 0: Disabled + validate: + type: bool + anchors.slug_maxlen: + type: number + label: PLUGIN_PAGE_TOC.SLUG_MAXLEN + help: PLUGIN_PAGE_TOC.SLUG_MAXLEN_HELP + size: x-small + default: 25 + append: 'chars' + anchors.slug_prefix: + type: text + label: PLUGIN_PAGE_TOC.SLUG_PREFIX + help: PLUGIN_PAGE_TOC.SLUG_PREFIX_HELP diff --git a/plugins/page-toc/blueprints/page-toc.yaml b/plugins/page-toc/blueprints/page-toc.yaml new file mode 100644 index 0000000..de6998f --- /dev/null +++ b/plugins/page-toc/blueprints/page-toc.yaml @@ -0,0 +1,142 @@ +form: + fields: + tabs: + fields: + advanced: + type: tab + + fields: + header.page-toc-section: + type: section + title: Page Table-of-Contents + underline: true + + fields: + header.page-toc.active: + toggleable: true + type: toggle + label: PLUGIN_PAGE_TOC.ACTIVE_BY_DEFAULT_PAGE + help: PLUGIN_PAGE_TOC.ACTIVE_BY_DEFAULT_PAGE_HELP + data-default@: ['\Grav\Plugin\PageTOCPlugin::configVar', 'active'] + options: + 1: PLUGIN_ADMIN.YES + 0: PLUGIN_ADMIN.NO + validate: + type: bool + + header.page-toc.start: + toggleable: true + type: select + size: x-small + label: PLUGIN_PAGE_TOC.START_TOC_HEADERS + help: PLUGIN_PAGE_TOC.START_TOC_HEADERS_HELP + data-default@: ['\Grav\Plugin\PageTOCPlugin::configVar', 'start'] + options: + 1: H1 + 2: H2 + 3: H3 + 4: H4 + 5: H5 + 6: H6 + validate: + type: number + header.page-toc.depth: + toggleable: true + type: range + label: PLUGIN_PAGE_TOC.DEPTH_TOC_HEADERS + help: PLUGIN_PAGE_TOC.DEPTH_TOC_HEADERS_HELP + data-default@: ['\Grav\Plugin\PageTOCPlugin::configVar', 'depth'] + validate: + min: 1 + max: 6 + header.page-toc.hclass: + toggleable: true + type: text + label: PLUGIN_PAGE_TOC.HEADER_CSS_CLASSES + help: PLUGIN_PAGE_TOC.HEADER_CSS_CLASSES_HELP + data-default@: ['\Grav\Plugin\PageTOCPlugin::configVar', 'hclass'] + + header.page-toc-anchors-section: + type: section + title: PLUGIN_PAGE_TOC.PAGE_ANCHORS_SECTION + underline: true + + fields: + header.page-toc.anchors.start: + toggleable: true + type: select + label: PLUGIN_PAGE_TOC.START_ANCHOR_HEADERS + size: x-small + classes: fancy + data-default@: ['\Grav\Plugin\PageTOCPlugin::configVar', 'anchors.start'] + options: + 1: H1 + 2: H2 + 3: H3 + 4: H4 + 5: H5 + 6: H6 + validate: + type: number + header.page-toc.anchors.depth: + toggleable: true + type: range + label: PLUGIN_PAGE_TOC.DEPTH_ANCHOR_HEADERS + classes: fancy + data-default@: ['\Grav\Plugin\PageTOCPlugin::configVar', 'anchors.depth'] + validate: + min: 1 + max: 6 + header.page-toc.anchors.link: + toggleable: true + type: toggle + label: PLUGIN_PAGE_TOC.LINK_ANCHOR_HEADERS + highlight: 1 + data-default@: ['\Grav\Plugin\PageTOCPlugin::configVar', 'anchors.link'] + options: + 1: Enabled + 0: Disabled + validate: + type: bool + header.page-toc.anchors.aria: + toggleable: true + type: text + label: PLUGIN_PAGE_TOC.ARIA_LABEL + data-default@: ['\Grav\Plugin\PageTOCPlugin::configVar', 'anchors.aria'] + header.page-toc.anchors.class: + toggleable: true + type: text + label: PLUGIN_PAGE_TOC.ANCHORS_CLASS + help: PLUGIN_PAGE_TOC.ANCHORS_CLASS_HELP + data-default@: ['\Grav\Plugin\PageTOCPlugin::configVar', 'anchors.class'] + header.page-toc.anchors.icon: + toggleable: true + type: text + label: PLUGIN_PAGE_TOC.ANCHORS_ICON + help: PLUGIN_PAGE_TOC.ANCHORS_ICON_HELP + data-default@: ['\Grav\Plugin\PageTOCPlugin::configVar', 'anchors.icon'] + size: x-small + header.page-toc.anchors.position: + toggleable: true + type: select + label: PLUGIN_PAGE_TOC.ANCHORS_POSITION + help: PLUGIN_PAGE_TOC.ANCHORS_POSITION_HELP + size: small + data-default@: ['\Grav\Plugin\PageTOCPlugin::configVar', 'anchors.position'] + options: + before: PLUGIN_PAGE_TOC.BEFORE_TEXT + after: PLUGIN_PAGE_TOC.AFTER_TEXT + header.page-toc.anchors.slug_maxlen: + toggleable: true + type: number + label: PLUGIN_PAGE_TOC.SLUG_MAXLEN + help: PLUGIN_PAGE_TOC.SLUG_MAXLEN_HELP + size: x-small + data-default@: ['\Grav\Plugin\PageTOCPlugin::configVar', 'anchors.slug_maxlen'] + append: 'chars' + header.page-toc.anchors.slug_prefix: + toggleable: true + type: text + label: PLUGIN_PAGE_TOC.SLUG_PREFIX + help: PLUGIN_PAGE_TOC.SLUG_PREFIX_HELP + data-default@: ['\Grav\Plugin\PageTOCPlugin::configVar', 'anchors.slug_prefix'] \ No newline at end of file diff --git a/plugins/page-toc/classes/HtmlHelper.php b/plugins/page-toc/classes/HtmlHelper.php new file mode 100644 index 0000000..14b9b26 --- /dev/null +++ b/plugins/page-toc/classes/HtmlHelper.php @@ -0,0 +1,89 @@ + + * + * Licensed under MIT, see LICENSE. + */ + +declare(strict_types=1); + +namespace Grav\Plugin\PageToc; + +use ArrayIterator; +use DOMDocument; +use DomElement; +use DOMXPath; + +/** + * Trait that helps with HTML-related operations + * + * @package TOC + */ +trait HtmlHelper +{ + protected function getHTMLParser($markup) + { + libxml_use_internal_errors(true); + $domDocument = new \DOMDocument(); + $domDocument->loadHTML(mb_convert_encoding("$markup", 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); + $domDocument->preserveWhiteSpace = true; + return $domDocument; + } + + /** + * Convert a topLevel and depth to H1..H6 tags array + * + * @param int $topLevel + * @param int $depth + * @return array|string[] Array of header tags; ex: ['h1', 'h2', 'h3'] + */ + protected function determineHeaderTags(int $topLevel, int $depth): array + { + $desired = range((int) $topLevel, (int) $topLevel + ((int) $depth - 1)); + $allowed = [1, 2, 3, 4, 5, 6]; + + return array_map(function ($val) { + return 'h' . $val; + }, array_intersect($desired, $allowed)); + } + + + + /** + * Traverse Header Tags in DOM Document + * + * @param DOMDocument $domDocument + * @param int $topLevel + * @param int $depth + * @return ArrayIterator + */ + protected function traverseHeaderTags(DOMDocument $domDocument, int $topLevel, int $depth): ArrayIterator + { + $xQueryResults = new DOMXPath($domDocument); + + $xpathQuery = sprintf( + "//*[%s]", + implode(' or ', array_map(function ($v) { + return sprintf('local-name() = "%s"', $v); + }, $this->determineHeaderTags($topLevel, $depth))) + ); + + $nodes = []; + $xQueryResults = $xQueryResults->query($xpathQuery); + + if ($xQueryResults) { + foreach ($xQueryResults as $node) { + $nodes[] = $node; + } + return new ArrayIterator($nodes); + } else { + return new ArrayIterator([]); + } + } +} diff --git a/plugins/page-toc/classes/MarkupFixer.php b/plugins/page-toc/classes/MarkupFixer.php new file mode 100644 index 0000000..ceef666 --- /dev/null +++ b/plugins/page-toc/classes/MarkupFixer.php @@ -0,0 +1,82 @@ + + * + * Licensed under MIT, see LICENSE. + */ + +declare(strict_types=1); + +namespace Grav\Plugin\PageToc; + +use DOMElement; +use RuntimeException; +use Cocur\Slugify\SlugifyInterface; + +/** + * TOC Markup Fixer adds `id` attributes to all H1...H6 tags where they do not + * already exist + * + * @author Casey McLaughlin + */ +class MarkupFixer +{ + use HtmlHelper; + + /** + * Fix markup + * + * @param string $markup + * @param int $start + * @param int $depth + * @param array $options + * @return string Markup with added IDs + * @throws RuntimeException + */ + public function fix(string $markup, array $options = []): ?string + { + $start = (int) $options['start'] ?? 1; + $depth = (int) $options['depth'] ?? 6; + $domDocument = $this->getHTMLParser($markup); + $slugger = new UniqueSlugify(); + + /** @var DOMElement $node */ + foreach ($this->traverseHeaderTags($domDocument, $start, $depth) as $node) { + if ($node->getAttribute('id')) { + $slug = $node->getAttribute('id'); + } else { + $slug = $slugger->slugify($node->getAttribute('title') ?: $node->textContent, $options); + } + + $node->setAttribute('id', $slug); + + if ($options['hclass']) { + $class = $node->getAttribute('class'); + $node->setAttribute('class', trim("$class {$options['hclass']}")); + } + + if ($options['link']) { + $link = $domDocument->createElement("a"); + $class = isset($options['class']) ? " {$options['class']}" : ""; + $link->setAttribute('href', "#$slug"); + $link->setAttribute('class', "toc-anchor {$options['position']}$class"); + $link->setAttribute('data-anchor-icon', $options['icon']); + $link->setAttribute('aria-label', $options['aria']); + if ($options['position'] == 'after') { + $node->appendChild($link); + } else { + $node->insertBefore($link, $node->firstChild); + } + } + } + + $markup = $domDocument->saveHTML($domDocument->getElementsByTagName('page-toc')->item(0)); + return str_replace(['', ''], '', $markup); + } +} diff --git a/plugins/page-toc/classes/OrderedListRenderer.php b/plugins/page-toc/classes/OrderedListRenderer.php new file mode 100644 index 0000000..f44e58a --- /dev/null +++ b/plugins/page-toc/classes/OrderedListRenderer.php @@ -0,0 +1,68 @@ + + * + * Licensed under MIT, see LICENSE. + */ + +declare(strict_types=1); + +namespace Grav\Plugin\PageToc; + +use Knp\Menu\ItemInterface; +use Knp\Menu\Renderer\ListRenderer; + +use function str_repeat; + +/** + * Class OrderedListRenderer + * + * @package TOC + */ +class OrderedListRenderer extends ListRenderer +{ + /** + * @param ItemInterface $item + * @param array $attributes + * @param array $options + * @return string + */ + protected function renderList(ItemInterface $item, array $attributes, array $options): string + { + if (!$item->hasChildren() || 0 === $options['depth'] || !$item->getDisplayChildren()) { + return ''; + } + + $html = $this->format( + 'renderHtmlAttributes($attributes) . '>', + 'ol', + $item->getLevel(), + $options + ); + + $html .= $this->renderChildren($item, $options); + $html .= $this->format('', 'ol', $item->getLevel(), $options); + + return $html; + } + + /** + * @param string $html + * @param string $type + * @param int $level + * @param array $options + * @return string + */ + protected function format(string $html, string $type, int $level, array $options): string + { + return $type === 'ol' + ? str_repeat(' ', $level * 4) . $html . "\n" + : parent::format($html, $type, $level, $options); + } +} diff --git a/plugins/page-toc/classes/TocGenerator.php b/plugins/page-toc/classes/TocGenerator.php new file mode 100644 index 0000000..7621835 --- /dev/null +++ b/plugins/page-toc/classes/TocGenerator.php @@ -0,0 +1,179 @@ + + * + * Licensed under MIT, see LICENSE. + */ + +declare(strict_types=1); + +namespace Grav\Plugin\PageToc; + +use Knp\Menu\ItemInterface; +use Knp\Menu\Matcher\Matcher; +use Knp\Menu\MenuFactory; +use Knp\Menu\MenuItem; +use Knp\Menu\Renderer\ListRenderer; +use Knp\Menu\Renderer\RendererInterface; + +/** + * Table Of Contents Generator generates TOCs from HTML Markup + * + * @author Casey McLaughlin + */ +class TocGenerator +{ + use HtmlHelper; + + private const DEFAULT_NAME = 'TOC'; + + /** + * @var MenuFactory + */ + private $menuFactory; + + /** + * Constructor + */ + public function __construct() + { + $this->menuFactory = new MenuFactory(); + } + + /** + * Get Menu + * + * Returns a KNP Menu object, which can be traversed or rendered + * + * @param string $markup Content to get items fro $this->getItems($markup, $topLevel, $depth)m + * @param int $topLevel Top Header (1 through 6) + * @param int $depth Depth (1 through 6) + * @return ItemInterface KNP Menu + */ + public function getMenu(string $markup, int $topLevel = 1, int $depth = 6): ItemInterface + { + $menu = $this->menuFactory->createItem(static::DEFAULT_NAME); + + if (trim($markup) == '') { + return $menu; + } + + $tagsToMatch = $this->determineHeaderTags($topLevel, $depth); + $lastElem = $menu; + + $domDocument = $this->getHTMLParser($markup); + + foreach ($this->traverseHeaderTags($domDocument, $topLevel, $depth) as $i => $node) { + if (! $node->hasAttribute('id')) { + continue; + } + + $tagName = $node->tagName; + $level = array_search(strtolower($tagName), $tagsToMatch) + 1; + + /** @var MenuItem $parent */ + if ($level == 1) { + $parent = $menu; + } elseif ($level == $lastElem->getLevel()) { + $parent = $lastElem->getParent(); + } elseif ($level > $lastElem->getLevel()) { + $parent = $lastElem; + for ($i = $lastElem->getLevel(); $i < ($level - 1); $i++) { + $parent = $parent->addChild(''); + } + } else { //if ($level < $lastElem->getLevel()) + $parent = $lastElem->getParent(); + while ($parent->getLevel() > $level - 1) { + $parent = $parent->getParent(); + } + } + + $lastElem = $parent->addChild( + $node->getAttribute('id'), + [ + 'label' => $node->getAttribute('title') ?: $node->textContent, + 'uri' => '#' . $node->getAttribute('id') + ] + ); + } + + return $this->trimMenu($menu); + } + + /** + * Trim empty items from the menu + * + * @param ItemInterface $menuItem + * @return ItemInterface + */ + protected function trimMenu(ItemInterface $menuItem): ItemInterface + { + // if any of these circumstances are true, then just bail and return the menu item + if ( + count($menuItem->getChildren()) === 0 + or count($menuItem->getChildren()) > 1 + or ! empty($menuItem->getFirstChild()->getLabel()) + ) { + return $menuItem; + } + + // otherwise, find the first level where there is actual content and use that. + while (count($menuItem->getChildren()) == 1 && empty($menuItem->getFirstChild()->getLabel())) { + $menuItem = $menuItem->getFirstChild(); + } + + return $menuItem; + } + + /** + * Get HTML menu in unordered list form + * + * @param string $markup Content to get items from + * @param int $topLevel Top Header (1 through 6) + * @param int $depth Depth (1 through 6) + * @param RendererInterface|null $renderer + * @param bool $ordered + * @return string HTML
  • items + */ + public function getHtmlMenu( + string $markup, + int $topLevel = 1, + int $depth = 6, + ?RendererInterface $renderer = null, + bool $ordered = false + ): string { + if (! $renderer) { + $options = ['currentClass' => 'active', 'ancestorClass' => 'active_ancestor']; + $renderer = $ordered + ? new OrderedListRenderer(new Matcher(), $options) + : new ListRenderer(new Matcher(), $options); + } + + $menu = $this->getMenu($markup, $topLevel, $depth); + return $renderer->render($menu); + } + + /** + * Get HTML menu in ordered list form + * + * @param string $markup Content to get items from + * @param int $topLevel Top Header (1 through 6) + * @param int $depth Depth (1 through 6) + * @param RendererInterface|null $renderer + * @return string HTML
  • items + */ + public function getOrderedHtmlMenu( + string $markup, + int $topLevel = 1, + int $depth = 6, + RendererInterface $renderer = null + ): string { + return $this->getHtmlMenu($markup, $topLevel, $depth, $renderer, true); + } +} diff --git a/plugins/page-toc/classes/UniqueSlugify.php b/plugins/page-toc/classes/UniqueSlugify.php new file mode 100644 index 0000000..9c15acd --- /dev/null +++ b/plugins/page-toc/classes/UniqueSlugify.php @@ -0,0 +1,74 @@ + + * + * Licensed under MIT, see LICENSE. + */ + +declare(strict_types=1); + +namespace Grav\Plugin\PageToc; + +use Cocur\Slugify\Slugify; +use Cocur\Slugify\SlugifyInterface; + +/** + * UniqueSluggify creates slugs from text without repeating the same slug twice per instance + */ +class UniqueSlugify implements SlugifyInterface +{ + protected $slugify; + protected $used; + + protected $options; + + /** + * Constructor + * + * @param SlugifyInterface|null $slugify + */ + public function __construct() + { + $this->used = array(); + $this->slugify = new Slugify(); + } + + /** + * Slugify + * + * @param string $text + * @param array|null $options + * @return string + */ + public function slugify($text, $options = null): string + { + $slugged = $this->slugify->slugify($text, $options); + + $maxlen = $options['maxlen'] ?? null; + $prefix = $options['prefix'] ?? null; + + if (is_int($maxlen) && strlen($slugged) > $maxlen) { + $slugged = substr($slugged, 0, $maxlen); + } + + if (isset($prefix)) { + $slugged = $prefix . $slugged; + } + + $count = 1; + $orig = $slugged; + while (in_array($slugged, $this->used)) { + $slugged = $orig . '-' . $count; + $count++; + } + + $this->used[] = $slugged; + return $slugged; + } +} diff --git a/plugins/page-toc/classes/shortcodes/AnchorShortcode.php b/plugins/page-toc/classes/shortcodes/AnchorShortcode.php new file mode 100644 index 0000000..4702951 --- /dev/null +++ b/plugins/page-toc/classes/shortcodes/AnchorShortcode.php @@ -0,0 +1,51 @@ +shortcode->getRawHandlers()->add('anchor', function(ProcessedShortcode $sc) { + + $id = $this->cleanParam($sc->getParameter('id', $sc->getBbCode())); + $tag = $this->cleanParam($sc->getParameter('tag')); + $prefix = $this->cleanParam($sc->getParameter('prefix', PageTOCPlugin::configVar('anchors.slug_prefix'))); + $class = $this->cleanParam($sc->getParameter('class', 'inline-anchor')); + $aria = PageTOCPlugin::configVar('anchors.aria'); + $content = $sc->getContent(); + + $slugger = new UniqueSlugify(); + + if (is_null($id)) { + $id = $slugger->slugify(strip_tags($content)); + } + + if (isset($prefix)) { + $id = $prefix . $id; + } + + if ($tag) { + $output = "<$tag id=\"$id\" class=\"$class\">$content"; + } else { + $output = "$content"; + } + + return $output; + }); + $this->shortcode->getRawHandlers()->addAlias('#', 'anchor'); + } + + /** + * @param $param + * @return string + */ + protected function cleanParam($param) + { + return trim(html_entity_decode($param), '"'); + } +} \ No newline at end of file diff --git a/plugins/page-toc/composer.json b/plugins/page-toc/composer.json new file mode 100644 index 0000000..419b2fd --- /dev/null +++ b/plugins/page-toc/composer.json @@ -0,0 +1,31 @@ +{ + "name": "trilbymedia/page-toc", + "type": "grav-plugin", + "description": "Page TOC plugin", + "keywords": ["plugin"], + "homepage": "https://github.com/trilbymedia/grav-plugin-page-toc", + "license": "MIT", + "authors": [ + { + "name": "Trilby Media", + "email": "hello@trilby.media", + "role": "Developer" + } + ], + "require": { + "cocur/slugify": "^3.0|^4.0", + "knplabs/knp-menu": "^3.2", + "php": ">=7.3.6" + }, + "autoload": { + "psr-4": { + "Grav\\Plugin\\PageToc\\": "classes/" + }, + "classmap": ["page-toc.php"] + }, + "config": { + "platform": { + "php": "7.3.6" + } + } +} diff --git a/plugins/page-toc/composer.lock b/plugins/page-toc/composer.lock new file mode 100644 index 0000000..7c20d25 --- /dev/null +++ b/plugins/page-toc/composer.lock @@ -0,0 +1,170 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "8a2c6e66a1071ca85fae3951c0161cee", + "packages": [ + { + "name": "cocur/slugify", + "version": "v4.0.0", + "source": { + "type": "git", + "url": "https://github.com/cocur/slugify.git", + "reference": "3f1ffc300f164f23abe8b64ffb3f92d35cec8307" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cocur/slugify/zipball/3f1ffc300f164f23abe8b64ffb3f92d35cec8307", + "reference": "3f1ffc300f164f23abe8b64ffb3f92d35cec8307", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=7.0" + }, + "conflict": { + "symfony/config": "<3.4 || >=4,<4.3", + "symfony/dependency-injection": "<3.4 || >=4,<4.3", + "symfony/http-kernel": "<3.4 || >=4,<4.3", + "twig/twig": "<2.12.1" + }, + "require-dev": { + "laravel/framework": "~5.1", + "latte/latte": "~2.2", + "league/container": "^2.2.0", + "mikey179/vfsstream": "~1.6.8", + "mockery/mockery": "^1.3", + "nette/di": "~2.4", + "phpunit/phpunit": "^5.7.27", + "pimple/pimple": "~1.1", + "plumphp/plum": "~0.1", + "symfony/config": "^3.4 || ^4.3 || ^5.0", + "symfony/dependency-injection": "^3.4 || ^4.3 || ^5.0", + "symfony/http-kernel": "^3.4 || ^4.3 || ^5.0", + "twig/twig": "^2.12.1 || ~3.0", + "zendframework/zend-modulemanager": "~2.2", + "zendframework/zend-servicemanager": "~2.2", + "zendframework/zend-view": "~2.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Cocur\\Slugify\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florian Eckerstorfer", + "email": "florian@eckerstorfer.co", + "homepage": "https://florian.ec" + }, + { + "name": "Ivo Bathke", + "email": "ivo.bathke@gmail.com" + } + ], + "description": "Converts a string into a slug.", + "keywords": [ + "slug", + "slugify" + ], + "support": { + "issues": "https://github.com/cocur/slugify/issues", + "source": "https://github.com/cocur/slugify/tree/master" + }, + "time": "2019-12-14T13:04:14+00:00" + }, + { + "name": "knplabs/knp-menu", + "version": "v3.3.0", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/KnpMenu.git", + "reference": "8bd3dc2afa22c65617c563c5e25e62d6e23e98c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/KnpMenu/zipball/8bd3dc2afa22c65617c563c5e25e62d6e23e98c7", + "reference": "8bd3dc2afa22c65617c563c5e25e62d6e23e98c7", + "shasum": "" + }, + "require": { + "php": "^7.3 || ^8.0" + }, + "conflict": { + "twig/twig": "<1.40 || >=2,<2.9" + }, + "require-dev": { + "phpunit/phpunit": "^9.5", + "psr/container": "^1.0", + "symfony/http-foundation": "^4.4 || ^5.0 || ^6.0", + "symfony/phpunit-bridge": "^5.3", + "symfony/routing": "^4.4 || ^5.0 || ^6.0", + "twig/twig": "^1.40 || ^2.9 || ^3.0" + }, + "suggest": { + "twig/twig": "for the TwigRenderer and the integration with your templates" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Knp\\Menu\\": "src/Knp/Menu" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KnpLabs", + "homepage": "https://knplabs.com" + }, + { + "name": "Christophe Coevoet", + "email": "stof@notk.org" + }, + { + "name": "The Community", + "homepage": "https://github.com/KnpLabs/KnpMenu/contributors" + } + ], + "description": "An object oriented menu library", + "homepage": "https://knplabs.com", + "keywords": [ + "menu", + "tree" + ], + "support": { + "issues": "https://github.com/KnpLabs/KnpMenu/issues", + "source": "https://github.com/KnpLabs/KnpMenu/tree/v3.3.0" + }, + "time": "2021-10-23T15:01:04+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=7.3.6" + }, + "platform-dev": [], + "platform-overrides": { + "php": "7.3.6" + }, + "plugin-api-version": "2.1.0" +} diff --git a/plugins/page-toc/languages.yaml b/plugins/page-toc/languages.yaml new file mode 100644 index 0000000..0ec73f8 --- /dev/null +++ b/plugins/page-toc/languages.yaml @@ -0,0 +1,38 @@ +de: + PLUGIN_PAGE_TOC: + TABLE_OF_CONTENTS: Inhaltsverzeichnis +en: + PLUGIN_PAGE_TOC: + TABLE_OF_CONTENTS: Table of Contents + INCLUDE_CSS: 'Include CSS' + ACTIVE_BY_DEFAULT: 'Anchors generated by default' + ACTIVE_BY_DEFAULT_PAGE: 'Anchors generated for this page' + ACTIVE_BY_DEFAULT_PAGE_HELP: 'If the default setting is disabled, you can enable on this page, or vice versa' + TOC_SECTION: 'Table of Contents Configuration' + START_TOC_HEADERS: 'Start TOC headers' + START_TOC_HEADERS_HELP: 'The Header level to start the TOC from' + DEPTH_TOC_HEADERS: 'Depth of TOC headers' + DEPTH_TOC_HEADERS_HELP: 'The number of headers levels from the ''start'' to include in the TOC' + HEADER_CSS_CLASSES: 'Header CSS classes' + HEADER_CSS_CLASSES_HELP: 'Any custom classes to add to the header tags when IDs for slugs are added' + ANCHORS_SECTION: 'Anchors Configuration' + START_ANCHOR_HEADERS: 'Start Anchor headers' + DEPTH_ANCHOR_HEADERS: 'Depth of Anchor headers' + LINK_ANCHOR_HEADERS: 'Link Anchors' + ARIA_LABEL: 'Aria Label' + ANCHORS_CLASS: 'Custom CSS classes for anchors' + ANCHORS_CLASS_HELP: 'Any custom classes to add to the anchor tags' + ANCHORS_ICON: 'Anchor icon symbol' + ANCHORS_ICON_HELP: 'Can be any text character, symbol, unicode character or even emjoi. leave blank if you intend to style with CSS.' + ANCHORS_POSITION: 'Anchor Position' + ANCHORS_POSITION_HELP: 'Position to put the anchor, `before|after`' + ANCHORS_COPY_TO_CLIPBOARD: 'Copy to Clipboard' + ANCHORS_COPY_TO_CLIPBOARD_HELP: 'When clicking an anchor, it will also copy to clipboard the full URL. Convenient for sharing/opening in new tab' + BEFORE_TEXT: 'Before text' + AFTER_TEXT: 'After text' + SLUG_MAXLEN: 'Slug max-length' + SLUG_MAXLEN_HELP: 'Max length of slugs used for anchors' + SLUG_PREFIX: 'Slug prefix' + SLUG_PREFIX_HELP: 'A prefix used in front of generated slugs' + PAGE_ANCHORS_SECTION: 'Page Anchors Configuration' + COPY_TO_CLIPBOARD: 'Copy to Clipboard' diff --git a/plugins/page-toc/page-toc.php b/plugins/page-toc/page-toc.php new file mode 100644 index 0000000..f694fc8 --- /dev/null +++ b/plugins/page-toc/page-toc.php @@ -0,0 +1,222 @@ + ['onPluginsInitialized', 0] + ]; + } + + /** + * Composer autoload + * + * @return ClassLoader + */ + public function autoload(): ClassLoader + { + return require __DIR__ . '/vendor/autoload.php'; + } + + /** + * Initialize the plugin + */ + public function onPluginsInitialized() + { + // Don't proceed if we are in the admin plugin + if ($this->isAdmin()) { + $this->enable([ + 'onBlueprintCreated' => ['onBlueprintCreated', 0], + ]); + return; + } + + // Enable the main event we are interested in + $this->enable([ + 'onShortcodeHandlers' => ['onShortcodeHandlers', 0], + 'onTwigInitialized' => ['onTwigInitialized', 0], + 'onTwigTemplatePaths' => ['onTwigTemplatePaths', 0], + 'onTwigSiteVariables' => ['onTwigSiteVariables', 0], + 'onPageContentProcessed' => ['onPageContentProcessed', -20], + ]); + } + + public function onShortcodeHandlers() + { + $this->grav['shortcode']->registerAllShortcodes(__DIR__ . '/classes/shortcodes'); + } + + public function onPageContentProcessed(Event $event) + { + /** @var PageInterface $page */ + $page = $event['page']; + + $content = $page->content(); + $shortcode_exists = preg_match($this->toc_regex, $content); + $active = $this->configVar('active', $page, false); + + // Set ID anchors if needed + if ($active || $shortcode_exists) { + $this->registerTwigFunctions(); + $markup_fixer = new MarkupFixer(); + $content = $markup_fixer->fix($content, $this->getAnchorOptions($page)); + $page->setRawContent($content); + } + + // Replace shortcode if found + if ($shortcode_exists) { + $toc = $this->grav['twig']->processTemplate('components/page-toc.html.twig', ['page' => $page, 'active' => true]); + $content = preg_replace($this->toc_regex, $toc, $content); + $page->setRawContent($content); + } + } + + public function onTwigInitialized() + { + $this->registerTwigFunctions(); + } + + public function onTwigSiteVariables() + { + if ($this->grav['config']->get('plugins.page-toc.include_css')) { + $this->grav['assets']->addCss('plugin://page-toc/assets/page-toc-anchors.css'); + } + if ($this->grav['config']->get('plugins.page-toc.anchors.copy_to_clipboard')) { + $this->grav['assets']->addJs('plugin://page-toc/assets/page-toc-anchors.js', ['group' => 'bottom', 'defer' => 'defer']); + } + } + + public function registerTwigFunctions() + { + static $functions_registered; + + if ($functions_registered) { + return; + } + + $this->generator = new TocGenerator(); + $this->fixer = new MarkupFixer(); + $twig = $this->grav['twig']->twig(); + + $twig->addFunction(new TwigFunction('toc', function ($markup, $start = null, $depth = null) { + $options = $this->getTocOptions(null, $start, $depth); + return $this->generator->getHtmlMenu($markup, $options['start'], $options['depth']); + }, ['is_safe' => ['html']])); + + $twig->addFunction(new TwigFunction('toc_ordered', function ($markup, $start = null, $depth = null) { + $options = $this->getTocOptions(null, $start, $depth); + return $this->generator->getHtmlMenu($markup, $options['start'], $options['depth'], null, true); + }, ['is_safe' => ['html']])); + + $twig->addFunction(new TwigFunction('toc_items', function ($markup, $start = null, $depth = null) { + $options = $this->getTocOptions(null, $start, $depth); + return $this->generator->getMenu($markup, $options['start'], $options['depth']); + })); + + $twig->addFunction(new TwigFunction('add_anchors', function ($markup, $start = null, $depth = null) { + $options = $this->getAnchorOptions(null, $start, $depth); + return $this->fixer->fix($markup, $options); + }, ['is_safe' => ['html']])); + + $twig->addFunction(new TwigFunction('toc_config_var', function ($var) { + return static::configVar($var); + })); + + $functions_registered = true; + } + + public function onTwigTemplatePaths() + { + $this->grav['twig']->twig_paths[] = __DIR__ . '/templates'; + } + + /** + * Extend page blueprints with TOC options. + * + * @param Event $event + */ + public function onBlueprintCreated(Event $event) + { + static $inEvent = false; + + /** @var Data\Blueprint $blueprint */ + $blueprint = $event['blueprint']; + $form = $blueprint->form(); + + $advanced_tab_exists = isset($form['fields']['tabs']['fields']['advanced']); + + if (!$inEvent && $advanced_tab_exists) { + $inEvent = true; + $blueprints = new Data\Blueprints(__DIR__ . '/blueprints/'); + $extends = $blueprints->get('page-toc'); + $blueprint->extend($extends, true); + $inEvent = false; + } + } + + protected function getTocOptions(PageInterface $page = null, $start = null, $depth = null): array + { + $page = $page ?? $this->grav['page']; + return [ + 'start' => $start ?? $this->configVar('start', $page,1), + 'depth' => $depth ?? $this->configVar('depth', $page,6), + ]; + } + + protected function getAnchorOptions(PageInterface $page = null, $start = null, $depth = null): array + { + $page = $page ?? $this->grav['page']; + return [ + 'start' => (int) ($start ?? $this->configVar('anchors.start', $page,1)), + 'depth' => (int) ($depth ?? $this->configVar('anchors.depth', $page,6)), + 'hclass' => $this->configVar('hclass', $page,null), + 'link' => $this->configVar('anchors.link', $page,true), + 'position' => $this->configVar('anchors.position', $page,'before'), + 'aria' => $this->configVar('anchors.aria', $page,'Anchor'), + 'icon' => $this->configVar('anchors.icon', $page,'#'), + 'class' => $this->configVar('anchors.class', $page,null), + 'maxlen' => (int) ($this->configVar('anchors.slug_maxlen', $page,null)), + 'prefix' => $this->configVar('anchors.slug_prefix', $page,null), + ]; + } + + public static function configVar($var, $page = null, $default = null) + { + return Plugin::inheritedConfigOption('page-toc', $var, $page, $default); + } +} diff --git a/plugins/page-toc/page-toc.yaml b/plugins/page-toc/page-toc.yaml new file mode 100644 index 0000000..da89e23 --- /dev/null +++ b/plugins/page-toc/page-toc.yaml @@ -0,0 +1,17 @@ +enabled: true # Plugin enabled +include_css: true # Include CSS +active: true # Anchor IDs processed and generated for all pages +start: 1 # Start header tag level (1 = h1) for TOC +depth: 6 # Depth from start (2 = 2 levels deep) for TOC +hclass: # Custom Header TOC styling classes +anchors: # Anchor configuration + start: 1 # Start header tag level (1 = h1) + depth: 6 # Depth from start (2 = 2 levels deep) + link: true # Enabled auto-generation of clickable link with fragment + aria: Anchor # Aria label to use + class: # Custom Header anchor styling classes + icon: '#' # Icon to use, can be a symbol, emoji, ascii etc. + position: after # Position to put the anchor, `before|after` + copy_to_clipboard: false # Copy to clipboard functionality + slug_maxlen: 25 # Max length of slugs used for anchors + slug_prefix: # A prefix used in front of generated slugs diff --git a/plugins/page-toc/templates/components/page-toc.html.twig b/plugins/page-toc/templates/components/page-toc.html.twig new file mode 100644 index 0000000..00cf24e --- /dev/null +++ b/plugins/page-toc/templates/components/page-toc.html.twig @@ -0,0 +1,26 @@ +{% macro toc_loop(items) %} + {% import _self as self %} + {% for item in items %} + {% set class = loop.first ? 'first' : loop.last ? 'last' : null %} +
  • + {{ item.label }} + {% if item.children|length > 0 %} +
      + {{ _self.toc_loop(item.children) }} +
    + {% endif %} +
  • + {% endfor %} +{% endmacro %} + +{% if active or toc_config_var('active') %} +
    + {% set table_of_contents = toc_items(page.content) %} + {% if table_of_contents is not empty %} +

    {{ 'PLUGIN_PAGE_TOC.TABLE_OF_CONTENTS'|t }}

    +
      + {{ _self.toc_loop(table_of_contents.children) }} +
    + {% endif %} +
    +{% endif %} \ No newline at end of file diff --git a/plugins/page-toc/vendor/autoload.php b/plugins/page-toc/vendor/autoload.php new file mode 100644 index 0000000..dd3f5fe --- /dev/null +++ b/plugins/page-toc/vendor/autoload.php @@ -0,0 +1,7 @@ + Converts a string into a slug. + +[![Build Status](https://img.shields.io/travis/cocur/slugify.svg?style=flat)](https://travis-ci.org/cocur/slugify) +[![Windows Build status](https://ci.appveyor.com/api/projects/status/9yv498ff61byp742?svg=true)](https://ci.appveyor.com/project/florianeckerstorfer/slugify) +[![Scrutinizer Quality Score](https://img.shields.io/scrutinizer/g/cocur/slugify.svg?style=flat)](https://scrutinizer-ci.com/g/cocur/slugify/) +[![Code Coverage](https://scrutinizer-ci.com/g/cocur/slugify/badges/coverage.png?b=master&style=flat-square)](https://scrutinizer-ci.com/g/cocur/slugify/?branch=master) + +[![Latest Release](https://img.shields.io/packagist/v/cocur/slugify.svg)](https://packagist.org/packages/cocur/slugify) +[![MIT License](https://img.shields.io/packagist/l/cocur/slugify.svg)](http://opensource.org/licenses/MIT) +[![Total Downloads](https://img.shields.io/packagist/dt/cocur/slugify.svg)](https://packagist.org/packages/cocur/slugify) + +Developed by [Florian Eckerstorfer](https://florian.ec) in Vienna, Europe with the help of +[many great contributors](https://github.com/cocur/slugify/graphs/contributors). + +## Features + +- Removes all special characters from a string. +- Provides custom replacements for Arabic, Austrian, Azerbaijani, Brazilian Portuguese, Bulgarian, Burmese, Chinese, Croatian, Czech, Esperanto, Estonian, Finnish, French, Georgian, German, Greek, Hindi, Hungarian, Italian, Latvian, Lithuanian, Macedonian, Norwegian, Polish, Romanian, Russian, Serbian, Spanish, Swedish, Turkish, Ukrainian and Vietnamese special characters. Instead of removing these characters, Slugify approximates them (e.g., `ae` replaces `ä`). +- No external dependencies. +- PSR-4 compatible. +- Compatible with PHP >= 7. +- Integrations for [Symfony (3, 4 and 5)](http://symfony.com), [Laravel](http://laravel.com), [Twig (2 and 3)](http://twig.sensiolabs.org), [Zend Framework 2](http://framework.zend.com/), [Nette Framework](http://nette.org/), [Latte](http://latte.nette.org/) and [Plum](https://github.com/plumphp/plum). + +## Installation + +You can install Slugify through [Composer](https://getcomposer.org): + +```shell +$ composer require cocur/slugify +``` + +Slugify requires the Multibyte String extension from PHP. Typically you can use the configure option `--enable-mbstring` while compiling PHP. More information can be found in the [PHP documentation](http://php.net/manual/en/mbstring.installation.php). + +Further steps may be needed for [integrations](#integrations). + +## Usage + +Generate a slug: + +```php +use Cocur\Slugify\Slugify; + +$slugify = new Slugify(); +echo $slugify->slugify('Hello World!'); // hello-world +``` + +You can also change the separator used by `Slugify`: + +```php +echo $slugify->slugify('Hello World!', '_'); // hello_world +``` + +The library also contains `Cocur\Slugify\SlugifyInterface`. Use this interface whenever you need to type hint an +instance of `Slugify`. + +To add additional transliteration rules you can use the `addRule()` method. + +```php +$slugify->addRule('i', 'ey'); +echo $slugify->slugify('Hi'); // hey +``` + +### Rulesets + +Many of the transliterations rules used in Slugify are specific to a language. These rules are therefore categorized +using rulesets. Rules for the most popular are activated by default in a specific order. You can change which rulesets +are activated and the order in which they are activated. The order is important when there are conflicting rules in +different languages. For example, in German `ä` is transliterated with `ae`, in Turkish the correct transliteration is +`a`. By default the German transliteration is used since German is used more often on the internet. If you want to use +prefer the Turkish transliteration you have to possibilities. You can activate it after creating the constructor: + +```php +$slugify = new Slugify(); +$slugify->slugify('ä'); // -> "ae" +$slugify->activateRuleSet('turkish'); +$slugify->slugify('ä'); // -> "a" +``` + +An alternative way would be to pass the rulesets and their order to the constructor. + +```php +$slugify = new Slugify(['rulesets' => ['default', 'turkish']]); +$slugify->slugify('ä'); // -> "a" +``` + +You can find a list of the available rulesets in [Resources/rules](https://github.com/cocur/slugify/tree/master/Resources/rules). + +### More options + +The constructor takes an options array, you have already seen the `rulesets` options above. You can also change the +regular expression that is used to replace characters with the separator. + +```php +$slugify = new Slugify(['regexp' => '/([^A-Za-z0-9]|-)+/']); +``` + +_(The regular expression used in the example above is the default one.)_ + +By default Slugify will convert the slug to lowercase. If you want to preserve the case of the string you can set the +`lowercase` option to false. + +```php +$slugify = new Slugify(['lowercase' => false]); +$slugify->slugify('Hello World'); // -> "Hello-World" +``` + +Lowercasing is done before using the regular expression. If you want to keep the lowercasing behavior but your regular +expression needs to match uppercase letters, you can set the `lowercase_after_regexp` option to `true`. + +```php +$slugify = new Slugify([ + 'regexp' => '/(?<=[[:^upper:]])(?=[[:upper:]])/', + 'lowercase_after_regexp' => false, +]); +$slugify->slugify('FooBar'); // -> "foo-bar" +``` + +By default Slugify will use dashes as separators. If you want to use a different default separator, you can set the +`separator` option. + +```php +$slugify = new Slugify(['separator' => '_']); +$slugify->slugify('Hello World'); // -> "hello_world" +``` + +By default Slugify will remove leading and trailing separators before returning the slug. If you do not want the slug to +be trimmed you can set the `trim` option to false. + +```php +$slugify = new Slugify(['trim' => false]); +$slugify->slugify('Hello World '); // -> "hello-world-" +``` + +### Changing options on the fly + +You can overwrite any of the above options on the fly by passing an options array as second argument to the `slugify()` +method. For example: + +```php +$slugify = new Slugify(); +$slugify->slugify('Hello World', ['lowercase' => false]); // -> "Hello-World" +``` + +You can also modify the separator this way: + +```php +$slugify = new Slugify(); +$slugify->slugify('Hello World', ['separator' => '_']); // -> "hello_world" +``` + +You can even activate a custom ruleset without touching the default rules: + +```php +$slugify = new Slugify(); +$slugify->slugify('für', ['ruleset' => 'turkish']); // -> "fur" +$slugify->slugify('für'); // -> "fuer" +``` + +### Contributing + +We really appreciate if you report bugs and errors in the transliteration, especially if you are a native speaker of +the language and question. Feel free to ask for additional languages in the issues, but please note that the +maintainer of this repository does not speak all languages. If you can provide a Pull Request with rules for +a new language or extend the rules for an existing language that would be amazing. + +To add a new language you need to: + +1. Create a `[language].json` in `Resources/rules` +2. If you believe the language should be a default ruleset you can add the language to + `Cocur\Slugify\Slugify::$options`. If you add the language there all existing tests still have to pass +3. Run `php bin/generate-default.php` +4. Add tests for the language in `tests/SlugifyTest.php`. If the language is in the default ruleset add your + test cases to `defaultRuleProvider()`, otherwise to `customRulesProvider()`. + +Submit PR. Thank you very much. 💚 + +### Code of Conduct + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +The full Code of Conduct can be found [here](https://github.com/cocur/slugify/blob/master/CODE_OF_CONDUCT.md). + +This project is no place for hate. If you have any problems please contact Florian: [florian@eckerstorfer.net](mailto:florian@eckerstorfer.net) ✌🏻🏳️‍🌈 + +### Further information + +- [API docs](http://cocur.co/slugify/api/master/) + +## Integrations + +### Symfony + +Slugify contains a Symfony bundle and service definition that allow you to use it as a service in your Symfony application. The code resides in `Cocur\Slugify\Bridge\Symfony\CocurSlugifyBundle` and you only need to activate it: + +#### Symfony 2 + +Support for Symfony 2 has been dropped in Slugify 4.0.0, use `cocur/slugify@3`. + +#### Symfony 3 + +```php +// app/AppKernel.php + +class AppKernel extends Kernel +{ + public function registerBundles() + { + $bundles = array( + // ... + new Cocur\Slugify\Bridge\Symfony\CocurSlugifyBundle(), + ); + } +} +``` + +#### Symfony >= 4 + +```php +// config/bundles.php + +return [ + // ... + Cocur\Slugify\Bridge\Symfony\CocurSlugifyBundle::class => ['all' => true], +]; +``` + +You can now use the `cocur_slugify` service everywhere in your application, for example, in your controller: + +```php +$slug = $this->get('cocur_slugify')->slugify('Hello World!'); +``` + +The bundle also provides an alias `slugify` for the `cocur_slugify` service: + +```php +$slug = $this->get('slugify')->slugify('Hello World!'); +``` + +If you use `autowire` (Symfony >=3.3), you can inject it into your services like this: + +```php +public function __construct(\Cocur\Slugify\SlugifyInterface $slugify) +``` + +You can set the following configuration settings in `config.yml` to adjust the slugify service: + +```yaml +cocur_slugify: + lowercase: + separator: + regexp: + rulesets: {} # List of rulesets: https://github.com/cocur/slugify/tree/master/Resources/rules +``` + +### Twig + +If you use the Symfony framework with Twig you can use the Twig filter `slugify` in your templates after you have setup +Symfony integrations (see above). + +```twig +{{ 'Hällo Wörld'|slugify }} +``` + +If you use Twig outside of the Symfony framework you first need to add the extension to your environment: + +```php +use Cocur\Slugify\Bridge\Twig\SlugifyExtension; +use Cocur\Slugify\Slugify; + +$twig = new Twig_Environment($loader); +$twig->addExtension(new SlugifyExtension(Slugify::create())); +``` + +To use the Twig filter with [TwigBridge](https://github.com/rcrowe/TwigBridge) for Laravel, you'll need to add the +Slugify extension using a closure: + +```php +// laravel/app/config/packages/rcrowe/twigbridge/config.php + +'extensions' => array( + //... + function () { + return new \Cocur\Slugify\Bridge\Twig\SlugifyExtension(\Cocur\Slugify\Slugify::create()); + }, +), +``` + +You can find more information about registering extensions in the +[Twig documentation](http://twig.sensiolabs.org/doc/advanced.html#creating-an-extension). + +### Mustache.php + +We don't need an additional integration to use Slugify in [Mustache.php](https://github.com/bobthecow/mustache.php). +If you want to use Slugify in Mustache, just add a helper: + +```php +use Cocur\Slugify\Slugify; + +$mustache = new Mustache_Engine(array( + // ... + 'helpers' => array('slugify' => function($string, $separator = null) { + return Slugify::create()->slugify($string, $separator); + }), +)); +``` + +### Laravel + +Slugify also provides a service provider to integrate into Laravel (versions 4.1 and later). + +In your Laravel project's `app/config/app.php` file, add the service provider into the "providers" array: + +```php +'providers' => array( + "Cocur\Slugify\Bridge\Laravel\SlugifyServiceProvider", +) +``` + +And add the facade into the "aliases" array: + +```php +'aliases' => array( + "Slugify" => "Cocur\Slugify\Bridge\Laravel\SlugifyFacade", +) +``` + +You can then use the `Slugify::slugify()` method in your controllers: + +```php +$url = Slugify::slugify('welcome to the homepage'); +``` + +### Zend Framework 2 + +Slugify can be easely used in Zend Framework 2 applications. Included bridge provides a service and a view helper +already registered for you. + +Just enable the module in your configuration like this. + +```php +return array( + //... + + 'modules' => array( + 'Application', + 'ZfcBase', + 'Cocur\Slugify\Bridge\ZF2' // <- Add this line + //... + ) + + //... +); +``` + +After that you can retrieve the `Cocur\Slugify\Slugify` service (or the `slugify` alias) and generate a slug. + +```php +/** @var \Zend\ServiceManager\ServiceManager $sm */ +$slugify = $sm->get('Cocur\Slugify\Slugify'); +$slug = $slugify->slugify('Hällo Wörld'); +$anotherSlug = $slugify->slugify('Hällo Wörld', '_'); +``` + +In your view templates use the `slugify` helper to generate slugs. + +```php +slugify('Hällo Wörld') ?> +slugify('Hällo Wörld', '_') ?> +``` + +The service (which is also used in the view helper) can be customized by defining this configuration key. + +```php +return array( + 'cocur_slugify' => array( + 'reg_exp' => '/([^a-zA-Z0-9]|-)+/' + ) +); +``` + +### Nette Framework + +Slugify contains a Nette extension that allows you to use it as a service in your Nette application. You only need to +register it in your `config.neon`: + +```yml +# app/config/config.neon + +extensions: + slugify: Cocur\Slugify\Bridge\Nette\SlugifyExtension +``` + +You can now use the `Cocur\Slugify\SlugifyInterface` service everywhere in your application, for example in your +presenter: + +```php +class MyPresenter extends \Nette\Application\UI\Presenter +{ + /** @var \Cocur\Slugify\SlugifyInterface @inject */ + public $slugify; + + public function renderDefault() + { + $this->template->hello = $this->slugify->slugify('Hällo Wörld'); + } +} +``` + +### Latte + +If you use the Nette Framework with it's native Latte templating engine, you can use the Latte filter `slugify` in your +templates after you have setup Nette extension (see above). + +```smarty +{$hello|slugify} +``` + +If you use Latte outside of the Nette Framework you first need to add the filter to your engine: + +```php +use Cocur\Slugify\Bridge\Latte\SlugifyHelper; +use Cocur\Slugify\Slugify; +use Latte; + +$latte = new Latte\Engine(); +$latte->addFilter('slugify', array(new SlugifyHelper(Slugify::create()), 'slugify')); +``` + +### Slim 3 + +Slugify does not need a specific bridge to work with [Slim 3](http://www.slimframework.com), just add the following configuration: + +```php +$container['view'] = function ($c) { + $settings = $c->get('settings'); + $view = new \Slim\Views\Twig($settings['view']['template_path'], $settings['view']['twig']); + $view->addExtension(new Slim\Views\TwigExtension($c->get('router'), $c->get('request')->getUri())); + $view->addExtension(new Cocur\Slugify\Bridge\Twig\SlugifyExtension(Cocur\Slugify\Slugify::create())); + return $view; +}; +``` + +In a template you can use it like this: + +```twig +{{ post.title|raw }} +``` + +### League + +Slugify provides a service provider for use with `league/container`: + +```php +use Cocur\Slugify; +use League\Container; + +/* @var Container\ContainerInterface $container */ +$container->addServiceProvider(new Slugify\Bridge\League\SlugifyServiceProvider()); + +/* @var Slugify\Slugify $slugify */ +$slugify = $container->get(Slugify\SlugifyInterface::class); +``` + +You can configure it by sharing the required options: + +```php +use Cocur\Slugify; +use League\Container; + +/* @var Container\ContainerInterface $container */ +$container->share('config.slugify.options', [ + 'lowercase' => false, + 'rulesets' => [ + 'default', + 'german', + ], +]); + +$container->addServiceProvider(new Slugify\Bridge\League\SlugifyServiceProvider()); + +/* @var Slugify\Slugify $slugify */ +$slugify = $container->get(Slugify\SlugifyInterface::class); +``` + +You can configure which rule provider to use by sharing it: + +```php +use Cocur\Slugify; +use League\Container; + +/* @var Container\ContainerInterface $container */ +$container->share(Slugify\RuleProvider\RuleProviderInterface::class, function () { + return new Slugify\RuleProvider\FileRuleProvider(__DIR__ . '/../../rules'); +]); + +$container->addServiceProvider(new Slugify\Bridge\League\SlugifyServiceProvider()); + +/* @var Slugify\Slugify $slugify */ +$slugify = $container->get(Slugify\SlugifyInterface::class); +``` + +## Change Log + +### Version 4.0 (14 December 2019) + +Version 4 does not introduce new major features, but adds support for Symfony 4 and 5, Twig 3 and, most importantly, PHP 7.3 and 7.4. + +Support for PHP 5, Twig 1 and Silex is dropped. + +- [#230](https://github.com/cocur/slugify/pull/230) Add Slovak rules (by [bartko-s](https://github.com/bartko-s)) +- [#236](https://github.com/cocur/slugify/pull/236) Make Twig Bridge compatible with Twig 3.0 (by [mhujer](https://github.com/mhujer)) +- [#237](https://github.com/cocur/slugify/pull/237) Fix Travis CI configuration (by [kubawerlos](https://github.com/kubawerlos)) +- [#238](https://github.com/cocur/slugify/pull/238) Drop Twig 1 support (by [FabienPapet](https://github.com/FabienPapet)) +- [#239](https://github.com/cocur/slugify/pull/239) Fix AppVeyor (by [kubawerlos](https://github.com/kubawerlos)) +- [#241](https://github.com/cocur/slugify/pull/241) Update .gitattributes (by [kubawerlos](https://github.com/kubawerlos)) +- [#242](https://github.com/cocur/slugify/pull/242) Add PHP CS Fixer (by [kubawerlos](https://github.com/kubawerlos)) +- [#243](https://github.com/cocur/slugify/pull/243) Normalize composer.json (by [kubawerlos](https://github.com/kubawerlos)) +- [#246](https://github.com/cocur/slugify/pull/246) Add support for PHP 7.3 and 7.4 (by [snapshotpl](https://github.com/snapshotpl)) +- [#247](https://github.com/cocur/slugify/pull/247) AppVeyor improvements (by [kubawerlos](https://github.com/kubawerlos)) +- [#249](https://github.com/cocur/slugify/pull/249) PHPUnit annotations should be a FQCNs including a root namespace (by [kubawerlos](https://github.com/kubawerlos)) +- [#250](https://github.com/cocur/slugify/pull/250) Add support for Symfony 4 and 5 (by [franmomu](https://github.com/franmomu)) +- [#251](https://github.com/cocur/slugify/pull/251) Dropping support for PHP 5 (by [franmomu](https://github.com/franmomu)) +- [#253](https://github.com/cocur/slugify/pull/253) Add conflict for unmaintained Symfony versions (by [franmomu](https://github.com/franmomu)) + +### Version 3.2 (31 January 2019) + +- [#201](https://github.com/cocur/slugify/pull/201) Add strip_tags option (by [thewilkybarkid](https://github.com/thewilkybarkid)) +- [#212](https://github.com/cocur/slugify/pull/212) Fix Macedonian Dze (by [franmomu](https://github.com/franmomu)) +- [#213](https://github.com/cocur/slugify/pull/213) Add support for Turkmen (by [umbarov](https://github.com/umbarov)) +- [#216](https://github.com/cocur/slugify/pull/216) Add lowercase_after_regexp option (by [julienfalque](https://github.com/julienfalque)) +- [#217](https://github.com/cocur/slugify/pull/217) Simplify default regular impression (by [julienfalque](https://github.com/julienfalque)) +- [#220](https://github.com/cocur/slugify/pull/220) Fix deprecation warning for symfony/config 4.2+ (by [franmomu](https://github.com/franmomu)) +- [#221](https://github.com/cocur/slugify/pull/221) Add suuport Armenian (by [boolfalse](https://github.com/boolfalse)) + +### Version 3.1 (22 January 2018) + +- [#195](https://github.com/cocur/slugify/pull/195) Add support for Chinese (Pinyin) (by [SuN-80](https://github.com/SuN-80), [franmomu](https://github.com/franmomu)) +- [#189](https://github.com/cocur/slugify/pull/189) Add trim option (by [sforsberg](https://github.com/sforsberg)) + +### Version 3.0.1 (24 September 2017) + +- [#183](https://github.com/cocur/slugify/pull/183) Fix invalid JSON ([RusiPapazov](https://github.com/RusiPapazov)) +- [#185](https://github.com/cocur/slugify/pull/185) Fix support for Symfony > 3.3 (by [FabienPapet](https://github.com/FabienPapet)) +- [#186](https://github.com/cocur/slugify/pull/186) Require Multibyte extension in `composer.json` (by [wandersonwhcr](https://github.com/wandersonwhcr)) + +### Version 3.0 (11 August 2017) + +- HHVM is no longer supported +- Bugfix [#165](https://github.com/cocur/slugify/issues/165) Added missing French rules to `DefaultRuleProvider` (by [gsouf](https://github.com/gsouf)) +- [#168](https://github.com/cocur/slugify/pull/168) Add Persian rules (by [mohammad6006](https://github.com/mohammad6006)) +- Bugfix [#169](https://github.com/cocur/slugify/issues/169) Add missing `getName()` to `Cocur\Slugify\Bridge\Twig\SlugifyExtension` (by [TomCan](https://github.com/TomCan)) +- [#172](https://github.com/cocur/slugify/pull/172) Sort rules in `DefaultRuleProvider` alphabetically (by [tbmatuka](https://github.com/tbmatuka)) +- [#174](https://github.com/cocur/slugify/pull/174) Add Hungarian rules (by [rviktor87](https://github.com/rviktor87)) +- [#180](https://github.com/cocur/slugify/pull/180) Add Brazilian Portuguese rules (by [tallesairan](https://github.com/tallesairan)) +- Bugfix [#181](https://github.com/cocur/slugify/pull/181) Add missing French rules (by [FabienPapet](https://github.com/FabienPapet)) + +### Version 2.5 (23 March 2017) + +- [#150](https://github.com/cocur/slugify/pull/150) Add Romanian rules (by [gabiudrescu](https://github.com/gabiudrescu)) +- [#154](https://github.com/cocur/slugify/pull/154) Add French rules (by [SuN-80](https://github.com/SuN-80)) +- [#159](https://github.com/cocur/slugify/pull/159) Add Estonian rules (by [erkimiilberg](https://github.com/erkimiilberg)) +- [#162](https://github.com/cocur/slugify/pull/162) Add support for Twig 2 (by [JakeFr](https://github.com/JakeFr)) + +### Version 2.4 (9 February 2017) + +- [#133](https://github.com/cocur/slugify/pull/133) Allow to modify options without creating a new object (by [leofeyer](https://github.com/leofeyer)) +- [#135](https://github.com/cocur/slugify/pull/135) Add support for Danish (by [izehose](https://github.com/izehose)) +- [#140](https://github.com/cocur/slugify/pull/140) Update Hindi support (by [arunlodhi](https://github.com/arunlodhi)) +- [#146](https://github.com/cocur/slugify/pull/146) Add support for Italien (by [gianiaz](https://github.com/gianiaz)) +- [#151](https://github.com/cocur/slugify/pull/151) Add support for Serbian (by [cvetan](https://github.com/cvetan)) +- [#155](https://github.com/cocur/slugify/pull/155) Update support for Lithuanian (by [s4uliu5](https://github.com/s4uliu5)) + +### Version 2.3 (9 August 2016) + +- [#124](https://github.com/cocur/slugify/issues/124) Fix support for Bulgarian +- [#125](https://github.com/cocur/slugify/pull/125) Update Silex 2 provider (by [JakeFr](https://github.com/JakeFr)) +- [#129](https://github.com/cocur/slugify/pull/129) Add support for Croatian (by [napravicukod](https://github.com/napravicukod)) + +### Version 2.2 (10 July 2016) + +- [#102](https://github.com/cocur/slugify/pull/102) Add transliterations for Azerbaijani (by [seferov](https://github.com/seferov)) +- [#109](https://github.com/cocur/slugify/pull/109) Made integer values into strings (by [JonathanMH](https://github.com/JonathanMH)) +- [#114](https://github.com/cocur/slugify/pull/114) Provide SlugifyServiceProvider for league/container (by [localheinz](https://github.com/localheinz)) +- [#120](https://github.com/cocur/slugify/issues/120) Add compatibility with Silex 2 (by [shamotj](https://github.com/shamotj)) + +### Version 2.1.1 (8 April 2016) + +- Do not activate Swedish rules by default (fixes broken v2.1 release) + +### Version 2.1.0 (8 April 2016) + +- [#104](https://github.com/cocur/slugify/pull/104) Add Symfony configuration (by [estahn](https://github.com/estahn)) +- [#107](https://github.com/cocur/slugify/issues/107) Fix Swedish rules + +### Version 2.0.0 (24 February 2016) + +- [#78](https://github.com/cocur/slugify/pull/78) Use multibyte-safe case convention (by [Koc](https://github.com/Koc)) +- [#81](https://github.com/cocur/slugify/pull/81) Move rules into JSON files (by [florianeckerstorfer](https://github.com/florianeckerstorfer)) +- [#84](https://github.com/cocur/slugify/pull/84) Add tests for very long strings containing umlauts (by [florianeckerstorfer](https://github.com/florianeckerstorfer)) +- [#88](https://github.com/cocur/slugify/pull/88) Add rules for Hindi (by [florianeckerstorfer](https://github.com/florianeckerstorfer)) +- [#89](https://github.com/cocur/slugify/pull/89) Add rules for Norwegian (by [tsmes](https://github.com/tsmes)) +- [#90](https://github.com/cocur/slugify/pull/90) Replace `bindShared` with `singleton` in Laravel bridge (by [sunspikes](https://github.com/sunspikes)) +- [#97](https://github.com/cocur/slugify/pull/97) Set minimum PHP version to 5.5.9 (by [florianeckerstorfer](https://github.com/florianeckerstorfer)) +- [#98](https://github.com/cocur/slugify/pull/98) Add rules for Bulgarian (by [RoumenDamianoff](https://github.com/RoumenDamianoff)) + +### Version 1.4.1 (11 February 2016) + +- [#90](https://github.com/cocur/slugify/pull/90) Replace `bindShared` with `singleton` in Laravel bridge (by [sunspikes](https://github.com/sunspikes)) + +### Version 1.4 (29 September 2015) + +- [#75](https://github.com/cocur/slugify/pull/75) Remove a duplicate array entry (by [irfanevrens](https://github.com/irfanevrens)) +- [#76](https://github.com/cocur/slugify/pull/76) Add support for Georgian (by [TheGIBSON](https://github.com/TheGIBSON)) +- [#77](https://github.com/cocur/slugify/pull/77) Fix Danish transliterations (by [kafoso](https://github.com/kafoso)) + +### Version 1.3 (2 September 2015) + +- [#70](https://github.com/cocur/slugify/pull/70) Add missing superscript and subscript digits (by [BlueM](https://github.com/BlueM)) +- [#71](https://github.com/cocur/slugify/pull/71) Improve Greek language support (by [kostaspt](https://github.com/kostaspt)) +- [#72](https://github.com/cocur/slugify/pull/72) Improve Silex integration (by [CarsonF](https://github.com/CarsonF)) +- [#73](https://github.com/cocur/slugify/pull/73) Improve Russian language support (by [akost](https://github.com/akost)) + +### Version 1.2 (2 July 2015) + +- Add integration for [Plum](https://github.com/plumphp/plum) (by [florianeckerstorfer](https://github.com/florianeckerstorfer)) +- [#64](https://github.com/cocur/slugify/pull/64) Fix Nette integration (by [lookyman](https://github.com/lookyman)) +- Add option to not convert slug to lowercase (by [florianeckerstorfer](https://github.com/florianeckerstorfer) and [GDmac](https://github.com/GDmac)) + +### Version 1.1 (18 March 2015) + +- [#54](https://github.com/cocur/slugify/pull/54) Add support for Burmese characters (by [lovetostrike](https://github.com/lovetostrike)) +- [#58](https://github.com/cocur/slugify/pull/58) Add Nette and Latte integration (by [lookyman](https://github.com/lookyman)) +- [#50](https://github.com/cocur/slugify/issues/50) Fix transliteration for Vietnamese character Đ (by [mac2000](https://github.com/mac2000)) + +### Version 1.0 (26 November 2014) + +No new features or bugfixes, but it's about time to pump Slugify to v1.0. + +### Version 0.11 (23 November 2014) + +- [#49](https://github.com/cocur/slugify/pull/49) Add Zend Framework 2 integration (by [acelaya](https://github.com/acelaya)) + +### Version 0.10.3 (8 November 2014) + +- [#48](https://github.com/cocur/slugify/pull/48) Add support for Vietnamese (by [mac2000](https://github.com/mac2000)) + +### Version 0.10.2 (18 October 2014) + +- [#44](https://github.com/cocur/slugify/pull/44) Change visibility of properties to `protected` (by [acelaya](https://github.com/acelaya)) +- [#45](https://github.com/cocur/slugify/pull/45) Configure regular expression used to replace characters (by [acelaya](https://github.com/acelaya)) +- Fix type hinting (by [florianeckerstorfer](https://github.com/florianeckerstorfer)) +- Remove duplicate rule (by [florianeckerstorfer](https://github.com/florianeckerstorfer)) + +### Version 0.10.1 (1 September 2014) + +- [#39](https://github.com/cocur/slugify/pull/39) Add support for rulesets (by [florianeckerstorfer](https://github.com/florianeckerstorfer)) + +### Version 0.10.0 (26 August 2014) + +- [#32](https://github.com/cocur/slugify/pull/32) Added Laraval bridge (by [cviebrock](https://github.com/cviebrock)) +- [#35](https://github.com/cocur/slugify/pull/35) Fixed transliteration for `Ď` (by [michalskop](https://github.com/michalskop)) + +### Version 0.9 (29 May 2014) + +- [#28](https://github.com/cocur/slugify/pull/28) Add Symfony2 service alias and make Twig extension private (by [Kevin Bond](https://github.com/kbond)) + +### Version 0.8 (18 April 2014) + +- [#27](https://github.com/cocur/slugify/pull/27) Add support for Arabic characters (by [Davide Bellini](https://github.com/billmn)) +- Added some missing characters +- Improved organisation of characters in `Slugify` class + +### Version 0.7 (4 April 2014) + +This version introduces optional integrations into Symfony2, Silex and Twig. You can still use the library in any other framework. I decided to include these bridges because there exist integrations from other developers, but they use outdated versions of cocur/slugify. Including these small bridge classes in the library makes maintaining them a lot easier for me. + +- [#23](https://github.com/cocur/slugify/pull/23) Added Symfony2 service +- [#24](https://github.com/cocur/slugify/pull/24) Added Twig extension +- [#25](https://github.com/cocur/slugify/pull/25) Added Silex service provider + +### Version 0.6 (2 April 2014) + +- [#22](https://github.com/cocur/slugify/pull/22) Added support for Esperanto characters (by [Michel Petit](https://github.com/malenkiki)) + +### Version 0.5 (28 March 2014) + +- [#21](https://github.com/cocur/slugify/pull/21) Added support for Greek characters (by [Michel Petit](https://github.com/malenkiki)) +- [#20](https://github.com/cocur/slugify/pull/20) Fixed rule for cyrillic letter D (by [Marchenko Alexandr](https://github.com/cocur/slugify/pull/20)) +- Add missing `$separator` parameter to `SlugifyInterface` + +### Version 0.4.1 (9 March 2014) + +- [#19](https://github.com/cocur/slugify/pull/19) Adds soft sign rule (by [Marchenko Alexandr](https://github.com/mac2000)) + +### Version 0.4 (17 January 2014) + +Nearly completely rewritten code, removes `iconv` support because the underlying library is broken. The code is now better and faster. Many thanks to [Marchenko Alexandr](http://mac-blog.org.ua). + +### Version 0.3 (12 January 2014) + +- [#11](https://github.com/cocur/slugify/pull/11) PSR-4 compatible (by [mac2000](https://github.com/mac2000)) +- [#13](https://github.com/cocur/slugify/pull/13) Added editorconfig (by [mac2000](https://github.com/mac2000)) +- [#14](https://github.com/cocur/slugify/pull/14) Return empty slug when input is empty and removed unused parameter (by [mac2000](https://github.com/mac2000)) + +## Authors + +- [Florian Eckerstorfer](http://florian.ec) ([Twitter](http://twitter.com/Florian_)) +- [Ivo Bathke](https://github.com/ivoba) +- [Marchenko Alexandr](http://mac-blog.org.ua) +- And many [great contributors](https://github.com/cocur/slugify/graphs/contributors) + +Support for Chinese is adapted from [jifei/Pinyin](https://github.com/jifei/Pinyin) with permission. + +> Slugify is a project of [Cocur](http://cocur.co). You can contact us on Twitter: +> [**@cocurco**](https://twitter.com/cocurco) + +## Support + +If you need support you can ask on [Twitter](https://twitter.com/cocurco) (well, only if your question is short) or you +can join our chat on Gitter. + +[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cocur/slugify) + +In case you want to support the development of Slugify you can help us with providing additional transliterations or +inform us if a transliteration is wrong. We would highly appreciate it if you can send us directly a Pull Request on +Github. If you have never contributed to a project on Github we are happy to help you. Just ask on Twitter or directly +join our Gitter. + +You always can help me (Florian, the original developer and maintainer) out by +[sending me an Euro or two](https://paypal.me/florianec/2). + +## License + +The MIT License (MIT) + +Copyright (c) 2012-2017 Florian Eckerstorfer + +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. diff --git a/plugins/page-toc/vendor/cocur/slugify/composer.json b/plugins/page-toc/vendor/cocur/slugify/composer.json new file mode 100644 index 0000000..8913fc9 --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/composer.json @@ -0,0 +1,59 @@ +{ + "name": "cocur/slugify", + "type": "library", + "description": "Converts a string into a slug.", + "keywords": [ + "slug", + "slugify" + ], + "license": "MIT", + "authors": [ + { + "name": "Florian Eckerstorfer", + "email": "florian@eckerstorfer.co", + "homepage": "https://florian.ec" + }, + { + "name": "Ivo Bathke", + "email": "ivo.bathke@gmail.com" + } + ], + "require": { + "php": ">=7.0", + "ext-mbstring": "*" + }, + "conflict": { + "symfony/config": "<3.4 || >=4,<4.3", + "symfony/dependency-injection": "<3.4 || >=4,<4.3", + "symfony/http-kernel": "<3.4 || >=4,<4.3", + "twig/twig": "<2.12.1" + }, + "require-dev": { + "laravel/framework": "~5.1", + "latte/latte": "~2.2", + "league/container": "^2.2.0", + "mikey179/vfsstream": "~1.6.8", + "mockery/mockery": "^1.3", + "nette/di": "~2.4", + "phpunit/phpunit": "^5.7.27", + "pimple/pimple": "~1.1", + "plumphp/plum": "~0.1", + "symfony/config": "^3.4 || ^4.3 || ^5.0", + "symfony/dependency-injection": "^3.4 || ^4.3 || ^5.0", + "symfony/http-kernel": "^3.4 || ^4.3 || ^5.0", + "twig/twig": "^2.12.1 || ~3.0", + "zendframework/zend-modulemanager": "~2.2", + "zendframework/zend-servicemanager": "~2.2", + "zendframework/zend-view": "~2.2" + }, + "autoload": { + "psr-4": { + "Cocur\\Slugify\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Cocur\\Slugify\\Tests\\": "tests" + } + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Laravel/SlugifyFacade.php b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Laravel/SlugifyFacade.php new file mode 100644 index 0000000..7c1b1ac --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Laravel/SlugifyFacade.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cocur\Slugify\Bridge\Laravel; + +use Illuminate\Support\Facades\Facade; + +/** + * SlugifyFacade + * + * @package cocur/slugify + * @subpackage bridge + * @author Florian Eckerstorfer + * @author Colin Viebrock + * @copyright 2012-2014 Florian Eckerstorfer + * @license http://www.opensource.org/licenses/MIT The MIT License + */ +class SlugifyFacade extends Facade +{ + /** + * Get the registered name of the component. + * + * @return string + * + * @codeCoverageIgnore + */ + protected static function getFacadeAccessor() + { + return 'slugify'; + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Laravel/SlugifyServiceProvider.php b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Laravel/SlugifyServiceProvider.php new file mode 100644 index 0000000..bca16e5 --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Laravel/SlugifyServiceProvider.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cocur\Slugify\Bridge\Laravel; + +use Cocur\Slugify\Slugify; +use Illuminate\Support\ServiceProvider as LaravelServiceProvider; + +/** + * SlugifyServiceProvider + * + * @package cocur/slugify + * @subpackage bridge + * @author Florian Eckerstorfer + * @author Colin Viebrock + * @copyright 2012-2014 Florian Eckerstorfer + * @license http://www.opensource.org/licenses/MIT The MIT License + */ +class SlugifyServiceProvider extends LaravelServiceProvider +{ + /** + * Indicates if loading of the provider is deferred. + * + * @var bool + */ + protected $defer = true; + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + $this->app->singleton('slugify', function () { + return new Slugify(); + }); + } + + /** + * Get the services provided by the provider. + * + * @return string[] + */ + public function provides() + { + return ['slugify']; + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Latte/SlugifyHelper.php b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Latte/SlugifyHelper.php new file mode 100644 index 0000000..0730aa4 --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Latte/SlugifyHelper.php @@ -0,0 +1,38 @@ + + * @license http://www.opensource.org/licenses/MIT The MIT License + */ +class SlugifyHelper +{ + /** @var SlugifyInterface */ + private $slugify; + + /** + * @codeCoverageIgnore + */ + public function __construct(SlugifyInterface $slugify) + { + $this->slugify = $slugify; + } + + /** + * @param string $string + * @param string|null $separator + * + * @return string + */ + public function slugify($string, $separator = null) + { + return $this->slugify->slugify($string, $separator); + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/Bridge/League/SlugifyServiceProvider.php b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/League/SlugifyServiceProvider.php new file mode 100644 index 0000000..6d03f94 --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/League/SlugifyServiceProvider.php @@ -0,0 +1,37 @@ +container->share(SlugifyInterface::class, function () { + $options = []; + if ($this->container->has('config.slugify.options')) { + $options = $this->container->get('config.slugify.options'); + } + + $provider = null; + if ($this->container->has(RuleProviderInterface::class)) { + /* @var RuleProviderInterface $provider */ + $provider = $this->container->get(RuleProviderInterface::class); + } + + return new Slugify( + $options, + $provider + ); + }); + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Nette/SlugifyExtension.php b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Nette/SlugifyExtension.php new file mode 100644 index 0000000..12fdbe5 --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Nette/SlugifyExtension.php @@ -0,0 +1,49 @@ + + * @license http://www.opensource.org/licenses/MIT The MIT License + */ +class SlugifyExtension extends CompilerExtension +{ + public function loadConfiguration() + { + $builder = $this->getContainerBuilder(); + + $builder->addDefinition($this->prefix('slugify')) + ->setClass('Cocur\Slugify\SlugifyInterface') + ->setFactory('Cocur\Slugify\Slugify'); + + $builder->addDefinition($this->prefix('helper')) + ->setClass('Cocur\Slugify\Bridge\Latte\SlugifyHelper') + ->setAutowired(false); + } + + public function beforeCompile() + { + $builder = $this->getContainerBuilder(); + + $self = $this; + $registerToLatte = function (ServiceDefinition $def) use ($self) { + $def->addSetup('addFilter', ['slugify', [$self->prefix('@helper'), 'slugify']]); + }; + + $latteFactory = $builder->getByType('Nette\Bridges\ApplicationLatte\ILatteFactory') ?: 'nette.latteFactory'; + if ($builder->hasDefinition($latteFactory)) { + $registerToLatte($builder->getDefinition($latteFactory)); + } + + if ($builder->hasDefinition('nette.latte')) { + $registerToLatte($builder->getDefinition('nette.latte')); + } + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Plum/SlugifyConverter.php b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Plum/SlugifyConverter.php new file mode 100644 index 0000000..c686bd0 --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Plum/SlugifyConverter.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cocur\Slugify\Bridge\Plum; + +use Plum\Plum\Converter\ConverterInterface; +use Cocur\Slugify\Slugify; +use Cocur\Slugify\SlugifyInterface; + +/** + * SlugifyConverter + * + * @package Cocur\Slugify\Bridge\Plum + * @author Florian Eckerstorfer + * @copyright 2015 Florian Eckerstorfer + */ +class SlugifyConverter implements ConverterInterface +{ + /** @var Slugify */ + private $slugify; + + /** + * @param SlugifyInterface|null $slugify + */ + public function __construct(SlugifyInterface $slugify = null) + { + if ($slugify === null) { + $slugify = new Slugify(); + } + $this->slugify = $slugify; + } + + /** + * @param string $item + * + * @return string + */ + public function convert($item) + { + return $this->slugify->slugify($item); + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Symfony/CocurSlugifyBundle.php b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Symfony/CocurSlugifyBundle.php new file mode 100644 index 0000000..2dc381c --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Symfony/CocurSlugifyBundle.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cocur\Slugify\Bridge\Symfony; + +use Symfony\Component\HttpKernel\Bundle\Bundle; + +/** + * CocurSlugifyBundle + * + * @package cocur/slugify + * @subpackage bridge + * @author Florian Eckerstorfer + * @copyright 2012-2014 Florian Eckerstorfer + * @license http://www.opensource.org/licenses/MIT The MIT License + */ +class CocurSlugifyBundle extends Bundle +{ + public function getContainerExtension() + { + return new CocurSlugifyExtension(); + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Symfony/CocurSlugifyExtension.php b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Symfony/CocurSlugifyExtension.php new file mode 100644 index 0000000..1b4e49c --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Symfony/CocurSlugifyExtension.php @@ -0,0 +1,62 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cocur\Slugify\Bridge\Symfony; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\HttpKernel\DependencyInjection\Extension; + +/** + * CocurSlugifyExtension + * + * @package cocur/slugify + * @subpackage bridge + * @author Florian Eckerstorfer + * @copyright 2012-2014 Florian Eckerstorfer + * @license http://www.opensource.org/licenses/MIT The MIT License + */ +class CocurSlugifyExtension extends Extension +{ + /** + * {@inheritDoc} + * + * @param mixed[] $configs + * @param ContainerBuilder $container + */ + public function load(array $configs, ContainerBuilder $container) + { + $configuration = new Configuration(); + $config = $this->processConfiguration($configuration, $configs); + + if (empty($config['rulesets'])) { + unset($config['rulesets']); + } + + // Extract slugify arguments from config + $slugifyArguments = array_intersect_key($config, array_flip(['lowercase', 'trim', 'strip_tags', 'separator', 'regexp', 'rulesets'])); + + $container->setDefinition('cocur_slugify', new Definition('Cocur\Slugify\Slugify', [$slugifyArguments])); + $container + ->setDefinition( + 'cocur_slugify.twig.slugify', + new Definition( + 'Cocur\Slugify\Bridge\Twig\SlugifyExtension', + [new Reference('cocur_slugify')] + ) + ) + ->addTag('twig.extension') + ->setPublic(false); + $container->setAlias('slugify', 'cocur_slugify'); + $container->setAlias('Cocur\Slugify\SlugifyInterface', 'cocur_slugify'); + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Symfony/Configuration.php b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Symfony/Configuration.php new file mode 100644 index 0000000..4959362 --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Symfony/Configuration.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cocur\Slugify\Bridge\Symfony; + +use Symfony\Component\Config\Definition\Builder\TreeBuilder; +use Symfony\Component\Config\Definition\ConfigurationInterface; + +class Configuration implements ConfigurationInterface +{ + /** + * {@inheritdoc} + */ + public function getConfigTreeBuilder() + { + $treeBuilder = new TreeBuilder('cocur_slugify'); + + // Keep compatibility with symfony/config < 4.2 + if (\method_exists($treeBuilder, 'getRootNode')) { + $rootNode = $treeBuilder->getRootNode(); + } else { + $rootNode = $treeBuilder->root('cocur_slugify'); + } + + $rootNode + ->children() + ->booleanNode('lowercase')->end() + ->booleanNode('lowercase_after_regexp')->end() + ->booleanNode('trim')->end() + ->booleanNode('strip_tags')->end() + ->scalarNode('separator')->end() + ->scalarNode('regexp')->end() + ->arrayNode('rulesets')->prototype('scalar')->end() + ->end(); + + return $treeBuilder; + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Twig/SlugifyExtension.php b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Twig/SlugifyExtension.php new file mode 100644 index 0000000..cfec031 --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/Twig/SlugifyExtension.php @@ -0,0 +1,80 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cocur\Slugify\Bridge\Twig; + +use Cocur\Slugify\SlugifyInterface; +use Twig\Extension\AbstractExtension; +use Twig\TwigFilter; + +/** + * SlugifyExtension + * + * @package cocur/slugify + * @subpackage bridge + * @author Florian Eckerstorfer + * @copyright 2012-2015 Florian Eckerstorfer + * @license http://www.opensource.org/licenses/MIT The MIT License + */ +class SlugifyExtension extends AbstractExtension +{ + /** + * @var SlugifyInterface + */ + private $slugify; + + /** + * Constructor. + * + * @param SlugifyInterface $slugify + * + * @codeCoverageIgnore + */ + public function __construct(SlugifyInterface $slugify) + { + $this->slugify = $slugify; + } + + /** + * Returns the Twig functions of this extension. + * + * @return TwigFilter[] + */ + public function getFilters() + { + return [ + new TwigFilter('slugify', [$this, 'slugifyFilter']), + ]; + } + + /** + * Slugify filter. + * + * @param string $string + * @param string|null $separator + * + * @return string + */ + public function slugifyFilter($string, $separator = null) + { + return $this->slugify->slugify($string, $separator); + } + + /** + * get Name + * + * @return string + */ + public function getName() + { + return "SlugifyExtension"; + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/Bridge/ZF2/Module.php b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/ZF2/Module.php new file mode 100644 index 0000000..74e2ec8 --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/ZF2/Module.php @@ -0,0 +1,50 @@ +> + */ + public function getServiceConfig() + { + return [ + 'factories' => [ + 'Cocur\Slugify\Slugify' => 'Cocur\Slugify\Bridge\ZF2\SlugifyService' + ], + 'aliases' => [ + 'slugify' => 'Cocur\Slugify\Slugify' + ] + ]; + } + + /** + * Expected to return \Zend\ServiceManager\Config object or array to + * seed such an object. + * + * @return array>|\Zend\ServiceManager\Config + */ + public function getViewHelperConfig() + { + return [ + 'factories' => [ + 'slugify' => 'Cocur\Slugify\Bridge\ZF2\SlugifyViewHelperFactory' + ] + ]; + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/Bridge/ZF2/SlugifyService.php b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/ZF2/SlugifyService.php new file mode 100644 index 0000000..44686b8 --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/ZF2/SlugifyService.php @@ -0,0 +1,30 @@ +get('Config'); + + $options = isset($config[Module::CONFIG_KEY]['options']) ? $config[Module::CONFIG_KEY]['options'] : []; + $provider = isset($config[Module::CONFIG_KEY]['provider']) ? $config[Module::CONFIG_KEY]['provider'] : null; + + return new Slugify($options, $provider); + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/Bridge/ZF2/SlugifyViewHelper.php b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/ZF2/SlugifyViewHelper.php new file mode 100644 index 0000000..d421aee --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/ZF2/SlugifyViewHelper.php @@ -0,0 +1,41 @@ +slugify = $slugify; + } + + /** + * @param string $string + * @param string|null $separator + * + * @return string + */ + public function __invoke($string, $separator = null) + { + return $this->slugify->slugify($string, $separator); + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/Bridge/ZF2/SlugifyViewHelperFactory.php b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/ZF2/SlugifyViewHelperFactory.php new file mode 100644 index 0000000..1929234 --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/Bridge/ZF2/SlugifyViewHelperFactory.php @@ -0,0 +1,28 @@ +getServiceLocator()->get('Cocur\Slugify\Slugify'); + + return new SlugifyViewHelper($slugify); + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/RuleProvider/DefaultRuleProvider.php b/plugins/page-toc/vendor/cocur/slugify/src/RuleProvider/DefaultRuleProvider.php new file mode 100644 index 0000000..3db1784 --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/RuleProvider/DefaultRuleProvider.php @@ -0,0 +1,8557 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cocur\Slugify\RuleProvider; + +/** + * DefaultRuleProvider + * + * @package Cocur\Slugify\RuleProvider + * @author Florian Eckerstorfer + * @copyright 2015 Florian Eckerstorfer + */ +class DefaultRuleProvider implements RuleProviderInterface +{ + /** + * DO NOT MODIFY THESE RULES! + * These rules are generated by the script in bin/generate-rules.php based on the JSON files + * in Resources/rules. + * + * @var array + */ + protected $rules = /*INSERT_START*/array ( + 'arabic' => + array ( + 'أ' => 'a', + 'ب' => 'b', + 'ت' => 't', + 'ث' => 'th', + 'ج' => 'g', + 'ح' => 'h', + 'خ' => 'kh', + 'د' => 'd', + 'ذ' => 'th', + 'ر' => 'r', + 'ز' => 'z', + 'س' => 's', + 'ش' => 'sh', + 'ص' => 's', + 'ض' => 'd', + 'ط' => 't', + 'ظ' => 'th', + 'ع' => 'aa', + 'غ' => 'gh', + 'ف' => 'f', + 'ق' => 'k', + 'ك' => 'k', + 'ل' => 'l', + 'م' => 'm', + 'ن' => 'n', + 'ه' => 'h', + 'و' => 'o', + 'ي' => 'y', + ), + 'armenian' => + array ( + 'Ա' => 'A', + 'Բ' => 'B', + 'Գ' => 'G', + 'Դ' => 'D', + 'Ե' => 'E', + 'Զ' => 'Z', + 'Է' => 'E', + 'Ը' => 'Y', + 'Թ' => 'Th', + 'Ժ' => 'Zh', + 'Ի' => 'I', + 'Լ' => 'L', + 'Խ' => 'Kh', + 'Ծ' => 'Ts', + 'Կ' => 'K', + 'Հ' => 'H', + 'Ձ' => 'Dz', + 'Ղ' => 'Gh', + 'Ճ' => 'Tch', + 'Մ' => 'M', + 'Յ' => 'Y', + 'Ն' => 'N', + 'Շ' => 'Sh', + 'Ո' => 'Vo', + 'Չ' => 'Ch', + 'Պ' => 'P', + 'Ջ' => 'J', + 'Ռ' => 'R', + 'Ս' => 'S', + 'Վ' => 'V', + 'Տ' => 'T', + 'Ր' => 'R', + 'Ց' => 'C', + 'Ւ' => 'u', + 'Փ' => 'Ph', + 'Ք' => 'Q', + 'և' => 'ev', + 'Օ' => 'O', + 'Ֆ' => 'F', + 'ա' => 'a', + 'բ' => 'b', + 'գ' => 'g', + 'դ' => 'd', + 'ե' => 'e', + 'զ' => 'z', + 'է' => 'e', + 'ը' => 'y', + 'թ' => 'th', + 'ժ' => 'zh', + 'ի' => 'i', + 'լ' => 'l', + 'խ' => 'kh', + 'ծ' => 'ts', + 'կ' => 'k', + 'հ' => 'h', + 'ձ' => 'dz', + 'ղ' => 'gh', + 'ճ' => 'tch', + 'մ' => 'm', + 'յ' => 'y', + 'ն' => 'n', + 'շ' => 'sh', + 'ո' => 'vo', + 'չ' => 'ch', + 'պ' => 'p', + 'ջ' => 'j', + 'ռ' => 'r', + 'ս' => 's', + 'վ' => 'v', + 'տ' => 't', + 'ր' => 'r', + 'ց' => 'c', + 'ւ' => 'u', + 'փ' => 'ph', + 'ք' => 'q', + 'օ' => 'o', + 'ֆ' => 'f', + ), + 'austrian' => + array ( + 'Ä' => 'AE', + 'Ö' => 'OE', + 'Ü' => 'UE', + 'ß' => 'sz', + 'ä' => 'ae', + 'ö' => 'oe', + 'ü' => 'ue', + ), + 'azerbaijani' => + array ( + 'Ə' => 'E', + 'Ç' => 'C', + 'Ğ' => 'G', + 'İ' => 'I', + 'Ş' => 'S', + 'Ö' => 'O', + 'Ü' => 'U', + 'ə' => 'e', + 'ç' => 'c', + 'ğ' => 'g', + 'ı' => 'i', + 'ş' => 's', + 'ö' => 'o', + 'ü' => 'u', + ), + 'bulgarian' => + array ( + 'А' => 'A', + 'Б' => 'B', + 'В' => 'V', + 'Г' => 'G', + 'Д' => 'D', + 'Е' => 'E', + 'Ж' => 'J', + 'З' => 'Z', + 'И' => 'I', + 'Й' => 'Y', + 'К' => 'K', + 'Л' => 'L', + 'М' => 'M', + 'Н' => 'N', + 'О' => 'O', + 'П' => 'P', + 'Р' => 'R', + 'С' => 'S', + 'Т' => 'T', + 'У' => 'U', + 'Ф' => 'F', + 'Х' => 'H', + 'Ц' => 'Ts', + 'Ч' => 'Ch', + 'Ш' => 'Sh', + 'Щ' => 'Sht', + 'Ъ' => 'A', + 'Ь' => 'I', + 'Ю' => 'Iu', + 'Я' => 'Ia', + 'а' => 'a', + 'б' => 'b', + 'в' => 'v', + 'г' => 'g', + 'д' => 'd', + 'е' => 'e', + 'ж' => 'j', + 'з' => 'z', + 'и' => 'i', + 'й' => 'y', + 'к' => 'k', + 'л' => 'l', + 'м' => 'm', + 'н' => 'n', + 'о' => 'o', + 'п' => 'p', + 'р' => 'r', + 'с' => 's', + 'т' => 't', + 'у' => 'u', + 'ф' => 'f', + 'х' => 'h', + 'ц' => 'ts', + 'ч' => 'ch', + 'ш' => 'sh', + 'щ' => 'sht', + 'ъ' => 'a', + 'ь' => 'i', + 'ю' => 'iu', + 'я' => 'ia', + 'ия' => 'ia', + 'йо' => 'iо', + 'ьо' => 'io', + ), + 'burmese' => + array ( + 'က' => 'k', + 'ခ' => 'kh', + 'ဂ' => 'g', + 'ဃ' => 'ga', + 'င' => 'ng', + 'စ' => 's', + 'ဆ' => 'sa', + 'ဇ' => 'z', + 'စျ' => 'za', + 'ည' => 'ny', + 'ဋ' => 't', + 'ဌ' => 'ta', + 'ဍ' => 'd', + 'ဎ' => 'da', + 'ဏ' => 'na', + 'တ' => 't', + 'ထ' => 'ta', + 'ဒ' => 'd', + 'ဓ' => 'da', + 'န' => 'n', + 'ပ' => 'p', + 'ဖ' => 'pa', + 'ဗ' => 'b', + 'ဘ' => 'ba', + 'မ' => 'm', + 'ယ' => 'y', + 'ရ' => 'ya', + 'လ' => 'l', + 'ဝ' => 'w', + 'သ' => 'th', + 'ဟ' => 'h', + 'ဠ' => 'la', + 'အ' => 'a', + 'ြ' => 'y', + 'ျ' => 'ya', + 'ွ' => 'w', + 'ြွ' => 'yw', + 'ျွ' => 'ywa', + 'ှ' => 'h', + 'ဧ' => 'e', + '၏' => '-e', + 'ဣ' => 'i', + 'ဤ' => '-i', + 'ဉ' => 'u', + 'ဦ' => '-u', + 'ဩ' => 'aw', + 'သြော' => 'aw', + 'ဪ' => 'aw', + '၍' => 'ywae', + '၌' => 'hnaik', + '၀' => '0', + '၁' => '1', + '၂' => '2', + '၃' => '3', + '၄' => '4', + '၅' => '5', + '၆' => '6', + '၇' => '7', + '၈' => '8', + '၉' => '9', + '္' => '', + '့' => '', + 'း' => '', + 'ာ' => 'a', + 'ါ' => 'a', + 'ေ' => 'e', + 'ဲ' => 'e', + 'ိ' => 'i', + 'ီ' => 'i', + 'ို' => 'o', + 'ု' => 'u', + 'ူ' => 'u', + 'ေါင်' => 'aung', + 'ော' => 'aw', + 'ော်' => 'aw', + 'ေါ' => 'aw', + 'ေါ်' => 'aw', + '်' => 'at', + 'က်' => 'et', + 'ိုက်' => 'aik', + 'ောက်' => 'auk', + 'င်' => 'in', + 'ိုင်' => 'aing', + 'ောင်' => 'aung', + 'စ်' => 'it', + 'ည်' => 'i', + 'တ်' => 'at', + 'ိတ်' => 'eik', + 'ုတ်' => 'ok', + 'ွတ်' => 'ut', + 'ေတ်' => 'it', + 'ဒ်' => 'd', + 'ိုဒ်' => 'ok', + 'ုဒ်' => 'ait', + 'န်' => 'an', + 'ာန်' => 'an', + 'ိန်' => 'ein', + 'ုန်' => 'on', + 'ွန်' => 'un', + 'ပ်' => 'at', + 'ိပ်' => 'eik', + 'ုပ်' => 'ok', + 'ွပ်' => 'ut', + 'န်ုပ်' => 'nub', + 'မ်' => 'an', + 'ိမ်' => 'ein', + 'ုမ်' => 'on', + 'ွမ်' => 'un', + 'ယ်' => 'e', + 'ိုလ်' => 'ol', + 'ဉ်' => 'in', + 'ံ' => 'an', + 'ိံ' => 'ein', + 'ုံ' => 'on', + ), + 'chinese' => + array ( + '腌' => 'yan', + '嗄' => 'a', + '迫' => 'po', + '捱' => 'ai', + '艾' => 'ai', + '瑷' => 'ai', + '嗌' => 'ai', + '犴' => 'an', + '鳌' => 'ao', + '廒' => 'ao', + '拗' => 'niu', + '岙' => 'ao', + '鏊' => 'ao', + '扒' => 'ba', + '岜' => 'ba', + '耙' => 'pa', + '鲅' => 'ba', + '癍' => 'ban', + '膀' => 'pang', + '磅' => 'bang', + '炮' => 'pao', + '曝' => 'pu', + '刨' => 'pao', + '瀑' => 'pu', + '陂' => 'bei', + '埤' => 'pi', + '鹎' => 'bei', + '邶' => 'bei', + '孛' => 'bei', + '鐾' => 'bei', + '鞴' => 'bei', + '畚' => 'ben', + '甏' => 'beng', + '舭' => 'bi', + '秘' => 'mi', + '辟' => 'pi', + '泌' => 'mi', + '裨' => 'bi', + '濞' => 'bi', + '庳' => 'bi', + '嬖' => 'bi', + '畀' => 'bi', + '筚' => 'bi', + '箅' => 'bi', + '襞' => 'bi', + '跸' => 'bi', + '笾' => 'bian', + '扁' => 'bian', + '碥' => 'bian', + '窆' => 'bian', + '便' => 'bian', + '弁' => 'bian', + '缏' => 'bian', + '骠' => 'biao', + '杓' => 'shao', + '飚' => 'biao', + '飑' => 'biao', + '瘭' => 'biao', + '髟' => 'biao', + '玢' => 'bin', + '豳' => 'bin', + '镔' => 'bin', + '膑' => 'bin', + '屏' => 'ping', + '泊' => 'bo', + '逋' => 'bu', + '晡' => 'bu', + '钸' => 'bu', + '醭' => 'bu', + '埔' => 'pu', + '瓿' => 'bu', + '礤' => 'ca', + '骖' => 'can', + '藏' => 'zang', + '艚' => 'cao', + '侧' => 'ce', + '喳' => 'zha', + '刹' => 'sha', + '瘥' => 'chai', + '禅' => 'chan', + '廛' => 'chan', + '镡' => 'tan', + '澶' => 'chan', + '躔' => 'chan', + '阊' => 'chang', + '鲳' => 'chang', + '长' => 'chang', + '苌' => 'chang', + '氅' => 'chang', + '鬯' => 'chang', + '焯' => 'chao', + '朝' => 'chao', + '车' => 'che', + '琛' => 'chen', + '谶' => 'chen', + '榇' => 'chen', + '蛏' => 'cheng', + '埕' => 'cheng', + '枨' => 'cheng', + '塍' => 'cheng', + '裎' => 'cheng', + '螭' => 'chi', + '眵' => 'chi', + '墀' => 'chi', + '篪' => 'chi', + '坻' => 'di', + '瘛' => 'chi', + '种' => 'zhong', + '重' => 'zhong', + '仇' => 'chou', + '帱' => 'chou', + '俦' => 'chou', + '雠' => 'chou', + '臭' => 'chou', + '楮' => 'chu', + '畜' => 'chu', + '嘬' => 'zuo', + '膪' => 'chuai', + '巛' => 'chuan', + '椎' => 'zhui', + '呲' => 'ci', + '兹' => 'zi', + '伺' => 'si', + '璁' => 'cong', + '楱' => 'cou', + '攒' => 'zan', + '爨' => 'cuan', + '隹' => 'zhui', + '榱' => 'cui', + '撮' => 'cuo', + '鹾' => 'cuo', + '嗒' => 'da', + '哒' => 'da', + '沓' => 'ta', + '骀' => 'tai', + '绐' => 'dai', + '埭' => 'dai', + '甙' => 'dai', + '弹' => 'dan', + '澹' => 'dan', + '叨' => 'dao', + '纛' => 'dao', + '簦' => 'deng', + '提' => 'ti', + '翟' => 'zhai', + '绨' => 'ti', + '丶' => 'dian', + '佃' => 'dian', + '簟' => 'dian', + '癜' => 'dian', + '调' => 'tiao', + '铞' => 'diao', + '佚' => 'yi', + '堞' => 'die', + '瓞' => 'die', + '揲' => 'die', + '垤' => 'die', + '疔' => 'ding', + '岽' => 'dong', + '硐' => 'dong', + '恫' => 'dong', + '垌' => 'dong', + '峒' => 'dong', + '芏' => 'du', + '煅' => 'duan', + '碓' => 'dui', + '镦' => 'dui', + '囤' => 'tun', + '铎' => 'duo', + '缍' => 'duo', + '驮' => 'tuo', + '沲' => 'tuo', + '柁' => 'tuo', + '哦' => 'o', + '恶' => 'e', + '轭' => 'e', + '锷' => 'e', + '鹗' => 'e', + '阏' => 'e', + '诶' => 'ea', + '鲕' => 'er', + '珥' => 'er', + '佴' => 'er', + '番' => 'fan', + '彷' => 'pang', + '霏' => 'fei', + '蜚' => 'fei', + '鲱' => 'fei', + '芾' => 'fei', + '瀵' => 'fen', + '鲼' => 'fen', + '否' => 'fou', + '趺' => 'fu', + '桴' => 'fu', + '莩' => 'fu', + '菔' => 'fu', + '幞' => 'fu', + '郛' => 'fu', + '绂' => 'fu', + '绋' => 'fu', + '祓' => 'fu', + '砩' => 'fu', + '黻' => 'fu', + '罘' => 'fu', + '蚨' => 'fu', + '脯' => 'pu', + '滏' => 'fu', + '黼' => 'fu', + '鲋' => 'fu', + '鳆' => 'fu', + '咖' => 'ka', + '噶' => 'ga', + '轧' => 'zha', + '陔' => 'gai', + '戤' => 'gai', + '扛' => 'kang', + '戆' => 'gang', + '筻' => 'gang', + '槔' => 'gao', + '藁' => 'gao', + '缟' => 'gao', + '咯' => 'ge', + '仡' => 'yi', + '搿' => 'ge', + '塥' => 'ge', + '鬲' => 'ge', + '哿' => 'ge', + '句' => 'ju', + '缑' => 'gou', + '鞲' => 'gou', + '笱' => 'gou', + '遘' => 'gou', + '瞽' => 'gu', + '罟' => 'gu', + '嘏' => 'gu', + '牿' => 'gu', + '鲴' => 'gu', + '栝' => 'kuo', + '莞' => 'guan', + '纶' => 'lun', + '涫' => 'guan', + '涡' => 'wo', + '呙' => 'guo', + '馘' => 'guo', + '猓' => 'guo', + '咳' => 'ke', + '氦' => 'hai', + '颔' => 'han', + '吭' => 'keng', + '颃' => 'hang', + '巷' => 'xiang', + '蚵' => 'ke', + '翮' => 'he', + '吓' => 'xia', + '桁' => 'heng', + '泓' => 'hong', + '蕻' => 'hong', + '黉' => 'hong', + '後' => 'hou', + '唿' => 'hu', + '煳' => 'hu', + '浒' => 'hu', + '祜' => 'hu', + '岵' => 'hu', + '鬟' => 'huan', + '圜' => 'huan', + '郇' => 'xun', + '锾' => 'huan', + '逭' => 'huan', + '咴' => 'hui', + '虺' => 'hui', + '会' => 'hui', + '溃' => 'kui', + '哕' => 'hui', + '缋' => 'hui', + '锪' => 'huo', + '蠖' => 'huo', + '缉' => 'ji', + '稽' => 'ji', + '赍' => 'ji', + '丌' => 'ji', + '咭' => 'ji', + '亟' => 'ji', + '殛' => 'ji', + '戢' => 'ji', + '嵴' => 'ji', + '蕺' => 'ji', + '系' => 'xi', + '蓟' => 'ji', + '霁' => 'ji', + '荠' => 'qi', + '跽' => 'ji', + '哜' => 'ji', + '鲚' => 'ji', + '洎' => 'ji', + '芰' => 'ji', + '茄' => 'qie', + '珈' => 'jia', + '迦' => 'jia', + '笳' => 'jia', + '葭' => 'jia', + '跏' => 'jia', + '郏' => 'jia', + '恝' => 'jia', + '铗' => 'jia', + '袷' => 'qia', + '蛱' => 'jia', + '角' => 'jiao', + '挢' => 'jiao', + '岬' => 'jia', + '徼' => 'jiao', + '湫' => 'qiu', + '敫' => 'jiao', + '瘕' => 'jia', + '浅' => 'qian', + '蒹' => 'jian', + '搛' => 'jian', + '湔' => 'jian', + '缣' => 'jian', + '犍' => 'jian', + '鹣' => 'jian', + '鲣' => 'jian', + '鞯' => 'jian', + '蹇' => 'jian', + '謇' => 'jian', + '硷' => 'jian', + '枧' => 'jian', + '戬' => 'jian', + '谫' => 'jian', + '囝' => 'jian', + '裥' => 'jian', + '笕' => 'jian', + '翦' => 'jian', + '趼' => 'jian', + '楗' => 'jian', + '牮' => 'jian', + '踺' => 'jian', + '茳' => 'jiang', + '礓' => 'jiang', + '耩' => 'jiang', + '降' => 'jiang', + '绛' => 'jiang', + '洚' => 'jiang', + '鲛' => 'jiao', + '僬' => 'jiao', + '鹪' => 'jiao', + '艽' => 'jiao', + '茭' => 'jiao', + '嚼' => 'jiao', + '峤' => 'qiao', + '觉' => 'jiao', + '校' => 'xiao', + '噍' => 'jiao', + '醮' => 'jiao', + '疖' => 'jie', + '喈' => 'jie', + '桔' => 'ju', + '拮' => 'jie', + '桀' => 'jie', + '颉' => 'jie', + '婕' => 'jie', + '羯' => 'jie', + '鲒' => 'jie', + '蚧' => 'jie', + '骱' => 'jie', + '衿' => 'jin', + '馑' => 'jin', + '卺' => 'jin', + '廑' => 'jin', + '堇' => 'jin', + '槿' => 'jin', + '靳' => 'jin', + '缙' => 'jin', + '荩' => 'jin', + '赆' => 'jin', + '妗' => 'jin', + '旌' => 'jing', + '腈' => 'jing', + '憬' => 'jing', + '肼' => 'jing', + '迳' => 'jing', + '胫' => 'jing', + '弪' => 'jing', + '獍' => 'jing', + '扃' => 'jiong', + '鬏' => 'jiu', + '疚' => 'jiu', + '僦' => 'jiu', + '桕' => 'jiu', + '疽' => 'ju', + '裾' => 'ju', + '苴' => 'ju', + '椐' => 'ju', + '锔' => 'ju', + '琚' => 'ju', + '鞫' => 'ju', + '踽' => 'ju', + '榉' => 'ju', + '莒' => 'ju', + '遽' => 'ju', + '倨' => 'ju', + '钜' => 'ju', + '犋' => 'ju', + '屦' => 'ju', + '榘' => 'ju', + '窭' => 'ju', + '讵' => 'ju', + '醵' => 'ju', + '苣' => 'ju', + '圈' => 'quan', + '镌' => 'juan', + '蠲' => 'juan', + '锩' => 'juan', + '狷' => 'juan', + '桊' => 'juan', + '鄄' => 'juan', + '獗' => 'jue', + '攫' => 'jue', + '孓' => 'jue', + '橛' => 'jue', + '珏' => 'jue', + '桷' => 'jue', + '劂' => 'jue', + '爝' => 'jue', + '镢' => 'jue', + '觖' => 'jue', + '筠' => 'jun', + '麇' => 'jun', + '捃' => 'jun', + '浚' => 'jun', + '喀' => 'ka', + '卡' => 'ka', + '佧' => 'ka', + '胩' => 'ka', + '锎' => 'kai', + '蒈' => 'kai', + '剀' => 'kai', + '垲' => 'kai', + '锴' => 'kai', + '戡' => 'kan', + '莰' => 'kan', + '闶' => 'kang', + '钪' => 'kang', + '尻' => 'kao', + '栲' => 'kao', + '柯' => 'ke', + '疴' => 'ke', + '钶' => 'ke', + '颏' => 'ke', + '珂' => 'ke', + '髁' => 'ke', + '壳' => 'ke', + '岢' => 'ke', + '溘' => 'ke', + '骒' => 'ke', + '缂' => 'ke', + '氪' => 'ke', + '锞' => 'ke', + '裉' => 'ken', + '倥' => 'kong', + '崆' => 'kong', + '箜' => 'kong', + '芤' => 'kou', + '眍' => 'kou', + '筘' => 'kou', + '刳' => 'ku', + '堀' => 'ku', + '喾' => 'ku', + '侉' => 'kua', + '蒯' => 'kuai', + '哙' => 'kuai', + '狯' => 'kuai', + '郐' => 'kuai', + '匡' => 'kuang', + '夼' => 'kuang', + '邝' => 'kuang', + '圹' => 'kuang', + '纩' => 'kuang', + '贶' => 'kuang', + '岿' => 'kui', + '悝' => 'kui', + '睽' => 'kui', + '逵' => 'kui', + '馗' => 'kui', + '夔' => 'kui', + '喹' => 'kui', + '隗' => 'wei', + '暌' => 'kui', + '揆' => 'kui', + '蝰' => 'kui', + '跬' => 'kui', + '喟' => 'kui', + '聩' => 'kui', + '篑' => 'kui', + '蒉' => 'kui', + '愦' => 'kui', + '锟' => 'kun', + '醌' => 'kun', + '琨' => 'kun', + '髡' => 'kun', + '悃' => 'kun', + '阃' => 'kun', + '蛞' => 'kuo', + '砬' => 'la', + '落' => 'luo', + '剌' => 'la', + '瘌' => 'la', + '涞' => 'lai', + '崃' => 'lai', + '铼' => 'lai', + '赉' => 'lai', + '濑' => 'lai', + '斓' => 'lan', + '镧' => 'lan', + '谰' => 'lan', + '漤' => 'lan', + '罱' => 'lan', + '稂' => 'lang', + '阆' => 'lang', + '莨' => 'liang', + '蒗' => 'lang', + '铹' => 'lao', + '痨' => 'lao', + '醪' => 'lao', + '栳' => 'lao', + '铑' => 'lao', + '耢' => 'lao', + '勒' => 'le', + '仂' => 'le', + '叻' => 'le', + '泐' => 'le', + '鳓' => 'le', + '了' => 'le', + '镭' => 'lei', + '嫘' => 'lei', + '缧' => 'lei', + '檑' => 'lei', + '诔' => 'lei', + '耒' => 'lei', + '酹' => 'lei', + '塄' => 'leng', + '愣' => 'leng', + '藜' => 'li', + '骊' => 'li', + '黧' => 'li', + '缡' => 'li', + '嫠' => 'li', + '鲡' => 'li', + '蓠' => 'li', + '澧' => 'li', + '锂' => 'li', + '醴' => 'li', + '鳢' => 'li', + '俪' => 'li', + '砺' => 'li', + '郦' => 'li', + '詈' => 'li', + '猁' => 'li', + '溧' => 'li', + '栎' => 'li', + '轹' => 'li', + '傈' => 'li', + '坜' => 'li', + '苈' => 'li', + '疠' => 'li', + '疬' => 'li', + '篥' => 'li', + '粝' => 'li', + '跞' => 'li', + '俩' => 'liang', + '裢' => 'lian', + '濂' => 'lian', + '臁' => 'lian', + '奁' => 'lian', + '蠊' => 'lian', + '琏' => 'lian', + '蔹' => 'lian', + '裣' => 'lian', + '楝' => 'lian', + '潋' => 'lian', + '椋' => 'liang', + '墚' => 'liang', + '寮' => 'liao', + '鹩' => 'liao', + '蓼' => 'liao', + '钌' => 'liao', + '廖' => 'liao', + '尥' => 'liao', + '洌' => 'lie', + '捩' => 'lie', + '埒' => 'lie', + '躐' => 'lie', + '鬣' => 'lie', + '辚' => 'lin', + '遴' => 'lin', + '啉' => 'lin', + '瞵' => 'lin', + '懔' => 'lin', + '廪' => 'lin', + '蔺' => 'lin', + '膦' => 'lin', + '酃' => 'ling', + '柃' => 'ling', + '鲮' => 'ling', + '呤' => 'ling', + '镏' => 'liu', + '旒' => 'liu', + '骝' => 'liu', + '鎏' => 'liu', + '锍' => 'liu', + '碌' => 'lu', + '鹨' => 'liu', + '茏' => 'long', + '栊' => 'long', + '泷' => 'long', + '砻' => 'long', + '癃' => 'long', + '垅' => 'long', + '偻' => 'lou', + '蝼' => 'lou', + '蒌' => 'lou', + '耧' => 'lou', + '嵝' => 'lou', + '露' => 'lu', + '瘘' => 'lou', + '噜' => 'lu', + '轳' => 'lu', + '垆' => 'lu', + '胪' => 'lu', + '舻' => 'lu', + '栌' => 'lu', + '镥' => 'lu', + '绿' => 'lv', + '辘' => 'lu', + '簏' => 'lu', + '潞' => 'lu', + '辂' => 'lu', + '渌' => 'lu', + '氇' => 'lu', + '捋' => 'lv', + '稆' => 'lv', + '率' => 'lv', + '闾' => 'lv', + '栾' => 'luan', + '銮' => 'luan', + '滦' => 'luan', + '娈' => 'luan', + '脔' => 'luan', + '锊' => 'lve', + '猡' => 'luo', + '椤' => 'luo', + '脶' => 'luo', + '镙' => 'luo', + '倮' => 'luo', + '蠃' => 'luo', + '瘰' => 'luo', + '珞' => 'luo', + '泺' => 'luo', + '荦' => 'luo', + '雒' => 'luo', + '呒' => 'mu', + '抹' => 'mo', + '唛' => 'mai', + '杩' => 'ma', + '么' => 'me', + '埋' => 'mai', + '荬' => 'mai', + '脉' => 'mai', + '劢' => 'mai', + '颟' => 'man', + '蔓' => 'man', + '鳗' => 'man', + '鞔' => 'man', + '螨' => 'man', + '墁' => 'man', + '缦' => 'man', + '熳' => 'man', + '镘' => 'man', + '邙' => 'mang', + '硭' => 'mang', + '旄' => 'mao', + '茆' => 'mao', + '峁' => 'mao', + '泖' => 'mao', + '昴' => 'mao', + '耄' => 'mao', + '瑁' => 'mao', + '懋' => 'mao', + '瞀' => 'mao', + '麽' => 'me', + '没' => 'mei', + '嵋' => 'mei', + '湄' => 'mei', + '猸' => 'mei', + '镅' => 'mei', + '鹛' => 'mei', + '浼' => 'mei', + '钔' => 'men', + '瞢' => 'meng', + '甍' => 'meng', + '礞' => 'meng', + '艨' => 'meng', + '黾' => 'mian', + '鳘' => 'min', + '溟' => 'ming', + '暝' => 'ming', + '模' => 'mo', + '谟' => 'mo', + '嫫' => 'mo', + '镆' => 'mo', + '瘼' => 'mo', + '耱' => 'mo', + '貊' => 'mo', + '貘' => 'mo', + '牟' => 'mou', + '鍪' => 'mou', + '蛑' => 'mou', + '侔' => 'mou', + '毪' => 'mu', + '坶' => 'mu', + '仫' => 'mu', + '唔' => 'wu', + '那' => 'na', + '镎' => 'na', + '哪' => 'na', + '呢' => 'ne', + '肭' => 'na', + '艿' => 'nai', + '鼐' => 'nai', + '萘' => 'nai', + '柰' => 'nai', + '蝻' => 'nan', + '馕' => 'nang', + '攮' => 'nang', + '曩' => 'nang', + '猱' => 'nao', + '铙' => 'nao', + '硇' => 'nao', + '蛲' => 'nao', + '垴' => 'nao', + '坭' => 'ni', + '猊' => 'ni', + '铌' => 'ni', + '鲵' => 'ni', + '祢' => 'mi', + '睨' => 'ni', + '慝' => 'te', + '伲' => 'ni', + '鲇' => 'nian', + '鲶' => 'nian', + '埝' => 'nian', + '嬲' => 'niao', + '茑' => 'niao', + '脲' => 'niao', + '啮' => 'nie', + '陧' => 'nie', + '颞' => 'nie', + '臬' => 'nie', + '蘖' => 'nie', + '甯' => 'ning', + '聍' => 'ning', + '狃' => 'niu', + '侬' => 'nong', + '耨' => 'nou', + '孥' => 'nu', + '胬' => 'nu', + '钕' => 'nv', + '恧' => 'nv', + '褰' => 'qian', + '掮' => 'qian', + '荨' => 'xun', + '钤' => 'qian', + '箝' => 'qian', + '鬈' => 'quan', + '缱' => 'qian', + '肷' => 'qian', + '纤' => 'xian', + '茜' => 'qian', + '慊' => 'qian', + '椠' => 'qian', + '戗' => 'qiang', + '镪' => 'qiang', + '锖' => 'qiang', + '樯' => 'qiang', + '嫱' => 'qiang', + '雀' => 'que', + '缲' => 'qiao', + '硗' => 'qiao', + '劁' => 'qiao', + '樵' => 'qiao', + '谯' => 'qiao', + '鞒' => 'qiao', + '愀' => 'qiao', + '鞘' => 'qiao', + '郄' => 'xi', + '箧' => 'qie', + '亲' => 'qin', + '覃' => 'tan', + '溱' => 'qin', + '檎' => 'qin', + '锓' => 'qin', + '嗪' => 'qin', + '螓' => 'qin', + '揿' => 'qin', + '吣' => 'qin', + '圊' => 'qing', + '鲭' => 'qing', + '檠' => 'qing', + '黥' => 'qing', + '謦' => 'qing', + '苘' => 'qing', + '磬' => 'qing', + '箐' => 'qing', + '綮' => 'qi', + '茕' => 'qiong', + '邛' => 'dao', + '蛩' => 'tun', + '筇' => 'qiong', + '跫' => 'qiong', + '銎' => 'qiong', + '楸' => 'qiu', + '俅' => 'qiu', + '赇' => 'qiu', + '逑' => 'qiu', + '犰' => 'qiu', + '蝤' => 'qiu', + '巯' => 'qiu', + '鼽' => 'qiu', + '糗' => 'qiu', + '区' => 'qu', + '祛' => 'qu', + '麴' => 'qu', + '诎' => 'qu', + '衢' => 'qu', + '癯' => 'qu', + '劬' => 'qu', + '璩' => 'qu', + '氍' => 'qu', + '朐' => 'qu', + '磲' => 'qu', + '鸲' => 'qu', + '蕖' => 'qu', + '蠼' => 'qu', + '蘧' => 'qu', + '阒' => 'qu', + '颧' => 'quan', + '荃' => 'quan', + '铨' => 'quan', + '辁' => 'quan', + '筌' => 'quan', + '绻' => 'quan', + '畎' => 'quan', + '阕' => 'que', + '悫' => 'que', + '髯' => 'ran', + '禳' => 'rang', + '穰' => 'rang', + '仞' => 'ren', + '妊' => 'ren', + '轫' => 'ren', + '衽' => 'ren', + '狨' => 'rong', + '肜' => 'rong', + '蝾' => 'rong', + '嚅' => 'ru', + '濡' => 'ru', + '薷' => 'ru', + '襦' => 'ru', + '颥' => 'ru', + '洳' => 'ru', + '溽' => 'ru', + '蓐' => 'ru', + '朊' => 'ruan', + '蕤' => 'rui', + '枘' => 'rui', + '箬' => 'ruo', + '挲' => 'suo', + '脎' => 'sa', + '塞' => 'sai', + '鳃' => 'sai', + '噻' => 'sai', + '毵' => 'san', + '馓' => 'san', + '糁' => 'san', + '霰' => 'xian', + '磉' => 'sang', + '颡' => 'sang', + '缫' => 'sao', + '鳋' => 'sao', + '埽' => 'sao', + '瘙' => 'sao', + '色' => 'se', + '杉' => 'shan', + '鲨' => 'sha', + '痧' => 'sha', + '裟' => 'sha', + '铩' => 'sha', + '唼' => 'sha', + '酾' => 'shai', + '栅' => 'zha', + '跚' => 'shan', + '芟' => 'shan', + '埏' => 'shan', + '钐' => 'shan', + '舢' => 'shan', + '剡' => 'yan', + '鄯' => 'shan', + '疝' => 'shan', + '蟮' => 'shan', + '墒' => 'shang', + '垧' => 'shang', + '绱' => 'shang', + '蛸' => 'shao', + '筲' => 'shao', + '苕' => 'tiao', + '召' => 'zhao', + '劭' => 'shao', + '猞' => 'she', + '畲' => 'she', + '折' => 'zhe', + '滠' => 'she', + '歙' => 'xi', + '厍' => 'she', + '莘' => 'shen', + '娠' => 'shen', + '诜' => 'shen', + '什' => 'shen', + '谂' => 'shen', + '渖' => 'shen', + '矧' => 'shen', + '胂' => 'shen', + '椹' => 'shen', + '省' => 'sheng', + '眚' => 'sheng', + '嵊' => 'sheng', + '嘘' => 'xu', + '蓍' => 'shi', + '鲺' => 'shi', + '识' => 'shi', + '拾' => 'shi', + '埘' => 'shi', + '莳' => 'shi', + '炻' => 'shi', + '鲥' => 'shi', + '豕' => 'shi', + '似' => 'si', + '噬' => 'shi', + '贳' => 'shi', + '铈' => 'shi', + '螫' => 'shi', + '筮' => 'shi', + '殖' => 'zhi', + '熟' => 'shu', + '艏' => 'shou', + '菽' => 'shu', + '摅' => 'shu', + '纾' => 'shu', + '毹' => 'shu', + '疋' => 'shu', + '数' => 'shu', + '属' => 'shu', + '术' => 'shu', + '澍' => 'shu', + '沭' => 'shu', + '丨' => 'shu', + '腧' => 'shu', + '说' => 'shuo', + '妁' => 'shuo', + '蒴' => 'shuo', + '槊' => 'shuo', + '搠' => 'shuo', + '鸶' => 'si', + '澌' => 'si', + '缌' => 'si', + '锶' => 'si', + '厶' => 'si', + '蛳' => 'si', + '驷' => 'si', + '泗' => 'si', + '汜' => 'si', + '兕' => 'si', + '姒' => 'si', + '耜' => 'si', + '笥' => 'si', + '忪' => 'song', + '淞' => 'song', + '崧' => 'song', + '凇' => 'song', + '菘' => 'song', + '竦' => 'song', + '溲' => 'sou', + '飕' => 'sou', + '蜩' => 'tiao', + '萜' => 'tie', + '汀' => 'ting', + '葶' => 'ting', + '莛' => 'ting', + '梃' => 'ting', + '佟' => 'tong', + '酮' => 'tong', + '仝' => 'tong', + '茼' => 'tong', + '砼' => 'tong', + '钭' => 'dou', + '酴' => 'tu', + '钍' => 'tu', + '堍' => 'tu', + '抟' => 'tuan', + '忒' => 'te', + '煺' => 'tui', + '暾' => 'tun', + '氽' => 'tun', + '乇' => 'tuo', + '砣' => 'tuo', + '沱' => 'tuo', + '跎' => 'tuo', + '坨' => 'tuo', + '橐' => 'tuo', + '酡' => 'tuo', + '鼍' => 'tuo', + '庹' => 'tuo', + '拓' => 'tuo', + '柝' => 'tuo', + '箨' => 'tuo', + '腽' => 'wa', + '崴' => 'wai', + '芄' => 'wan', + '畹' => 'wan', + '琬' => 'wan', + '脘' => 'wan', + '菀' => 'wan', + '尢' => 'you', + '辋' => 'wang', + '魍' => 'wang', + '逶' => 'wei', + '葳' => 'wei', + '隈' => 'wei', + '惟' => 'wei', + '帏' => 'wei', + '圩' => 'wei', + '囗' => 'wei', + '潍' => 'wei', + '嵬' => 'wei', + '沩' => 'wei', + '涠' => 'wei', + '尾' => 'wei', + '玮' => 'wei', + '炜' => 'wei', + '韪' => 'wei', + '洧' => 'wei', + '艉' => 'wei', + '鲔' => 'wei', + '遗' => 'yi', + '尉' => 'wei', + '軎' => 'wei', + '璺' => 'wen', + '阌' => 'wen', + '蓊' => 'weng', + '蕹' => 'weng', + '渥' => 'wo', + '硪' => 'wo', + '龌' => 'wo', + '圬' => 'wu', + '吾' => 'wu', + '浯' => 'wu', + '鼯' => 'wu', + '牾' => 'wu', + '迕' => 'wu', + '庑' => 'wu', + '痦' => 'wu', + '芴' => 'wu', + '杌' => 'wu', + '焐' => 'wu', + '阢' => 'wu', + '婺' => 'wu', + '鋈' => 'wu', + '樨' => 'xi', + '栖' => 'qi', + '郗' => 'xi', + '蹊' => 'qi', + '淅' => 'xi', + '熹' => 'xi', + '浠' => 'xi', + '僖' => 'xi', + '穸' => 'xi', + '螅' => 'xi', + '菥' => 'xi', + '舾' => 'xi', + '矽' => 'xi', + '粞' => 'xi', + '硒' => 'xi', + '醯' => 'xi', + '欷' => 'xi', + '鼷' => 'xi', + '檄' => 'xi', + '隰' => 'xi', + '觋' => 'xi', + '屣' => 'xi', + '葸' => 'xi', + '蓰' => 'xi', + '铣' => 'xi', + '饩' => 'xi', + '阋' => 'xi', + '禊' => 'xi', + '舄' => 'xi', + '狎' => 'xia', + '硖' => 'xia', + '柙' => 'xia', + '暹' => 'xian', + '莶' => 'xian', + '祆' => 'xian', + '籼' => 'xian', + '跹' => 'xian', + '鹇' => 'xian', + '痫' => 'xian', + '猃' => 'xian', + '燹' => 'xian', + '蚬' => 'xian', + '筅' => 'xian', + '冼' => 'xian', + '岘' => 'xian', + '骧' => 'xiang', + '葙' => 'xiang', + '芗' => 'xiang', + '缃' => 'xiang', + '庠' => 'xiang', + '鲞' => 'xiang', + '蟓' => 'xiang', + '削' => 'xue', + '枵' => 'xiao', + '绡' => 'xiao', + '筱' => 'xiao', + '邪' => 'xie', + '勰' => 'xie', + '缬' => 'xie', + '血' => 'xue', + '榭' => 'xie', + '瀣' => 'xie', + '薤' => 'xie', + '燮' => 'xie', + '躞' => 'xie', + '廨' => 'xie', + '绁' => 'xie', + '渫' => 'xie', + '榍' => 'xie', + '獬' => 'xie', + '昕' => 'xin', + '忻' => 'xin', + '囟' => 'xin', + '陉' => 'jing', + '荥' => 'ying', + '饧' => 'tang', + '硎' => 'xing', + '荇' => 'xing', + '芎' => 'xiong', + '馐' => 'xiu', + '庥' => 'xiu', + '鸺' => 'xiu', + '貅' => 'xiu', + '髹' => 'xiu', + '宿' => 'xiu', + '岫' => 'xiu', + '溴' => 'xiu', + '吁' => 'xu', + '盱' => 'xu', + '顼' => 'xu', + '糈' => 'xu', + '醑' => 'xu', + '洫' => 'xu', + '溆' => 'xu', + '蓿' => 'xu', + '萱' => 'xuan', + '谖' => 'xuan', + '儇' => 'xuan', + '煊' => 'xuan', + '痃' => 'xuan', + '铉' => 'xuan', + '泫' => 'xuan', + '碹' => 'xuan', + '楦' => 'xuan', + '镟' => 'xuan', + '踅' => 'xue', + '泶' => 'xue', + '鳕' => 'xue', + '埙' => 'xun', + '曛' => 'xun', + '窨' => 'xun', + '獯' => 'xun', + '峋' => 'xun', + '洵' => 'xun', + '恂' => 'xun', + '浔' => 'xun', + '鲟' => 'xun', + '蕈' => 'xun', + '垭' => 'ya', + '岈' => 'ya', + '琊' => 'ya', + '痖' => 'ya', + '迓' => 'ya', + '砑' => 'ya', + '咽' => 'yan', + '鄢' => 'yan', + '菸' => 'yan', + '崦' => 'yan', + '铅' => 'qian', + '芫' => 'yuan', + '兖' => 'yan', + '琰' => 'yan', + '罨' => 'yan', + '厣' => 'yan', + '焱' => 'yan', + '酽' => 'yan', + '谳' => 'yan', + '鞅' => 'yang', + '炀' => 'yang', + '蛘' => 'yang', + '约' => 'yue', + '珧' => 'yao', + '轺' => 'yao', + '繇' => 'yao', + '鳐' => 'yao', + '崾' => 'yao', + '钥' => 'yao', + '曜' => 'yao', + '铘' => 'ye', + '烨' => 'ye', + '邺' => 'ye', + '靥' => 'ye', + '晔' => 'ye', + '猗' => 'yi', + '铱' => 'yi', + '欹' => 'qi', + '黟' => 'yi', + '怡' => 'yi', + '沂' => 'yi', + '圯' => 'yi', + '荑' => 'yi', + '诒' => 'yi', + '眙' => 'yi', + '嶷' => 'yi', + '钇' => 'yi', + '舣' => 'yi', + '酏' => 'yi', + '熠' => 'yi', + '弋' => 'yi', + '懿' => 'yi', + '镒' => 'yi', + '峄' => 'yi', + '怿' => 'yi', + '悒' => 'yi', + '佾' => 'yi', + '殪' => 'yi', + '挹' => 'yi', + '埸' => 'yi', + '劓' => 'yi', + '镱' => 'yi', + '瘗' => 'yi', + '癔' => 'yi', + '翊' => 'yi', + '蜴' => 'yi', + '氤' => 'yin', + '堙' => 'yin', + '洇' => 'yin', + '鄞' => 'yin', + '狺' => 'yin', + '夤' => 'yin', + '圻' => 'qi', + '饮' => 'yin', + '吲' => 'yin', + '胤' => 'yin', + '茚' => 'yin', + '璎' => 'ying', + '撄' => 'ying', + '嬴' => 'ying', + '滢' => 'ying', + '潆' => 'ying', + '蓥' => 'ying', + '瘿' => 'ying', + '郢' => 'ying', + '媵' => 'ying', + '邕' => 'yong', + '镛' => 'yong', + '墉' => 'yong', + '慵' => 'yong', + '痈' => 'yong', + '鳙' => 'yong', + '饔' => 'yong', + '喁' => 'yong', + '俑' => 'yong', + '莸' => 'you', + '猷' => 'you', + '疣' => 'you', + '蚰' => 'you', + '蝣' => 'you', + '莜' => 'you', + '牖' => 'you', + '铕' => 'you', + '卣' => 'you', + '宥' => 'you', + '侑' => 'you', + '蚴' => 'you', + '釉' => 'you', + '馀' => 'yu', + '萸' => 'yu', + '禺' => 'yu', + '妤' => 'yu', + '欤' => 'yu', + '觎' => 'yu', + '窬' => 'yu', + '蝓' => 'yu', + '嵛' => 'yu', + '舁' => 'yu', + '雩' => 'yu', + '龉' => 'yu', + '伛' => 'yu', + '圉' => 'yu', + '庾' => 'yu', + '瘐' => 'yu', + '窳' => 'yu', + '俣' => 'yu', + '毓' => 'yu', + '峪' => 'yu', + '煜' => 'yu', + '燠' => 'yu', + '蓣' => 'yu', + '饫' => 'yu', + '阈' => 'yu', + '鬻' => 'yu', + '聿' => 'yu', + '钰' => 'yu', + '鹆' => 'yu', + '蜮' => 'yu', + '眢' => 'yuan', + '箢' => 'yuan', + '员' => 'yuan', + '沅' => 'yuan', + '橼' => 'yuan', + '塬' => 'yuan', + '爰' => 'yuan', + '螈' => 'yuan', + '鼋' => 'yuan', + '掾' => 'yuan', + '垸' => 'yuan', + '瑗' => 'yuan', + '刖' => 'yue', + '瀹' => 'yue', + '樾' => 'yue', + '龠' => 'yue', + '氲' => 'yun', + '昀' => 'yun', + '郧' => 'yun', + '狁' => 'yun', + '郓' => 'yun', + '韫' => 'yun', + '恽' => 'yun', + '扎' => 'zha', + '拶' => 'za', + '咋' => 'za', + '仔' => 'zai', + '昝' => 'zan', + '瓒' => 'zan', + '奘' => 'zang', + '唣' => 'zao', + '择' => 'ze', + '迮' => 'ze', + '赜' => 'ze', + '笮' => 'ze', + '箦' => 'ze', + '舴' => 'ze', + '昃' => 'ze', + '缯' => 'zeng', + '罾' => 'zeng', + '齄' => 'zha', + '柞' => 'zha', + '痄' => 'zha', + '瘵' => 'zhai', + '旃' => 'zhan', + '璋' => 'zhang', + '漳' => 'zhang', + '嫜' => 'zhang', + '鄣' => 'zhang', + '仉' => 'zhang', + '幛' => 'zhang', + '着' => 'zhe', + '啁' => 'zhou', + '爪' => 'zhao', + '棹' => 'zhao', + '笊' => 'zhao', + '摺' => 'zhe', + '磔' => 'zhe', + '这' => 'zhe', + '柘' => 'zhe', + '桢' => 'zhen', + '蓁' => 'zhen', + '祯' => 'zhen', + '浈' => 'zhen', + '畛' => 'zhen', + '轸' => 'zhen', + '稹' => 'zhen', + '圳' => 'zhen', + '徵' => 'zhi', + '钲' => 'zheng', + '卮' => 'zhi', + '胝' => 'zhi', + '祗' => 'zhi', + '摭' => 'zhi', + '絷' => 'zhi', + '埴' => 'zhi', + '轵' => 'zhi', + '黹' => 'zhi', + '帙' => 'zhi', + '轾' => 'zhi', + '贽' => 'zhi', + '陟' => 'zhi', + '忮' => 'zhi', + '彘' => 'zhi', + '膣' => 'zhi', + '鸷' => 'zhi', + '骘' => 'zhi', + '踬' => 'zhi', + '郅' => 'zhi', + '觯' => 'zhi', + '锺' => 'zhong', + '螽' => 'zhong', + '舯' => 'zhong', + '碡' => 'zhou', + '绉' => 'zhou', + '荮' => 'zhou', + '籀' => 'zhou', + '酎' => 'zhou', + '洙' => 'zhu', + '邾' => 'zhu', + '潴' => 'zhu', + '槠' => 'zhu', + '橥' => 'zhu', + '舳' => 'zhu', + '瘃' => 'zhu', + '渚' => 'zhu', + '麈' => 'zhu', + '箸' => 'zhu', + '炷' => 'zhu', + '杼' => 'zhu', + '翥' => 'zhu', + '疰' => 'zhu', + '颛' => 'zhuan', + '赚' => 'zhuan', + '馔' => 'zhuan', + '僮' => 'tong', + '缒' => 'zhui', + '肫' => 'zhun', + '窀' => 'zhun', + '涿' => 'zhuo', + '倬' => 'zhuo', + '濯' => 'zhuo', + '诼' => 'zhuo', + '禚' => 'zhuo', + '浞' => 'zhuo', + '谘' => 'zi', + '淄' => 'zi', + '髭' => 'zi', + '孳' => 'zi', + '粢' => 'zi', + '趑' => 'zi', + '觜' => 'zui', + '缁' => 'zi', + '鲻' => 'zi', + '嵫' => 'zi', + '笫' => 'zi', + '耔' => 'zi', + '腙' => 'zong', + '偬' => 'zong', + '诹' => 'zou', + '陬' => 'zou', + '鄹' => 'zou', + '驺' => 'zou', + '鲰' => 'zou', + '菹' => 'ju', + '镞' => 'zu', + '躜' => 'zuan', + '缵' => 'zuan', + '蕞' => 'zui', + '撙' => 'zun', + '胙' => 'zuo', + '阿' => 'e', + '柏' => 'bai', + '蚌' => 'beng', + '薄' => 'bo', + '堡' => 'bao', + '呗' => 'bei', + '贲' => 'ben', + '臂' => 'bi', + '瘪' => 'bie', + '槟' => 'bin', + '剥' => 'bo', + '伯' => 'bo', + '卜' => 'bu', + '参' => 'can', + '嚓' => 'ca', + '差' => 'cha', + '孱' => 'chan', + '绰' => 'chuo', + '称' => 'cheng', + '澄' => 'cheng', + '大' => 'da', + '单' => 'dan', + '得' => 'de', + '的' => 'de', + '地' => 'di', + '都' => 'dou', + '读' => 'du', + '度' => 'du', + '蹲' => 'dun', + '佛' => 'fo', + '伽' => 'jia', + '盖' => 'gai', + '镐' => 'hao', + '给' => 'gei', + '呱' => 'gua', + '氿' => 'jiu', + '桧' => 'hui', + '掴' => 'guo', + '蛤' => 'ha', + '还' => 'hai', + '和' => 'he', + '核' => 'he', + '哼' => 'heng', + '鹄' => 'hu', + '划' => 'hua', + '夹' => 'jia', + '贾' => 'jia', + '芥' => 'jie', + '劲' => 'jin', + '荆' => 'jing', + '颈' => 'jing', + '貉' => 'he', + '吖' => 'a', + '啊' => 'a', + '锕' => 'a', + '哎' => 'ai', + '哀' => 'ai', + '埃' => 'ai', + '唉' => 'ai', + '欸' => 'ai', + '锿' => 'ai', + '挨' => 'ai', + '皑' => 'ai', + '癌' => 'ai', + '毐' => 'ai', + '矮' => 'ai', + '蔼' => 'ai', + '霭' => 'ai', + '砹' => 'ai', + '爱' => 'ai', + '隘' => 'ai', + '碍' => 'ai', + '嗳' => 'ai', + '嫒' => 'ai', + '叆' => 'ai', + '暧' => 'ai', + '安' => 'an', + '桉' => 'an', + '氨' => 'an', + '庵' => 'an', + '谙' => 'an', + '鹌' => 'an', + '鞍' => 'an', + '俺' => 'an', + '埯' => 'an', + '唵' => 'an', + '铵' => 'an', + '揞' => 'an', + '岸' => 'an', + '按' => 'an', + '胺' => 'an', + '案' => 'an', + '暗' => 'an', + '黯' => 'an', + '玵' => 'an', + '肮' => 'ang', + '昂' => 'ang', + '盎' => 'ang', + '凹' => 'ao', + '敖' => 'ao', + '遨' => 'ao', + '嗷' => 'ao', + '獒' => 'ao', + '熬' => 'ao', + '聱' => 'ao', + '螯' => 'ao', + '翱' => 'ao', + '謷' => 'ao', + '鏖' => 'ao', + '袄' => 'ao', + '媪' => 'ao', + '坳' => 'ao', + '傲' => 'ao', + '奥' => 'ao', + '骜' => 'ao', + '澳' => 'ao', + '懊' => 'ao', + '八' => 'ba', + '巴' => 'ba', + '叭' => 'ba', + '芭' => 'ba', + '疤' => 'ba', + '捌' => 'ba', + '笆' => 'ba', + '粑' => 'ba', + '拔' => 'ba', + '茇' => 'ba', + '妭' => 'ba', + '菝' => 'ba', + '跋' => 'ba', + '魃' => 'ba', + '把' => 'ba', + '靶' => 'ba', + '坝' => 'ba', + '爸' => 'ba', + '罢' => 'ba', + '霸' => 'ba', + '灞' => 'ba', + '吧' => 'ba', + '钯' => 'ba', + '掰' => 'bai', + '白' => 'bai', + '百' => 'bai', + '佰' => 'bai', + '捭' => 'bai', + '摆' => 'bai', + '败' => 'bai', + '拜' => 'bai', + '稗' => 'bai', + '扳' => 'ban', + '攽' => 'ban', + '班' => 'ban', + '般' => 'ban', + '颁' => 'ban', + '斑' => 'ban', + '搬' => 'ban', + '瘢' => 'ban', + '阪' => 'ban', + '坂' => 'ban', + '板' => 'ban', + '版' => 'ban', + '钣' => 'ban', + '舨' => 'ban', + '办' => 'ban', + '半' => 'ban', + '伴' => 'ban', + '拌' => 'ban', + '绊' => 'ban', + '瓣' => 'ban', + '扮' => 'ban', + '邦' => 'bang', + '帮' => 'bang', + '梆' => 'bang', + '浜' => 'bang', + '绑' => 'bang', + '榜' => 'bang', + '棒' => 'bang', + '傍' => 'bang', + '谤' => 'bang', + '蒡' => 'bang', + '镑' => 'bang', + '包' => 'bao', + '苞' => 'bao', + '孢' => 'bao', + '胞' => 'bao', + '龅' => 'bao', + '煲' => 'bao', + '褒' => 'bao', + '雹' => 'bao', + '饱' => 'bao', + '宝' => 'bao', + '保' => 'bao', + '鸨' => 'bao', + '葆' => 'bao', + '褓' => 'bao', + '报' => 'bao', + '抱' => 'bao', + '趵' => 'bao', + '豹' => 'bao', + '鲍' => 'bao', + '暴' => 'bao', + '爆' => 'bao', + '枹' => 'bao', + '杯' => 'bei', + '卑' => 'bei', + '悲' => 'bei', + '碑' => 'bei', + '北' => 'bei', + '贝' => 'bei', + '狈' => 'bei', + '备' => 'bei', + '背' => 'bei', + '钡' => 'bei', + '倍' => 'bei', + '悖' => 'bei', + '被' => 'bei', + '辈' => 'bei', + '惫' => 'bei', + '焙' => 'bei', + '蓓' => 'bei', + '碚' => 'bei', + '褙' => 'bei', + '别' => 'bei', + '蹩' => 'bei', + '椑' => 'bei', + '奔' => 'ben', + '倴' => 'ben', + '犇' => 'ben', + '锛' => 'ben', + '本' => 'ben', + '苯' => 'ben', + '坌' => 'ben', + '笨' => 'ben', + '崩' => 'beng', + '绷' => 'beng', + '嘣' => 'beng', + '甭' => 'beng', + '泵' => 'beng', + '迸' => 'beng', + '镚' => 'beng', + '蹦' => 'beng', + '屄' => 'bi', + '逼' => 'bi', + '荸' => 'bi', + '鼻' => 'bi', + '匕' => 'bi', + '比' => 'bi', + '吡' => 'bi', + '沘' => 'bi', + '妣' => 'bi', + '彼' => 'bi', + '秕' => 'bi', + '笔' => 'bi', + '俾' => 'bi', + '鄙' => 'bi', + '币' => 'bi', + '必' => 'bi', + '毕' => 'bi', + '闭' => 'bi', + '庇' => 'bi', + '诐' => 'bi', + '苾' => 'bi', + '荜' => 'bi', + '毖' => 'bi', + '哔' => 'bi', + '陛' => 'bi', + '毙' => 'bi', + '铋' => 'bi', + '狴' => 'bi', + '萆' => 'bi', + '梐' => 'bi', + '敝' => 'bi', + '婢' => 'bi', + '赑' => 'bi', + '愎' => 'bi', + '弼' => 'bi', + '蓖' => 'bi', + '痹' => 'bi', + '滗' => 'bi', + '碧' => 'bi', + '蔽' => 'bi', + '馝' => 'bi', + '弊' => 'bi', + '薜' => 'bi', + '篦' => 'bi', + '壁' => 'bi', + '避' => 'bi', + '髀' => 'bi', + '璧' => 'bi', + '芘' => 'bi', + '边' => 'bian', + '砭' => 'bian', + '萹' => 'bian', + '编' => 'bian', + '煸' => 'bian', + '蝙' => 'bian', + '鳊' => 'bian', + '鞭' => 'bian', + '贬' => 'bian', + '匾' => 'bian', + '褊' => 'bian', + '藊' => 'bian', + '卞' => 'bian', + '抃' => 'bian', + '苄' => 'bian', + '汴' => 'bian', + '忭' => 'bian', + '变' => 'bian', + '遍' => 'bian', + '辨' => 'bian', + '辩' => 'bian', + '辫' => 'bian', + '标' => 'biao', + '骉' => 'biao', + '彪' => 'biao', + '摽' => 'biao', + '膘' => 'biao', + '飙' => 'biao', + '镖' => 'biao', + '瀌' => 'biao', + '镳' => 'biao', + '表' => 'biao', + '婊' => 'biao', + '裱' => 'biao', + '鳔' => 'biao', + '憋' => 'bie', + '鳖' => 'bie', + '宾' => 'bin', + '彬' => 'bin', + '傧' => 'bin', + '滨' => 'bin', + '缤' => 'bin', + '濒' => 'bin', + '摈' => 'bin', + '殡' => 'bin', + '髌' => 'bin', + '鬓' => 'bin', + '冰' => 'bing', + '兵' => 'bing', + '丙' => 'bing', + '邴' => 'bing', + '秉' => 'bing', + '柄' => 'bing', + '饼' => 'bing', + '炳' => 'bing', + '禀' => 'bing', + '并' => 'bing', + '病' => 'bing', + '摒' => 'bing', + '拨' => 'bo', + '波' => 'bo', + '玻' => 'bo', + '钵' => 'bo', + '饽' => 'bo', + '袯' => 'bo', + '菠' => 'bo', + '播' => 'bo', + '驳' => 'bo', + '帛' => 'bo', + '勃' => 'bo', + '钹' => 'bo', + '铂' => 'bo', + '亳' => 'bo', + '舶' => 'bo', + '脖' => 'bo', + '博' => 'bo', + '鹁' => 'bo', + '渤' => 'bo', + '搏' => 'bo', + '馎' => 'bo', + '箔' => 'bo', + '膊' => 'bo', + '踣' => 'bo', + '馞' => 'bo', + '礴' => 'bo', + '跛' => 'bo', + '檗' => 'bo', + '擘' => 'bo', + '簸' => 'bo', + '啵' => 'bo', + '蕃' => 'bo', + '哱' => 'bo', + '卟' => 'bu', + '补' => 'bu', + '捕' => 'bu', + '哺' => 'bu', + '不' => 'bu', + '布' => 'bu', + '步' => 'bu', + '怖' => 'bu', + '钚' => 'bu', + '部' => 'bu', + '埠' => 'bu', + '簿' => 'bu', + '擦' => 'ca', + '猜' => 'cai', + '才' => 'cai', + '材' => 'cai', + '财' => 'cai', + '裁' => 'cai', + '采' => 'cai', + '彩' => 'cai', + '睬' => 'cai', + '踩' => 'cai', + '菜' => 'cai', + '蔡' => 'cai', + '餐' => 'can', + '残' => 'can', + '蚕' => 'can', + '惭' => 'can', + '惨' => 'can', + '黪' => 'can', + '灿' => 'can', + '粲' => 'can', + '璨' => 'can', + '穇' => 'can', + '仓' => 'cang', + '伧' => 'cang', + '苍' => 'cang', + '沧' => 'cang', + '舱' => 'cang', + '操' => 'cao', + '糙' => 'cao', + '曹' => 'cao', + '嘈' => 'cao', + '漕' => 'cao', + '槽' => 'cao', + '螬' => 'cao', + '草' => 'cao', + '册' => 'ce', + '厕' => 'ce', + '测' => 'ce', + '恻' => 'ce', + '策' => 'ce', + '岑' => 'cen', + '涔' => 'cen', + '噌' => 'ceng', + '层' => 'ceng', + '嶒' => 'ceng', + '蹭' => 'ceng', + '叉' => 'cha', + '杈' => 'cha', + '插' => 'cha', + '馇' => 'cha', + '锸' => 'cha', + '茬' => 'cha', + '茶' => 'cha', + '搽' => 'cha', + '嵖' => 'cha', + '猹' => 'cha', + '槎' => 'cha', + '碴' => 'cha', + '察' => 'cha', + '檫' => 'cha', + '衩' => 'cha', + '镲' => 'cha', + '汊' => 'cha', + '岔' => 'cha', + '侘' => 'cha', + '诧' => 'cha', + '姹' => 'cha', + '蹅' => 'cha', + '拆' => 'chai', + '钗' => 'chai', + '侪' => 'chai', + '柴' => 'chai', + '豺' => 'chai', + '虿' => 'chai', + '茝' => 'chai', + '觇' => 'chan', + '掺' => 'chan', + '搀' => 'chan', + '襜' => 'chan', + '谗' => 'chan', + '婵' => 'chan', + '馋' => 'chan', + '缠' => 'chan', + '蝉' => 'chan', + '潺' => 'chan', + '蟾' => 'chan', + '巉' => 'chan', + '产' => 'chan', + '浐' => 'chan', + '谄' => 'chan', + '铲' => 'chan', + '阐' => 'chan', + '蒇' => 'chan', + '骣' => 'chan', + '冁' => 'chan', + '忏' => 'chan', + '颤' => 'chan', + '羼' => 'chan', + '韂' => 'chan', + '伥' => 'chang', + '昌' => 'chang', + '菖' => 'chang', + '猖' => 'chang', + '娼' => 'chang', + '肠' => 'chang', + '尝' => 'chang', + '常' => 'chang', + '偿' => 'chang', + '徜' => 'chang', + '嫦' => 'chang', + '厂' => 'chang', + '场' => 'chang', + '昶' => 'chang', + '惝' => 'chang', + '敞' => 'chang', + '怅' => 'chang', + '畅' => 'chang', + '倡' => 'chang', + '唱' => 'chang', + '裳' => 'chang', + '抄' => 'chao', + '怊' => 'chao', + '钞' => 'chao', + '超' => 'chao', + '晁' => 'chao', + '巢' => 'chao', + '嘲' => 'chao', + '潮' => 'chao', + '吵' => 'chao', + '炒' => 'chao', + '耖' => 'chao', + '砗' => 'che', + '扯' => 'che', + '彻' => 'che', + '坼' => 'che', + '掣' => 'che', + '撤' => 'che', + '澈' => 'che', + '瞮' => 'che', + '抻' => 'chen', + '郴' => 'chen', + '嗔' => 'chen', + '瞋' => 'chen', + '臣' => 'chen', + '尘' => 'chen', + '辰' => 'chen', + '沉' => 'chen', + '忱' => 'chen', + '陈' => 'chen', + '宸' => 'chen', + '晨' => 'chen', + '谌' => 'chen', + '碜' => 'chen', + '衬' => 'chen', + '龀' => 'chen', + '趁' => 'chen', + '柽' => 'cheng', + '琤' => 'cheng', + '撑' => 'cheng', + '瞠' => 'cheng', + '成' => 'cheng', + '丞' => 'cheng', + '呈' => 'cheng', + '诚' => 'cheng', + '承' => 'cheng', + '城' => 'cheng', + '铖' => 'cheng', + '程' => 'cheng', + '惩' => 'cheng', + '酲' => 'cheng', + '橙' => 'cheng', + '逞' => 'cheng', + '骋' => 'cheng', + '秤' => 'cheng', + '铛' => 'cheng', + '樘' => 'cheng', + '吃' => 'chi', + '哧' => 'chi', + '鸱' => 'chi', + '蚩' => 'chi', + '笞' => 'chi', + '嗤' => 'chi', + '痴' => 'chi', + '媸' => 'chi', + '魑' => 'chi', + '池' => 'chi', + '弛' => 'chi', + '驰' => 'chi', + '迟' => 'chi', + '茌' => 'chi', + '持' => 'chi', + '踟' => 'chi', + '尺' => 'chi', + '齿' => 'chi', + '侈' => 'chi', + '耻' => 'chi', + '豉' => 'chi', + '褫' => 'chi', + '彳' => 'chi', + '叱' => 'chi', + '斥' => 'chi', + '赤' => 'chi', + '饬' => 'chi', + '炽' => 'chi', + '翅' => 'chi', + '敕' => 'chi', + '啻' => 'chi', + '傺' => 'chi', + '匙' => 'chi', + '冲' => 'chong', + '充' => 'chong', + '忡' => 'chong', + '茺' => 'chong', + '舂' => 'chong', + '憧' => 'chong', + '艟' => 'chong', + '虫' => 'chong', + '崇' => 'chong', + '宠' => 'chong', + '铳' => 'chong', + '抽' => 'chou', + '瘳' => 'chou', + '惆' => 'chou', + '绸' => 'chou', + '畴' => 'chou', + '酬' => 'chou', + '稠' => 'chou', + '愁' => 'chou', + '筹' => 'chou', + '踌' => 'chou', + '丑' => 'chou', + '瞅' => 'chou', + '出' => 'chu', + '初' => 'chu', + '樗' => 'chu', + '刍' => 'chu', + '除' => 'chu', + '厨' => 'chu', + '锄' => 'chu', + '滁' => 'chu', + '蜍' => 'chu', + '雏' => 'chu', + '橱' => 'chu', + '躇' => 'chu', + '蹰' => 'chu', + '杵' => 'chu', + '础' => 'chu', + '储' => 'chu', + '楚' => 'chu', + '褚' => 'chu', + '亍' => 'chu', + '处' => 'chu', + '怵' => 'chu', + '绌' => 'chu', + '搐' => 'chu', + '触' => 'chu', + '憷' => 'chu', + '黜' => 'chu', + '矗' => 'chu', + '揣' => 'chuai', + '搋' => 'chuai', + '膗' => 'chuai', + '踹' => 'chuai', + '川' => 'chuan', + '氚' => 'chuan', + '穿' => 'chuan', + '舡' => 'chuan', + '船' => 'chuan', + '遄' => 'chuan', + '椽' => 'chuan', + '舛' => 'chuan', + '喘' => 'chuan', + '串' => 'chuan', + '钏' => 'chuan', + '疮' => 'chuang', + '窗' => 'chuang', + '床' => 'chuang', + '闯' => 'chuang', + '创' => 'chuang', + '怆' => 'chuang', + '吹' => 'chui', + '炊' => 'chui', + '垂' => 'chui', + '陲' => 'chui', + '捶' => 'chui', + '棰' => 'chui', + '槌' => 'chui', + '锤' => 'chui', + '春' => 'chun', + '瑃' => 'chun', + '椿' => 'chun', + '蝽' => 'chun', + '纯' => 'chun', + '莼' => 'chun', + '唇' => 'chun', + '淳' => 'chun', + '鹑' => 'chun', + '醇' => 'chun', + '蠢' => 'chun', + '踔' => 'chuo', + '戳' => 'chuo', + '啜' => 'chuo', + '惙' => 'chuo', + '辍' => 'chuo', + '龊' => 'chuo', + '歠' => 'chuo', + '疵' => 'ci', + '词' => 'ci', + '茈' => 'ci', + '茨' => 'ci', + '祠' => 'ci', + '瓷' => 'ci', + '辞' => 'ci', + '慈' => 'ci', + '磁' => 'ci', + '雌' => 'ci', + '鹚' => 'ci', + '糍' => 'ci', + '此' => 'ci', + '泚' => 'ci', + '跐' => 'ci', + '次' => 'ci', + '刺' => 'ci', + '佽' => 'ci', + '赐' => 'ci', + '匆' => 'cong', + '苁' => 'cong', + '囱' => 'cong', + '枞' => 'cong', + '葱' => 'cong', + '骢' => 'cong', + '聪' => 'cong', + '从' => 'cong', + '丛' => 'cong', + '淙' => 'cong', + '悰' => 'cong', + '琮' => 'cong', + '凑' => 'cou', + '辏' => 'cou', + '腠' => 'cou', + '粗' => 'cu', + '徂' => 'cu', + '殂' => 'cu', + '促' => 'cu', + '猝' => 'cu', + '蔟' => 'cu', + '醋' => 'cu', + '踧' => 'cu', + '簇' => 'cu', + '蹙' => 'cu', + '蹴' => 'cu', + '汆' => 'cuan', + '撺' => 'cuan', + '镩' => 'cuan', + '蹿' => 'cuan', + '窜' => 'cuan', + '篡' => 'cuan', + '崔' => 'cui', + '催' => 'cui', + '摧' => 'cui', + '璀' => 'cui', + '脆' => 'cui', + '萃' => 'cui', + '啐' => 'cui', + '淬' => 'cui', + '悴' => 'cui', + '毳' => 'cui', + '瘁' => 'cui', + '粹' => 'cui', + '翠' => 'cui', + '村' => 'cun', + '皴' => 'cun', + '存' => 'cun', + '忖' => 'cun', + '寸' => 'cun', + '吋' => 'cun', + '搓' => 'cuo', + '磋' => 'cuo', + '蹉' => 'cuo', + '嵯' => 'cuo', + '矬' => 'cuo', + '痤' => 'cuo', + '脞' => 'cuo', + '挫' => 'cuo', + '莝' => 'cuo', + '厝' => 'cuo', + '措' => 'cuo', + '锉' => 'cuo', + '错' => 'cuo', + '酇' => 'cuo', + '咑' => 'da', + '垯' => 'da', + '耷' => 'da', + '搭' => 'da', + '褡' => 'da', + '达' => 'da', + '怛' => 'da', + '妲' => 'da', + '荙' => 'da', + '笪' => 'da', + '答' => 'da', + '跶' => 'da', + '靼' => 'da', + '瘩' => 'da', + '鞑' => 'da', + '打' => 'da', + '呆' => 'dai', + '歹' => 'dai', + '逮' => 'dai', + '傣' => 'dai', + '代' => 'dai', + '岱' => 'dai', + '迨' => 'dai', + '玳' => 'dai', + '带' => 'dai', + '殆' => 'dai', + '贷' => 'dai', + '待' => 'dai', + '怠' => 'dai', + '袋' => 'dai', + '叇' => 'dai', + '戴' => 'dai', + '黛' => 'dai', + '襶' => 'dai', + '呔' => 'dai', + '丹' => 'dan', + '担' => 'dan', + '眈' => 'dan', + '耽' => 'dan', + '郸' => 'dan', + '聃' => 'dan', + '殚' => 'dan', + '瘅' => 'dan', + '箪' => 'dan', + '儋' => 'dan', + '胆' => 'dan', + '疸' => 'dan', + '掸' => 'dan', + '亶' => 'dan', + '旦' => 'dan', + '但' => 'dan', + '诞' => 'dan', + '萏' => 'dan', + '啖' => 'dan', + '淡' => 'dan', + '惮' => 'dan', + '蛋' => 'dan', + '氮' => 'dan', + '赕' => 'dan', + '当' => 'dang', + '裆' => 'dang', + '挡' => 'dang', + '档' => 'dang', + '党' => 'dang', + '谠' => 'dang', + '凼' => 'dang', + '砀' => 'dang', + '宕' => 'dang', + '荡' => 'dang', + '菪' => 'dang', + '刀' => 'dao', + '忉' => 'dao', + '氘' => 'dao', + '舠' => 'dao', + '导' => 'dao', + '岛' => 'dao', + '捣' => 'dao', + '倒' => 'dao', + '捯' => 'dao', + '祷' => 'dao', + '蹈' => 'dao', + '到' => 'dao', + '盗' => 'dao', + '悼' => 'dao', + '道' => 'dao', + '稻' => 'dao', + '焘' => 'dao', + '锝' => 'de', + '嘚' => 'de', + '德' => 'de', + '扽' => 'den', + '灯' => 'deng', + '登' => 'deng', + '噔' => 'deng', + '蹬' => 'deng', + '等' => 'deng', + '戥' => 'deng', + '邓' => 'deng', + '僜' => 'deng', + '凳' => 'deng', + '嶝' => 'deng', + '磴' => 'deng', + '瞪' => 'deng', + '镫' => 'deng', + '低' => 'di', + '羝' => 'di', + '堤' => 'di', + '嘀' => 'di', + '滴' => 'di', + '狄' => 'di', + '迪' => 'di', + '籴' => 'di', + '荻' => 'di', + '敌' => 'di', + '涤' => 'di', + '笛' => 'di', + '觌' => 'di', + '嫡' => 'di', + '镝' => 'di', + '氐' => 'di', + '邸' => 'di', + '诋' => 'di', + '抵' => 'di', + '底' => 'di', + '柢' => 'di', + '砥' => 'di', + '骶' => 'di', + '玓' => 'di', + '弟' => 'di', + '帝' => 'di', + '递' => 'di', + '娣' => 'di', + '第' => 'di', + '谛' => 'di', + '蒂' => 'di', + '棣' => 'di', + '睇' => 'di', + '缔' => 'di', + '碲' => 'di', + '嗲' => 'dia', + '掂' => 'dian', + '滇' => 'dian', + '颠' => 'dian', + '巅' => 'dian', + '癫' => 'dian', + '典' => 'dian', + '点' => 'dian', + '碘' => 'dian', + '踮' => 'dian', + '电' => 'dian', + '甸' => 'dian', + '阽' => 'dian', + '坫' => 'dian', + '店' => 'dian', + '玷' => 'dian', + '垫' => 'dian', + '钿' => 'dian', + '淀' => 'dian', + '惦' => 'dian', + '奠' => 'dian', + '殿' => 'dian', + '靛' => 'dian', + '刁' => 'diao', + '叼' => 'diao', + '汈' => 'diao', + '凋' => 'diao', + '貂' => 'diao', + '碉' => 'diao', + '雕' => 'diao', + '鲷' => 'diao', + '屌' => 'diao', + '吊' => 'diao', + '钓' => 'diao', + '窎' => 'diao', + '掉' => 'diao', + '铫' => 'diao', + '爹' => 'die', + '跌' => 'die', + '迭' => 'die', + '谍' => 'die', + '耋' => 'die', + '喋' => 'die', + '牒' => 'die', + '叠' => 'die', + '碟' => 'die', + '嵽' => 'die', + '蝶' => 'die', + '蹀' => 'die', + '鲽' => 'die', + '仃' => 'ding', + '叮' => 'ding', + '玎' => 'ding', + '盯' => 'ding', + '町' => 'ding', + '耵' => 'ding', + '顶' => 'ding', + '酊' => 'ding', + '鼎' => 'ding', + '订' => 'ding', + '钉' => 'ding', + '定' => 'ding', + '啶' => 'ding', + '腚' => 'ding', + '碇' => 'ding', + '锭' => 'ding', + '丢' => 'diu', + '铥' => 'diu', + '东' => 'dong', + '冬' => 'dong', + '咚' => 'dong', + '氡' => 'dong', + '鸫' => 'dong', + '董' => 'dong', + '懂' => 'dong', + '动' => 'dong', + '冻' => 'dong', + '侗' => 'dong', + '栋' => 'dong', + '胨' => 'dong', + '洞' => 'dong', + '胴' => 'dong', + '兜' => 'dou', + '蔸' => 'dou', + '篼' => 'dou', + '抖' => 'dou', + '陡' => 'dou', + '蚪' => 'dou', + '斗' => 'dou', + '豆' => 'dou', + '逗' => 'dou', + '痘' => 'dou', + '窦' => 'dou', + '督' => 'du', + '嘟' => 'du', + '毒' => 'du', + '独' => 'du', + '渎' => 'du', + '椟' => 'du', + '犊' => 'du', + '牍' => 'du', + '黩' => 'du', + '髑' => 'du', + '厾' => 'du', + '笃' => 'du', + '堵' => 'du', + '赌' => 'du', + '睹' => 'du', + '杜' => 'du', + '肚' => 'du', + '妒' => 'du', + '渡' => 'du', + '镀' => 'du', + '蠹' => 'du', + '端' => 'duan', + '短' => 'duan', + '段' => 'duan', + '断' => 'duan', + '缎' => 'duan', + '椴' => 'duan', + '锻' => 'duan', + '簖' => 'duan', + '堆' => 'dui', + '队' => 'dui', + '对' => 'dui', + '兑' => 'dui', + '怼' => 'dui', + '憝' => 'dui', + '吨' => 'dun', + '惇' => 'dun', + '敦' => 'dun', + '墩' => 'dun', + '礅' => 'dun', + '盹' => 'dun', + '趸' => 'dun', + '沌' => 'dun', + '炖' => 'dun', + '砘' => 'dun', + '钝' => 'dun', + '盾' => 'dun', + '顿' => 'dun', + '遁' => 'dun', + '多' => 'duo', + '咄' => 'duo', + '哆' => 'duo', + '掇' => 'duo', + '裰' => 'duo', + '夺' => 'duo', + '踱' => 'duo', + '朵' => 'duo', + '垛' => 'duo', + '哚' => 'duo', + '躲' => 'duo', + '亸' => 'duo', + '剁' => 'duo', + '舵' => 'duo', + '堕' => 'duo', + '惰' => 'duo', + '跺' => 'duo', + '屙' => 'e', + '婀' => 'e', + '讹' => 'e', + '囮' => 'e', + '俄' => 'e', + '莪' => 'e', + '峨' => 'e', + '娥' => 'e', + '锇' => 'e', + '鹅' => 'e', + '蛾' => 'e', + '额' => 'e', + '厄' => 'e', + '扼' => 'e', + '苊' => 'e', + '呃' => 'e', + '垩' => 'e', + '饿' => 'e', + '鄂' => 'e', + '谔' => 'e', + '萼' => 'e', + '遏' => 'e', + '愕' => 'e', + '腭' => 'e', + '颚' => 'e', + '噩' => 'e', + '鳄' => 'e', + '恩' => 'en', + '蒽' => 'en', + '摁' => 'en', + '鞥' => 'eng', + '儿' => 'er', + '而' => 'er', + '鸸' => 'er', + '尔' => 'er', + '耳' => 'er', + '迩' => 'er', + '饵' => 'er', + '洱' => 'er', + '铒' => 'er', + '二' => 'er', + '贰' => 'er', + '发' => 'fa', + '乏' => 'fa', + '伐' => 'fa', + '罚' => 'fa', + '垡' => 'fa', + '阀' => 'fa', + '筏' => 'fa', + '法' => 'fa', + '砝' => 'fa', + '珐' => 'fa', + '帆' => 'fan', + '幡' => 'fan', + '藩' => 'fan', + '翻' => 'fan', + '凡' => 'fan', + '矾' => 'fan', + '钒' => 'fan', + '烦' => 'fan', + '樊' => 'fan', + '燔' => 'fan', + '繁' => 'fan', + '蹯' => 'fan', + '蘩' => 'fan', + '反' => 'fan', + '返' => 'fan', + '犯' => 'fan', + '饭' => 'fan', + '泛' => 'fan', + '范' => 'fan', + '贩' => 'fan', + '畈' => 'fan', + '梵' => 'fan', + '方' => 'fang', + '邡' => 'fang', + '坊' => 'fang', + '芳' => 'fang', + '枋' => 'fang', + '钫' => 'fang', + '防' => 'fang', + '妨' => 'fang', + '肪' => 'fang', + '房' => 'fang', + '鲂' => 'fang', + '仿' => 'fang', + '访' => 'fang', + '纺' => 'fang', + '舫' => 'fang', + '放' => 'fang', + '飞' => 'fei', + '妃' => 'fei', + '非' => 'fei', + '菲' => 'fei', + '啡' => 'fei', + '绯' => 'fei', + '扉' => 'fei', + '肥' => 'fei', + '淝' => 'fei', + '腓' => 'fei', + '匪' => 'fei', + '诽' => 'fei', + '悱' => 'fei', + '棐' => 'fei', + '斐' => 'fei', + '榧' => 'fei', + '翡' => 'fei', + '篚' => 'fei', + '吠' => 'fei', + '肺' => 'fei', + '狒' => 'fei', + '废' => 'fei', + '沸' => 'fei', + '费' => 'fei', + '痱' => 'fei', + '镄' => 'fei', + '分' => 'fen', + '芬' => 'fen', + '吩' => 'fen', + '纷' => 'fen', + '氛' => 'fen', + '酚' => 'fen', + '坟' => 'fen', + '汾' => 'fen', + '棼' => 'fen', + '焚' => 'fen', + '鼢' => 'fen', + '粉' => 'fen', + '份' => 'fen', + '奋' => 'fen', + '忿' => 'fen', + '偾' => 'fen', + '粪' => 'fen', + '愤' => 'fen', + '丰' => 'feng', + '风' => 'feng', + '沣' => 'feng', + '枫' => 'feng', + '封' => 'feng', + '砜' => 'feng', + '疯' => 'feng', + '峰' => 'feng', + '烽' => 'feng', + '葑' => 'feng', + '锋' => 'feng', + '蜂' => 'feng', + '酆' => 'feng', + '冯' => 'feng', + '逢' => 'feng', + '缝' => 'feng', + '讽' => 'feng', + '唪' => 'feng', + '凤' => 'feng', + '奉' => 'feng', + '俸' => 'feng', + '缶' => 'fou', + '夫' => 'fu', + '呋' => 'fu', + '肤' => 'fu', + '麸' => 'fu', + '跗' => 'fu', + '稃' => 'fu', + '孵' => 'fu', + '敷' => 'fu', + '弗' => 'fu', + '伏' => 'fu', + '凫' => 'fu', + '扶' => 'fu', + '芙' => 'fu', + '孚' => 'fu', + '拂' => 'fu', + '苻' => 'fu', + '服' => 'fu', + '怫' => 'fu', + '茯' => 'fu', + '氟' => 'fu', + '俘' => 'fu', + '浮' => 'fu', + '符' => 'fu', + '匐' => 'fu', + '涪' => 'fu', + '艴' => 'fu', + '幅' => 'fu', + '辐' => 'fu', + '蜉' => 'fu', + '福' => 'fu', + '蝠' => 'fu', + '抚' => 'fu', + '甫' => 'fu', + '拊' => 'fu', + '斧' => 'fu', + '府' => 'fu', + '俯' => 'fu', + '釜' => 'fu', + '辅' => 'fu', + '腑' => 'fu', + '腐' => 'fu', + '父' => 'fu', + '讣' => 'fu', + '付' => 'fu', + '负' => 'fu', + '妇' => 'fu', + '附' => 'fu', + '咐' => 'fu', + '阜' => 'fu', + '驸' => 'fu', + '赴' => 'fu', + '复' => 'fu', + '副' => 'fu', + '赋' => 'fu', + '傅' => 'fu', + '富' => 'fu', + '腹' => 'fu', + '缚' => 'fu', + '赙' => 'fu', + '蝮' => 'fu', + '覆' => 'fu', + '馥' => 'fu', + '袱' => 'fu', + '旮' => 'ga', + '嘎' => 'ga', + '钆' => 'ga', + '尜' => 'ga', + '尕' => 'ga', + '尬' => 'ga', + '该' => 'gai', + '垓' => 'gai', + '荄' => 'gai', + '赅' => 'gai', + '改' => 'gai', + '丐' => 'gai', + '钙' => 'gai', + '溉' => 'gai', + '概' => 'gai', + '甘' => 'gan', + '玕' => 'gan', + '肝' => 'gan', + '坩' => 'gan', + '苷' => 'gan', + '矸' => 'gan', + '泔' => 'gan', + '柑' => 'gan', + '竿' => 'gan', + '酐' => 'gan', + '疳' => 'gan', + '尴' => 'gan', + '杆' => 'gan', + '秆' => 'gan', + '赶' => 'gan', + '敢' => 'gan', + '感' => 'gan', + '澉' => 'gan', + '橄' => 'gan', + '擀' => 'gan', + '干' => 'gan', + '旰' => 'gan', + '绀' => 'gan', + '淦' => 'gan', + '骭' => 'gan', + '赣' => 'gan', + '冈' => 'gang', + '冮' => 'gang', + '刚' => 'gang', + '肛' => 'gang', + '纲' => 'gang', + '钢' => 'gang', + '缸' => 'gang', + '罡' => 'gang', + '岗' => 'gang', + '港' => 'gang', + '杠' => 'gang', + '皋' => 'gao', + '高' => 'gao', + '羔' => 'gao', + '睾' => 'gao', + '膏' => 'gao', + '篙' => 'gao', + '糕' => 'gao', + '杲' => 'gao', + '搞' => 'gao', + '槁' => 'gao', + '稿' => 'gao', + '告' => 'gao', + '郜' => 'gao', + '诰' => 'gao', + '锆' => 'gao', + '戈' => 'ge', + '圪' => 'ge', + '纥' => 'ge', + '疙' => 'ge', + '哥' => 'ge', + '胳' => 'ge', + '鸽' => 'ge', + '袼' => 'ge', + '搁' => 'ge', + '割' => 'ge', + '歌' => 'ge', + '革' => 'ge', + '阁' => 'ge', + '格' => 'ge', + '隔' => 'ge', + '嗝' => 'ge', + '膈' => 'ge', + '骼' => 'ge', + '镉' => 'ge', + '舸' => 'ge', + '葛' => 'ge', + '个' => 'ge', + '各' => 'ge', + '虼' => 'ge', + '硌' => 'ge', + '铬' => 'ge', + '根' => 'gen', + '跟' => 'gen', + '哏' => 'gen', + '亘' => 'gen', + '艮' => 'gen', + '茛' => 'gen', + '庚' => 'geng', + '耕' => 'geng', + '浭' => 'geng', + '赓' => 'geng', + '羹' => 'geng', + '埂' => 'geng', + '耿' => 'geng', + '哽' => 'geng', + '绠' => 'geng', + '梗' => 'geng', + '鲠' => 'geng', + '更' => 'geng', + '工' => 'gong', + '弓' => 'gong', + '公' => 'gong', + '功' => 'gong', + '攻' => 'gong', + '肱' => 'gong', + '宫' => 'gong', + '恭' => 'gong', + '蚣' => 'gong', + '躬' => 'gong', + '龚' => 'gong', + '塨' => 'gong', + '觥' => 'gong', + '巩' => 'gong', + '汞' => 'gong', + '拱' => 'gong', + '珙' => 'gong', + '共' => 'gong', + '贡' => 'gong', + '供' => 'gong', + '勾' => 'gou', + '佝' => 'gou', + '沟' => 'gou', + '钩' => 'gou', + '篝' => 'gou', + '苟' => 'gou', + '岣' => 'gou', + '狗' => 'gou', + '枸' => 'gou', + '构' => 'gou', + '购' => 'gou', + '诟' => 'gou', + '垢' => 'gou', + '够' => 'gou', + '彀' => 'gou', + '媾' => 'gou', + '觏' => 'gou', + '估' => 'gu', + '咕' => 'gu', + '沽' => 'gu', + '孤' => 'gu', + '姑' => 'gu', + '轱' => 'gu', + '鸪' => 'gu', + '菰' => 'gu', + '菇' => 'gu', + '蛄' => 'gu', + '蓇' => 'gu', + '辜' => 'gu', + '酤' => 'gu', + '觚' => 'gu', + '毂' => 'gu', + '箍' => 'gu', + '古' => 'gu', + '谷' => 'gu', + '汩' => 'gu', + '诂' => 'gu', + '股' => 'gu', + '骨' => 'gu', + '牯' => 'gu', + '钴' => 'gu', + '羖' => 'gu', + '蛊' => 'gu', + '鼓' => 'gu', + '榾' => 'gu', + '鹘' => 'gu', + '臌' => 'gu', + '瀔' => 'gu', + '固' => 'gu', + '故' => 'gu', + '顾' => 'gu', + '梏' => 'gu', + '崮' => 'gu', + '雇' => 'gu', + '锢' => 'gu', + '痼' => 'gu', + '瓜' => 'gua', + '刮' => 'gua', + '胍' => 'gua', + '鸹' => 'gua', + '剐' => 'gua', + '寡' => 'gua', + '卦' => 'gua', + '诖' => 'gua', + '挂' => 'gua', + '褂' => 'gua', + '乖' => 'guai', + '拐' => 'guai', + '怪' => 'guai', + '关' => 'guan', + '观' => 'guan', + '官' => 'guan', + '倌' => 'guan', + '蒄' => 'guan', + '棺' => 'guan', + '瘝' => 'guan', + '鳏' => 'guan', + '馆' => 'guan', + '管' => 'guan', + '贯' => 'guan', + '冠' => 'guan', + '掼' => 'guan', + '惯' => 'guan', + '祼' => 'guan', + '盥' => 'guan', + '灌' => 'guan', + '瓘' => 'guan', + '鹳' => 'guan', + '罐' => 'guan', + '琯' => 'guan', + '光' => 'guang', + '咣' => 'guang', + '胱' => 'guang', + '广' => 'guang', + '犷' => 'guang', + '桄' => 'guang', + '逛' => 'guang', + '归' => 'gui', + '圭' => 'gui', + '龟' => 'gui', + '妫' => 'gui', + '规' => 'gui', + '皈' => 'gui', + '闺' => 'gui', + '硅' => 'gui', + '瑰' => 'gui', + '鲑' => 'gui', + '宄' => 'gui', + '轨' => 'gui', + '庋' => 'gui', + '匦' => 'gui', + '诡' => 'gui', + '鬼' => 'gui', + '姽' => 'gui', + '癸' => 'gui', + '晷' => 'gui', + '簋' => 'gui', + '柜' => 'gui', + '炅' => 'gui', + '刿' => 'gui', + '刽' => 'gui', + '贵' => 'gui', + '桂' => 'gui', + '跪' => 'gui', + '鳜' => 'gui', + '衮' => 'gun', + '绲' => 'gun', + '辊' => 'gun', + '滚' => 'gun', + '磙' => 'gun', + '鲧' => 'gun', + '棍' => 'gun', + '埚' => 'guo', + '郭' => 'guo', + '啯' => 'guo', + '崞' => 'guo', + '聒' => 'guo', + '锅' => 'guo', + '蝈' => 'guo', + '国' => 'guo', + '帼' => 'guo', + '虢' => 'guo', + '果' => 'guo', + '椁' => 'guo', + '蜾' => 'guo', + '裹' => 'guo', + '过' => 'guo', + '哈' => 'ha', + '铪' => 'ha', + '孩' => 'hai', + '骸' => 'hai', + '胲' => 'hai', + '海' => 'hai', + '醢' => 'hai', + '亥' => 'hai', + '骇' => 'hai', + '害' => 'hai', + '嗐' => 'hai', + '嗨' => 'hai', + '顸' => 'han', + '蚶' => 'han', + '酣' => 'han', + '憨' => 'han', + '鼾' => 'han', + '邗' => 'han', + '邯' => 'han', + '含' => 'han', + '函' => 'han', + '晗' => 'han', + '焓' => 'han', + '涵' => 'han', + '韩' => 'han', + '寒' => 'han', + '罕' => 'han', + '喊' => 'han', + '蔊' => 'han', + '汉' => 'han', + '汗' => 'han', + '旱' => 'han', + '捍' => 'han', + '悍' => 'han', + '菡' => 'han', + '焊' => 'han', + '撖' => 'han', + '撼' => 'han', + '翰' => 'han', + '憾' => 'han', + '瀚' => 'han', + '夯' => 'hang', + '杭' => 'hang', + '绗' => 'hang', + '航' => 'hang', + '沆' => 'hang', + '蒿' => 'hao', + '薅' => 'hao', + '嚆' => 'hao', + '蚝' => 'hao', + '毫' => 'hao', + '嗥' => 'hao', + '豪' => 'hao', + '壕' => 'hao', + '嚎' => 'hao', + '濠' => 'hao', + '好' => 'hao', + '郝' => 'hao', + '号' => 'hao', + '昊' => 'hao', + '耗' => 'hao', + '浩' => 'hao', + '皓' => 'hao', + '滈' => 'hao', + '颢' => 'hao', + '灏' => 'hao', + '诃' => 'he', + '呵' => 'he', + '喝' => 'he', + '嗬' => 'he', + '禾' => 'he', + '合' => 'he', + '何' => 'he', + '劾' => 'he', + '河' => 'he', + '曷' => 'he', + '阂' => 'he', + '盍' => 'he', + '荷' => 'he', + '菏' => 'he', + '盒' => 'he', + '涸' => 'he', + '颌' => 'he', + '阖' => 'he', + '贺' => 'he', + '赫' => 'he', + '褐' => 'he', + '鹤' => 'he', + '壑' => 'he', + '黑' => 'hei', + '嘿' => 'hei', + '痕' => 'hen', + '很' => 'hen', + '狠' => 'hen', + '恨' => 'hen', + '亨' => 'heng', + '恒' => 'heng', + '珩' => 'heng', + '横' => 'heng', + '衡' => 'heng', + '蘅' => 'heng', + '啈' => 'heng', + '轰' => 'hong', + '訇' => 'hong', + '烘' => 'hong', + '薨' => 'hong', + '弘' => 'hong', + '红' => 'hong', + '闳' => 'hong', + '宏' => 'hong', + '荭' => 'hong', + '虹' => 'hong', + '竑' => 'hong', + '洪' => 'hong', + '鸿' => 'hong', + '哄' => 'hong', + '讧' => 'hong', + '吽' => 'hong', + '齁' => 'hou', + '侯' => 'hou', + '喉' => 'hou', + '猴' => 'hou', + '瘊' => 'hou', + '骺' => 'hou', + '篌' => 'hou', + '糇' => 'hou', + '吼' => 'hou', + '后' => 'hou', + '郈' => 'hou', + '厚' => 'hou', + '垕' => 'hou', + '逅' => 'hou', + '候' => 'hou', + '堠' => 'hou', + '鲎' => 'hou', + '乎' => 'hu', + '呼' => 'hu', + '忽' => 'hu', + '轷' => 'hu', + '烀' => 'hu', + '惚' => 'hu', + '滹' => 'hu', + '囫' => 'hu', + '狐' => 'hu', + '弧' => 'hu', + '胡' => 'hu', + '壶' => 'hu', + '斛' => 'hu', + '葫' => 'hu', + '猢' => 'hu', + '湖' => 'hu', + '瑚' => 'hu', + '鹕' => 'hu', + '槲' => 'hu', + '蝴' => 'hu', + '糊' => 'hu', + '醐' => 'hu', + '觳' => 'hu', + '虎' => 'hu', + '唬' => 'hu', + '琥' => 'hu', + '互' => 'hu', + '户' => 'hu', + '冱' => 'hu', + '护' => 'hu', + '沪' => 'hu', + '枑' => 'hu', + '怙' => 'hu', + '戽' => 'hu', + '笏' => 'hu', + '瓠' => 'hu', + '扈' => 'hu', + '鹱' => 'hu', + '花' => 'hua', + '砉' => 'hua', + '华' => 'hua', + '哗' => 'hua', + '骅' => 'hua', + '铧' => 'hua', + '猾' => 'hua', + '滑' => 'hua', + '化' => 'hua', + '画' => 'hua', + '话' => 'hua', + '桦' => 'hua', + '婳' => 'hua', + '觟' => 'hua', + '怀' => 'huai', + '徊' => 'huai', + '淮' => 'huai', + '槐' => 'huai', + '踝' => 'huai', + '耲' => 'huai', + '坏' => 'huai', + '欢' => 'huan', + '獾' => 'huan', + '环' => 'huan', + '洹' => 'huan', + '桓' => 'huan', + '萑' => 'huan', + '寰' => 'huan', + '缳' => 'huan', + '缓' => 'huan', + '幻' => 'huan', + '奂' => 'huan', + '宦' => 'huan', + '换' => 'huan', + '唤' => 'huan', + '涣' => 'huan', + '浣' => 'huan', + '患' => 'huan', + '焕' => 'huan', + '痪' => 'huan', + '豢' => 'huan', + '漶' => 'huan', + '鲩' => 'huan', + '擐' => 'huan', + '肓' => 'huang', + '荒' => 'huang', + '塃' => 'huang', + '慌' => 'huang', + '皇' => 'huang', + '黄' => 'huang', + '凰' => 'huang', + '隍' => 'huang', + '喤' => 'huang', + '遑' => 'huang', + '徨' => 'huang', + '湟' => 'huang', + '惶' => 'huang', + '媓' => 'huang', + '煌' => 'huang', + '锽' => 'huang', + '潢' => 'huang', + '璜' => 'huang', + '蝗' => 'huang', + '篁' => 'huang', + '艎' => 'huang', + '磺' => 'huang', + '癀' => 'huang', + '蟥' => 'huang', + '簧' => 'huang', + '鳇' => 'huang', + '恍' => 'huang', + '晃' => 'huang', + '谎' => 'huang', + '幌' => 'huang', + '滉' => 'huang', + '皝' => 'huang', + '灰' => 'hui', + '诙' => 'hui', + '挥' => 'hui', + '恢' => 'hui', + '晖' => 'hui', + '辉' => 'hui', + '麾' => 'hui', + '徽' => 'hui', + '隳' => 'hui', + '回' => 'hui', + '茴' => 'hui', + '洄' => 'hui', + '蛔' => 'hui', + '悔' => 'hui', + '毁' => 'hui', + '卉' => 'hui', + '汇' => 'hui', + '讳' => 'hui', + '荟' => 'hui', + '浍' => 'hui', + '诲' => 'hui', + '绘' => 'hui', + '恚' => 'hui', + '贿' => 'hui', + '烩' => 'hui', + '彗' => 'hui', + '晦' => 'hui', + '秽' => 'hui', + '惠' => 'hui', + '喙' => 'hui', + '慧' => 'hui', + '蕙' => 'hui', + '蟪' => 'hui', + '珲' => 'hun', + '昏' => 'hun', + '荤' => 'hun', + '阍' => 'hun', + '惛' => 'hun', + '婚' => 'hun', + '浑' => 'hun', + '馄' => 'hun', + '混' => 'hun', + '魂' => 'hun', + '诨' => 'hun', + '溷' => 'hun', + '耠' => 'huo', + '劐' => 'huo', + '豁' => 'huo', + '活' => 'huo', + '火' => 'huo', + '伙' => 'huo', + '钬' => 'huo', + '夥' => 'huo', + '或' => 'huo', + '货' => 'huo', + '获' => 'huo', + '祸' => 'huo', + '惑' => 'huo', + '霍' => 'huo', + '镬' => 'huo', + '攉' => 'huo', + '藿' => 'huo', + '嚯' => 'huo', + '讥' => 'ji', + '击' => 'ji', + '叽' => 'ji', + '饥' => 'ji', + '玑' => 'ji', + '圾' => 'ji', + '芨' => 'ji', + '机' => 'ji', + '乩' => 'ji', + '肌' => 'ji', + '矶' => 'ji', + '鸡' => 'ji', + '剞' => 'ji', + '唧' => 'ji', + '积' => 'ji', + '笄' => 'ji', + '屐' => 'ji', + '姬' => 'ji', + '基' => 'ji', + '犄' => 'ji', + '嵇' => 'ji', + '畸' => 'ji', + '跻' => 'ji', + '箕' => 'ji', + '齑' => 'ji', + '畿' => 'ji', + '墼' => 'ji', + '激' => 'ji', + '羁' => 'ji', + '及' => 'ji', + '吉' => 'ji', + '岌' => 'ji', + '汲' => 'ji', + '级' => 'ji', + '极' => 'ji', + '即' => 'ji', + '佶' => 'ji', + '笈' => 'ji', + '急' => 'ji', + '疾' => 'ji', + '棘' => 'ji', + '集' => 'ji', + '蒺' => 'ji', + '楫' => 'ji', + '辑' => 'ji', + '嫉' => 'ji', + '瘠' => 'ji', + '藉' => 'ji', + '籍' => 'ji', + '几' => 'ji', + '己' => 'ji', + '虮' => 'ji', + '挤' => 'ji', + '脊' => 'ji', + '掎' => 'ji', + '戟' => 'ji', + '麂' => 'ji', + '计' => 'ji', + '记' => 'ji', + '伎' => 'ji', + '纪' => 'ji', + '技' => 'ji', + '忌' => 'ji', + '际' => 'ji', + '妓' => 'ji', + '季' => 'ji', + '剂' => 'ji', + '迹' => 'ji', + '济' => 'ji', + '既' => 'ji', + '觊' => 'ji', + '继' => 'ji', + '偈' => 'ji', + '祭' => 'ji', + '悸' => 'ji', + '寄' => 'ji', + '寂' => 'ji', + '绩' => 'ji', + '暨' => 'ji', + '稷' => 'ji', + '鲫' => 'ji', + '髻' => 'ji', + '冀' => 'ji', + '骥' => 'ji', + '加' => 'jia', + '佳' => 'jia', + '枷' => 'jia', + '浃' => 'jia', + '痂' => 'jia', + '家' => 'jia', + '袈' => 'jia', + '嘉' => 'jia', + '镓' => 'jia', + '荚' => 'jia', + '戛' => 'jia', + '颊' => 'jia', + '甲' => 'jia', + '胛' => 'jia', + '钾' => 'jia', + '假' => 'jia', + '价' => 'jia', + '驾' => 'jia', + '架' => 'jia', + '嫁' => 'jia', + '稼' => 'jia', + '戋' => 'jian', + '尖' => 'jian', + '奸' => 'jian', + '歼' => 'jian', + '坚' => 'jian', + '间' => 'jian', + '肩' => 'jian', + '艰' => 'jian', + '监' => 'jian', + '兼' => 'jian', + '菅' => 'jian', + '笺' => 'jian', + '缄' => 'jian', + '煎' => 'jian', + '拣' => 'jian', + '茧' => 'jian', + '柬' => 'jian', + '俭' => 'jian', + '捡' => 'jian', + '检' => 'jian', + '减' => 'jian', + '剪' => 'jian', + '睑' => 'jian', + '简' => 'jian', + '碱' => 'jian', + '见' => 'jian', + '件' => 'jian', + '饯' => 'jian', + '建' => 'jian', + '荐' => 'jian', + '贱' => 'jian', + '剑' => 'jian', + '健' => 'jian', + '舰' => 'jian', + '涧' => 'jian', + '渐' => 'jian', + '谏' => 'jian', + '践' => 'jian', + '锏' => 'jian', + '毽' => 'jian', + '腱' => 'jian', + '溅' => 'jian', + '鉴' => 'jian', + '键' => 'jian', + '僭' => 'jian', + '箭' => 'jian', + '江' => 'jiang', + '将' => 'jiang', + '姜' => 'jiang', + '豇' => 'jiang', + '浆' => 'jiang', + '僵' => 'jiang', + '缰' => 'jiang', + '疆' => 'jiang', + '讲' => 'jiang', + '奖' => 'jiang', + '桨' => 'jiang', + '蒋' => 'jiang', + '匠' => 'jiang', + '酱' => 'jiang', + '犟' => 'jiang', + '糨' => 'jiang', + '交' => 'jiao', + '郊' => 'jiao', + '浇' => 'jiao', + '娇' => 'jiao', + '姣' => 'jiao', + '骄' => 'jiao', + '胶' => 'jiao', + '椒' => 'jiao', + '蛟' => 'jiao', + '焦' => 'jiao', + '跤' => 'jiao', + '蕉' => 'jiao', + '礁' => 'jiao', + '佼' => 'jiao', + '狡' => 'jiao', + '饺' => 'jiao', + '绞' => 'jiao', + '铰' => 'jiao', + '矫' => 'jiao', + '皎' => 'jiao', + '脚' => 'jiao', + '搅' => 'jiao', + '剿' => 'jiao', + '缴' => 'jiao', + '叫' => 'jiao', + '轿' => 'jiao', + '较' => 'jiao', + '教' => 'jiao', + '窖' => 'jiao', + '酵' => 'jiao', + '侥' => 'jiao', + '阶' => 'jie', + '皆' => 'jie', + '接' => 'jie', + '秸' => 'jie', + '揭' => 'jie', + '嗟' => 'jie', + '街' => 'jie', + '孑' => 'jie', + '节' => 'jie', + '讦' => 'jie', + '劫' => 'jie', + '杰' => 'jie', + '诘' => 'jie', + '洁' => 'jie', + '结' => 'jie', + '捷' => 'jie', + '睫' => 'jie', + '截' => 'jie', + '碣' => 'jie', + '竭' => 'jie', + '姐' => 'jie', + '解' => 'jie', + '介' => 'jie', + '戒' => 'jie', + '届' => 'jie', + '界' => 'jie', + '疥' => 'jie', + '诫' => 'jie', + '借' => 'jie', + '巾' => 'jin', + '斤' => 'jin', + '今' => 'jin', + '金' => 'jin', + '津' => 'jin', + '矜' => 'jin', + '筋' => 'jin', + '襟' => 'jin', + '仅' => 'jin', + '紧' => 'jin', + '锦' => 'jin', + '谨' => 'jin', + '尽' => 'jin', + '进' => 'jin', + '近' => 'jin', + '晋' => 'jin', + '烬' => 'jin', + '浸' => 'jin', + '禁' => 'jin', + '觐' => 'jin', + '噤' => 'jin', + '茎' => 'jing', + '京' => 'jing', + '泾' => 'jing', + '经' => 'jing', + '菁' => 'jing', + '惊' => 'jing', + '晶' => 'jing', + '睛' => 'jing', + '粳' => 'jing', + '兢' => 'jing', + '精' => 'jing', + '鲸' => 'jing', + '井' => 'jing', + '阱' => 'jing', + '刭' => 'jing', + '景' => 'jing', + '儆' => 'jing', + '警' => 'jing', + '径' => 'jing', + '净' => 'jing', + '痉' => 'jing', + '竞' => 'jing', + '竟' => 'jing', + '敬' => 'jing', + '靖' => 'jing', + '静' => 'jing', + '境' => 'jing', + '镜' => 'jing', + '迥' => 'jiong', + '炯' => 'jiong', + '窘' => 'jiong', + '纠' => 'jiu', + '鸠' => 'jiu', + '究' => 'jiu', + '赳' => 'jiu', + '阄' => 'jiu', + '揪' => 'jiu', + '啾' => 'jiu', + '九' => 'jiu', + '久' => 'jiu', + '玖' => 'jiu', + '灸' => 'jiu', + '韭' => 'jiu', + '酒' => 'jiu', + '旧' => 'jiu', + '臼' => 'jiu', + '咎' => 'jiu', + '柩' => 'jiu', + '救' => 'jiu', + '厩' => 'jiu', + '就' => 'jiu', + '舅' => 'jiu', + '鹫' => 'jiu', + '军' => 'jun', + '均' => 'jun', + '君' => 'jun', + '钧' => 'jun', + '菌' => 'jun', + '皲' => 'jun', + '俊' => 'jun', + '郡' => 'jun', + '峻' => 'jun', + '骏' => 'jun', + '竣' => 'jun', + '拘' => 'ju', + '狙' => 'ju', + '居' => 'ju', + '驹' => 'ju', + '掬' => 'ju', + '雎' => 'ju', + '鞠' => 'ju', + '局' => 'ju', + '菊' => 'ju', + '焗' => 'ju', + '橘' => 'ju', + '咀' => 'ju', + '沮' => 'ju', + '矩' => 'ju', + '举' => 'ju', + '龃' => 'ju', + '巨' => 'ju', + '拒' => 'ju', + '具' => 'ju', + '炬' => 'ju', + '俱' => 'ju', + '剧' => 'ju', + '据' => 'ju', + '距' => 'ju', + '惧' => 'ju', + '飓' => 'ju', + '锯' => 'ju', + '聚' => 'ju', + '踞' => 'ju', + '捐' => 'juan', + '涓' => 'juan', + '娟' => 'juan', + '鹃' => 'juan', + '卷' => 'juan', + '倦' => 'juan', + '绢' => 'juan', + '眷' => 'juan', + '隽' => 'juan', + '撅' => 'jue', + '噘' => 'jue', + '决' => 'jue', + '诀' => 'jue', + '抉' => 'jue', + '绝' => 'jue', + '掘' => 'jue', + '崛' => 'jue', + '厥' => 'jue', + '谲' => 'jue', + '蕨' => 'jue', + '爵' => 'jue', + '蹶' => 'jue', + '矍' => 'jue', + '倔' => 'jue', + '咔' => 'ka', + '开' => 'kai', + '揩' => 'kai', + '凯' => 'kai', + '铠' => 'kai', + '慨' => 'kai', + '楷' => 'kai', + '忾' => 'kai', + '刊' => 'kan', + '勘' => 'kan', + '龛' => 'kan', + '堪' => 'kan', + '坎' => 'kan', + '侃' => 'kan', + '砍' => 'kan', + '槛' => 'kan', + '看' => 'kan', + '瞰' => 'kan', + '康' => 'kang', + '慷' => 'kang', + '糠' => 'kang', + '亢' => 'kang', + '伉' => 'kang', + '抗' => 'kang', + '炕' => 'kang', + '考' => 'kao', + '拷' => 'kao', + '烤' => 'kao', + '铐' => 'kao', + '犒' => 'kao', + '靠' => 'kao', + '苛' => 'ke', + '轲' => 'ke', + '科' => 'ke', + '棵' => 'ke', + '搕' => 'ke', + '嗑' => 'ke', + '稞' => 'ke', + '窠' => 'ke', + '颗' => 'ke', + '磕' => 'ke', + '瞌' => 'ke', + '蝌' => 'ke', + '可' => 'ke', + '坷' => 'ke', + '渴' => 'ke', + '克' => 'ke', + '刻' => 'ke', + '恪' => 'ke', + '客' => 'ke', + '课' => 'ke', + '肯' => 'ken', + '垦' => 'ken', + '恳' => 'ken', + '啃' => 'ken', + '坑' => 'keng', + '铿' => 'keng', + '空' => 'kong', + '孔' => 'kong', + '恐' => 'kong', + '控' => 'kong', + '抠' => 'kou', + '口' => 'kou', + '叩' => 'kou', + '扣' => 'kou', + '寇' => 'kou', + '蔻' => 'kou', + '枯' => 'ku', + '哭' => 'ku', + '窟' => 'ku', + '骷' => 'ku', + '苦' => 'ku', + '库' => 'ku', + '绔' => 'ku', + '裤' => 'ku', + '酷' => 'ku', + '夸' => 'kua', + '垮' => 'kua', + '挎' => 'kua', + '胯' => 'kua', + '跨' => 'kua', + '块' => 'kuai', + '快' => 'kuai', + '侩' => 'kuai', + '脍' => 'kuai', + '筷' => 'kuai', + '宽' => 'kuan', + '髋' => 'kuan', + '款' => 'kuan', + '诓' => 'kuang', + '哐' => 'kuang', + '筐' => 'kuang', + '狂' => 'kuang', + '诳' => 'kuang', + '旷' => 'kuang', + '况' => 'kuang', + '矿' => 'kuang', + '框' => 'kuang', + '眶' => 'kuang', + '亏' => 'kui', + '盔' => 'kui', + '窥' => 'kui', + '葵' => 'kui', + '魁' => 'kui', + '傀' => 'kui', + '匮' => 'kui', + '馈' => 'kui', + '愧' => 'kui', + '坤' => 'kun', + '昆' => 'kun', + '鲲' => 'kun', + '捆' => 'kun', + '困' => 'kun', + '扩' => 'kuo', + '括' => 'kuo', + '阔' => 'kuo', + '廓' => 'kuo', + '垃' => 'la', + '拉' => 'la', + '啦' => 'la', + '邋' => 'la', + '旯' => 'la', + '喇' => 'la', + '腊' => 'la', + '蜡' => 'la', + '辣' => 'la', + '来' => 'lai', + '莱' => 'lai', + '徕' => 'lai', + '睐' => 'lai', + '赖' => 'lai', + '癞' => 'lai', + '籁' => 'lai', + '兰' => 'lan', + '岚' => 'lan', + '拦' => 'lan', + '栏' => 'lan', + '婪' => 'lan', + '阑' => 'lan', + '蓝' => 'lan', + '澜' => 'lan', + '褴' => 'lan', + '篮' => 'lan', + '览' => 'lan', + '揽' => 'lan', + '缆' => 'lan', + '榄' => 'lan', + '懒' => 'lan', + '烂' => 'lan', + '滥' => 'lan', + '啷' => 'lang', + '郎' => 'lang', + '狼' => 'lang', + '琅' => 'lang', + '廊' => 'lang', + '榔' => 'lang', + '锒' => 'lang', + '螂' => 'lang', + '朗' => 'lang', + '浪' => 'lang', + '捞' => 'lao', + '劳' => 'lao', + '牢' => 'lao', + '崂' => 'lao', + '老' => 'lao', + '佬' => 'lao', + '姥' => 'lao', + '唠' => 'lao', + '烙' => 'lao', + '涝' => 'lao', + '酪' => 'lao', + '雷' => 'lei', + '羸' => 'lei', + '垒' => 'lei', + '磊' => 'lei', + '蕾' => 'lei', + '儡' => 'lei', + '肋' => 'lei', + '泪' => 'lei', + '类' => 'lei', + '累' => 'lei', + '擂' => 'lei', + '嘞' => 'lei', + '棱' => 'leng', + '楞' => 'leng', + '冷' => 'leng', + '睖' => 'leng', + '厘' => 'li', + '狸' => 'li', + '离' => 'li', + '梨' => 'li', + '犁' => 'li', + '鹂' => 'li', + '喱' => 'li', + '蜊' => 'li', + '漓' => 'li', + '璃' => 'li', + '黎' => 'li', + '罹' => 'li', + '篱' => 'li', + '蠡' => 'li', + '礼' => 'li', + '李' => 'li', + '里' => 'li', + '俚' => 'li', + '逦' => 'li', + '哩' => 'li', + '娌' => 'li', + '理' => 'li', + '鲤' => 'li', + '力' => 'li', + '历' => 'li', + '厉' => 'li', + '立' => 'li', + '吏' => 'li', + '丽' => 'li', + '励' => 'li', + '呖' => 'li', + '利' => 'li', + '沥' => 'li', + '枥' => 'li', + '例' => 'li', + '戾' => 'li', + '隶' => 'li', + '荔' => 'li', + '俐' => 'li', + '莉' => 'li', + '莅' => 'li', + '栗' => 'li', + '砾' => 'li', + '蛎' => 'li', + '唳' => 'li', + '笠' => 'li', + '粒' => 'li', + '雳' => 'li', + '痢' => 'li', + '连' => 'lian', + '怜' => 'lian', + '帘' => 'lian', + '莲' => 'lian', + '涟' => 'lian', + '联' => 'lian', + '廉' => 'lian', + '鲢' => 'lian', + '镰' => 'lian', + '敛' => 'lian', + '脸' => 'lian', + '练' => 'lian', + '炼' => 'lian', + '恋' => 'lian', + '殓' => 'lian', + '链' => 'lian', + '良' => 'liang', + '凉' => 'liang', + '梁' => 'liang', + '粮' => 'liang', + '粱' => 'liang', + '两' => 'liang', + '魉' => 'liang', + '亮' => 'liang', + '谅' => 'liang', + '辆' => 'liang', + '靓' => 'liang', + '量' => 'liang', + '晾' => 'liang', + '踉' => 'liang', + '辽' => 'liao', + '疗' => 'liao', + '聊' => 'liao', + '僚' => 'liao', + '寥' => 'liao', + '撩' => 'liao', + '嘹' => 'liao', + '獠' => 'liao', + '潦' => 'liao', + '缭' => 'liao', + '燎' => 'liao', + '料' => 'liao', + '撂' => 'liao', + '瞭' => 'liao', + '镣' => 'liao', + '咧' => 'lie', + '列' => 'lie', + '劣' => 'lie', + '冽' => 'lie', + '烈' => 'lie', + '猎' => 'lie', + '裂' => 'lie', + '趔' => 'lie', + '拎' => 'lin', + '邻' => 'lin', + '林' => 'lin', + '临' => 'lin', + '淋' => 'lin', + '琳' => 'lin', + '粼' => 'lin', + '嶙' => 'lin', + '潾' => 'lin', + '霖' => 'lin', + '磷' => 'lin', + '鳞' => 'lin', + '麟' => 'lin', + '凛' => 'lin', + '檩' => 'lin', + '吝' => 'lin', + '赁' => 'lin', + '躏' => 'lin', + '伶' => 'ling', + '灵' => 'ling', + '苓' => 'ling', + '囹' => 'ling', + '泠' => 'ling', + '玲' => 'ling', + '瓴' => 'ling', + '铃' => 'ling', + '凌' => 'ling', + '陵' => 'ling', + '聆' => 'ling', + '菱' => 'ling', + '棂' => 'ling', + '蛉' => 'ling', + '翎' => 'ling', + '羚' => 'ling', + '绫' => 'ling', + '零' => 'ling', + '龄' => 'ling', + '岭' => 'ling', + '领' => 'ling', + '另' => 'ling', + '令' => 'ling', + '溜' => 'liu', + '熘' => 'liu', + '刘' => 'liu', + '浏' => 'liu', + '留' => 'liu', + '流' => 'liu', + '琉' => 'liu', + '硫' => 'liu', + '馏' => 'liu', + '榴' => 'liu', + '瘤' => 'liu', + '柳' => 'liu', + '绺' => 'liu', + '六' => 'liu', + '遛' => 'liu', + '龙' => 'long', + '咙' => 'long', + '珑' => 'long', + '胧' => 'long', + '聋' => 'long', + '笼' => 'long', + '隆' => 'long', + '窿' => 'long', + '陇' => 'long', + '拢' => 'long', + '垄' => 'long', + '娄' => 'lou', + '楼' => 'lou', + '髅' => 'lou', + '搂' => 'lou', + '篓' => 'lou', + '陋' => 'lou', + '镂' => 'lou', + '漏' => 'lou', + '喽' => 'lou', + '撸' => 'lu', + '卢' => 'lu', + '芦' => 'lu', + '庐' => 'lu', + '炉' => 'lu', + '泸' => 'lu', + '鸬' => 'lu', + '颅' => 'lu', + '鲈' => 'lu', + '卤' => 'lu', + '虏' => 'lu', + '掳' => 'lu', + '鲁' => 'lu', + '橹' => 'lu', + '录' => 'lu', + '赂' => 'lu', + '鹿' => 'lu', + '禄' => 'lu', + '路' => 'lu', + '箓' => 'lu', + '漉' => 'lu', + '戮' => 'lu', + '鹭' => 'lu', + '麓' => 'lu', + '峦' => 'luan', + '孪' => 'luan', + '挛' => 'luan', + '鸾' => 'luan', + '卵' => 'luan', + '乱' => 'luan', + '抡' => 'lun', + '仑' => 'lun', + '伦' => 'lun', + '囵' => 'lun', + '沦' => 'lun', + '轮' => 'lun', + '论' => 'lun', + '啰' => 'luo', + '罗' => 'luo', + '萝' => 'luo', + '逻' => 'luo', + '锣' => 'luo', + '箩' => 'luo', + '骡' => 'luo', + '螺' => 'luo', + '裸' => 'luo', + '洛' => 'luo', + '络' => 'luo', + '骆' => 'luo', + '摞' => 'luo', + '漯' => 'luo', + '驴' => 'lv', + '榈' => 'lv', + '吕' => 'lv', + '侣' => 'lv', + '旅' => 'lv', + '铝' => 'lv', + '屡' => 'lv', + '缕' => 'lv', + '膂' => 'lv', + '褛' => 'lv', + '履' => 'lv', + '律' => 'lv', + '虑' => 'lv', + '氯' => 'lv', + '滤' => 'lv', + '掠' => 'lve', + '略' => 'lve', + '妈' => 'ma', + '麻' => 'ma', + '蟆' => 'ma', + '马' => 'ma', + '犸' => 'ma', + '玛' => 'ma', + '码' => 'ma', + '蚂' => 'ma', + '骂' => 'ma', + '吗' => 'ma', + '嘛' => 'ma', + '霾' => 'mai', + '买' => 'mai', + '迈' => 'mai', + '麦' => 'mai', + '卖' => 'mai', + '霡' => 'mai', + '蛮' => 'man', + '馒' => 'man', + '瞒' => 'man', + '满' => 'man', + '曼' => 'man', + '谩' => 'man', + '幔' => 'man', + '漫' => 'man', + '慢' => 'man', + '牤' => 'mang', + '芒' => 'mang', + '忙' => 'mang', + '盲' => 'mang', + '氓' => 'mang', + '茫' => 'mang', + '莽' => 'mang', + '漭' => 'mang', + '蟒' => 'mang', + '猫' => 'mao', + '毛' => 'mao', + '矛' => 'mao', + '茅' => 'mao', + '牦' => 'mao', + '锚' => 'mao', + '髦' => 'mao', + '蝥' => 'mao', + '蟊' => 'mao', + '冇' => 'mao', + '卯' => 'mao', + '铆' => 'mao', + '茂' => 'mao', + '冒' => 'mao', + '贸' => 'mao', + '袤' => 'mao', + '帽' => 'mao', + '貌' => 'mao', + '玫' => 'mei', + '枚' => 'mei', + '眉' => 'mei', + '莓' => 'mei', + '梅' => 'mei', + '媒' => 'mei', + '楣' => 'mei', + '煤' => 'mei', + '酶' => 'mei', + '霉' => 'mei', + '每' => 'mei', + '美' => 'mei', + '镁' => 'mei', + '妹' => 'mei', + '昧' => 'mei', + '袂' => 'mei', + '寐' => 'mei', + '媚' => 'mei', + '魅' => 'mei', + '门' => 'men', + '扪' => 'men', + '闷' => 'men', + '焖' => 'men', + '懑' => 'men', + '们' => 'men', + '虻' => 'meng', + '萌' => 'meng', + '蒙' => 'meng', + '盟' => 'meng', + '檬' => 'meng', + '曚' => 'meng', + '朦' => 'meng', + '猛' => 'meng', + '锰' => 'meng', + '蜢' => 'meng', + '懵' => 'meng', + '孟' => 'meng', + '梦' => 'meng', + '咪' => 'mi', + '眯' => 'mi', + '弥' => 'mi', + '迷' => 'mi', + '猕' => 'mi', + '谜' => 'mi', + '醚' => 'mi', + '糜' => 'mi', + '麋' => 'mi', + '靡' => 'mi', + '米' => 'mi', + '弭' => 'mi', + '觅' => 'mi', + '密' => 'mi', + '幂' => 'mi', + '谧' => 'mi', + '蜜' => 'mi', + '眠' => 'mian', + '绵' => 'mian', + '棉' => 'mian', + '免' => 'mian', + '勉' => 'mian', + '娩' => 'mian', + '冕' => 'mian', + '渑' => 'mian', + '湎' => 'mian', + '缅' => 'mian', + '腼' => 'mian', + '面' => 'mian', + '喵' => 'miao', + '苗' => 'miao', + '描' => 'miao', + '瞄' => 'miao', + '秒' => 'miao', + '渺' => 'miao', + '藐' => 'miao', + '妙' => 'miao', + '庙' => 'miao', + '缥' => 'miao', + '咩' => 'mie', + '灭' => 'mie', + '蔑' => 'mie', + '篾' => 'mie', + '乜' => 'mie', + '民' => 'min', + '皿' => 'min', + '抿' => 'min', + '泯' => 'min', + '闽' => 'min', + '悯' => 'min', + '敏' => 'min', + '名' => 'ming', + '明' => 'ming', + '鸣' => 'ming', + '茗' => 'ming', + '冥' => 'ming', + '铭' => 'ming', + '瞑' => 'ming', + '螟' => 'ming', + '酩' => 'ming', + '命' => 'ming', + '谬' => 'miu', + '摸' => 'mo', + '馍' => 'mo', + '摹' => 'mo', + '膜' => 'mo', + '摩' => 'mo', + '磨' => 'mo', + '蘑' => 'mo', + '魔' => 'mo', + '末' => 'mo', + '茉' => 'mo', + '殁' => 'mo', + '沫' => 'mo', + '陌' => 'mo', + '莫' => 'mo', + '秣' => 'mo', + '蓦' => 'mo', + '漠' => 'mo', + '寞' => 'mo', + '墨' => 'mo', + '默' => 'mo', + '嬷' => 'mo', + '缪' => 'mou', + '哞' => 'mou', + '眸' => 'mou', + '谋' => 'mou', + '某' => 'mou', + '母' => 'mu', + '牡' => 'mu', + '亩' => 'mu', + '拇' => 'mu', + '姆' => 'mu', + '木' => 'mu', + '目' => 'mu', + '沐' => 'mu', + '苜' => 'mu', + '牧' => 'mu', + '钼' => 'mu', + '募' => 'mu', + '墓' => 'mu', + '幕' => 'mu', + '睦' => 'mu', + '慕' => 'mu', + '暮' => 'mu', + '穆' => 'mu', + '拿' => 'na', + '呐' => 'na', + '纳' => 'na', + '钠' => 'na', + '衲' => 'na', + '捺' => 'na', + '乃' => 'nai', + '奶' => 'nai', + '氖' => 'nai', + '奈' => 'nai', + '耐' => 'nai', + '囡' => 'nan', + '男' => 'nan', + '南' => 'nan', + '难' => 'nan', + '喃' => 'nan', + '楠' => 'nan', + '赧' => 'nan', + '腩' => 'nan', + '囔' => 'nang', + '囊' => 'nang', + '孬' => 'nao', + '呶' => 'nao', + '挠' => 'nao', + '恼' => 'nao', + '脑' => 'nao', + '瑙' => 'nao', + '闹' => 'nao', + '淖' => 'nao', + '讷' => 'ne', + '馁' => 'nei', + '内' => 'nei', + '嫩' => 'nen', + '恁' => 'nen', + '能' => 'neng', + '嗯' => 'ng', + '妮' => 'ni', + '尼' => 'ni', + '泥' => 'ni', + '怩' => 'ni', + '倪' => 'ni', + '霓' => 'ni', + '拟' => 'ni', + '你' => 'ni', + '旎' => 'ni', + '昵' => 'ni', + '逆' => 'ni', + '匿' => 'ni', + '腻' => 'ni', + '溺' => 'ni', + '拈' => 'nian', + '蔫' => 'nian', + '年' => 'nian', + '黏' => 'nian', + '捻' => 'nian', + '辇' => 'nian', + '撵' => 'nian', + '碾' => 'nian', + '廿' => 'nian', + '念' => 'nian', + '娘' => 'niang', + '酿' => 'niang', + '鸟' => 'niao', + '袅' => 'niao', + '尿' => 'niao', + '捏' => 'nie', + '聂' => 'nie', + '涅' => 'nie', + '嗫' => 'nie', + '镊' => 'nie', + '镍' => 'nie', + '蹑' => 'nie', + '孽' => 'nie', + '您' => 'nin', + '宁' => 'ning', + '咛' => 'ning', + '狞' => 'ning', + '柠' => 'ning', + '凝' => 'ning', + '拧' => 'ning', + '佞' => 'ning', + '泞' => 'ning', + '妞' => 'niu', + '牛' => 'niu', + '扭' => 'niu', + '忸' => 'niu', + '纽' => 'niu', + '钮' => 'niu', + '农' => 'nong', + '哝' => 'nong', + '浓' => 'nong', + '脓' => 'nong', + '弄' => 'nong', + '奴' => 'nu', + '驽' => 'nu', + '努' => 'nu', + '弩' => 'nu', + '怒' => 'nu', + '暖' => 'nuan', + '疟' => 'nue', + '虐' => 'nue', + '挪' => 'nuo', + '诺' => 'nuo', + '喏' => 'nuo', + '懦' => 'nuo', + '糯' => 'nuo', + '女' => 'nv', + '噢' => 'o', + '讴' => 'ou', + '瓯' => 'ou', + '欧' => 'ou', + '殴' => 'ou', + '鸥' => 'ou', + '呕' => 'ou', + '偶' => 'ou', + '藕' => 'ou', + '怄' => 'ou', + '趴' => 'pa', + '啪' => 'pa', + '葩' => 'pa', + '杷' => 'pa', + '爬' => 'pa', + '琶' => 'pa', + '帕' => 'pa', + '怕' => 'pa', + '拍' => 'pai', + '排' => 'pai', + '徘' => 'pai', + '牌' => 'pai', + '哌' => 'pai', + '派' => 'pai', + '湃' => 'pai', + '潘' => 'pan', + '攀' => 'pan', + '爿' => 'pan', + '盘' => 'pan', + '磐' => 'pan', + '蹒' => 'pan', + '蟠' => 'pan', + '判' => 'pan', + '盼' => 'pan', + '叛' => 'pan', + '畔' => 'pan', + '乓' => 'pang', + '滂' => 'pang', + '庞' => 'pang', + '旁' => 'pang', + '螃' => 'pang', + '耪' => 'pang', + '抛' => 'pao', + '咆' => 'pao', + '庖' => 'pao', + '袍' => 'pao', + '跑' => 'pao', + '泡' => 'pao', + '呸' => 'pei', + '胚' => 'pei', + '陪' => 'pei', + '培' => 'pei', + '赔' => 'pei', + '裴' => 'pei', + '沛' => 'pei', + '佩' => 'pei', + '配' => 'pei', + '喷' => 'pen', + '盆' => 'pen', + '抨' => 'peng', + '怦' => 'peng', + '砰' => 'peng', + '烹' => 'peng', + '嘭' => 'peng', + '朋' => 'peng', + '彭' => 'peng', + '棚' => 'peng', + '蓬' => 'peng', + '硼' => 'peng', + '鹏' => 'peng', + '澎' => 'peng', + '篷' => 'peng', + '膨' => 'peng', + '捧' => 'peng', + '碰' => 'peng', + '丕' => 'pi', + '批' => 'pi', + '纰' => 'pi', + '坯' => 'pi', + '披' => 'pi', + '砒' => 'pi', + '劈' => 'pi', + '噼' => 'pi', + '霹' => 'pi', + '皮' => 'pi', + '枇' => 'pi', + '毗' => 'pi', + '蚍' => 'pi', + '疲' => 'pi', + '啤' => 'pi', + '琵' => 'pi', + '脾' => 'pi', + '貔' => 'pi', + '匹' => 'pi', + '痞' => 'pi', + '癖' => 'pi', + '屁' => 'pi', + '睥' => 'pi', + '媲' => 'pi', + '僻' => 'pi', + '譬' => 'pi', + '偏' => 'pian', + '篇' => 'pian', + '翩' => 'pian', + '骈' => 'pian', + '蹁' => 'pian', + '片' => 'pian', + '骗' => 'pian', + '剽' => 'piao', + '漂' => 'piao', + '飘' => 'piao', + '瓢' => 'piao', + '殍' => 'piao', + '瞟' => 'piao', + '票' => 'piao', + '氕' => 'pie', + '瞥' => 'pie', + '撇' => 'pie', + '拼' => 'pin', + '姘' => 'pin', + '贫' => 'pin', + '频' => 'pin', + '嫔' => 'pin', + '颦' => 'pin', + '品' => 'pin', + '聘' => 'pin', + '乒' => 'ping', + '娉' => 'ping', + '平' => 'ping', + '评' => 'ping', + '坪' => 'ping', + '苹' => 'ping', + '凭' => 'ping', + '瓶' => 'ping', + '萍' => 'ping', + '钋' => 'po', + '坡' => 'po', + '泼' => 'po', + '颇' => 'po', + '婆' => 'po', + '鄱' => 'po', + '叵' => 'po', + '珀' => 'po', + '破' => 'po', + '粕' => 'po', + '魄' => 'po', + '剖' => 'pou', + '抔' => 'pou', + '扑' => 'pu', + '铺' => 'pu', + '噗' => 'pu', + '仆' => 'pu', + '匍' => 'pu', + '菩' => 'pu', + '葡' => 'pu', + '蒲' => 'pu', + '璞' => 'pu', + '圃' => 'pu', + '浦' => 'pu', + '普' => 'pu', + '谱' => 'pu', + '蹼' => 'pu', + '七' => 'qi', + '沏' => 'qi', + '妻' => 'qi', + '柒' => 'qi', + '凄' => 'qi', + '萋' => 'qi', + '戚' => 'qi', + '期' => 'qi', + '欺' => 'qi', + '嘁' => 'qi', + '漆' => 'qi', + '齐' => 'qi', + '芪' => 'qi', + '其' => 'qi', + '歧' => 'qi', + '祈' => 'qi', + '祇' => 'qi', + '脐' => 'qi', + '畦' => 'qi', + '跂' => 'qi', + '崎' => 'qi', + '骑' => 'qi', + '琪' => 'qi', + '棋' => 'qi', + '旗' => 'qi', + '鳍' => 'qi', + '麒' => 'qi', + '乞' => 'qi', + '岂' => 'qi', + '企' => 'qi', + '杞' => 'qi', + '启' => 'qi', + '起' => 'qi', + '绮' => 'qi', + '气' => 'qi', + '讫' => 'qi', + '迄' => 'qi', + '弃' => 'qi', + '汽' => 'qi', + '泣' => 'qi', + '契' => 'qi', + '砌' => 'qi', + '葺' => 'qi', + '器' => 'qi', + '憩' => 'qi', + '俟' => 'qi', + '掐' => 'qia', + '洽' => 'qia', + '恰' => 'qia', + '千' => 'qian', + '仟' => 'qian', + '阡' => 'qian', + '芊' => 'qian', + '迁' => 'qian', + '钎' => 'qian', + '牵' => 'qian', + '悭' => 'qian', + '谦' => 'qian', + '签' => 'qian', + '愆' => 'qian', + '前' => 'qian', + '虔' => 'qian', + '钱' => 'qian', + '钳' => 'qian', + '乾' => 'qian', + '潜' => 'qian', + '黔' => 'qian', + '遣' => 'qian', + '谴' => 'qian', + '欠' => 'qian', + '芡' => 'qian', + '倩' => 'qian', + '堑' => 'qian', + '嵌' => 'qian', + '歉' => 'qian', + '羌' => 'qiang', + '枪' => 'qiang', + '戕' => 'qiang', + '腔' => 'qiang', + '蜣' => 'qiang', + '锵' => 'qiang', + '墙' => 'qiang', + '蔷' => 'qiang', + '抢' => 'qiang', + '羟' => 'qiang', + '襁' => 'qiang', + '呛' => 'qiang', + '炝' => 'qiang', + '跄' => 'qiang', + '悄' => 'qiao', + '跷' => 'qiao', + '锹' => 'qiao', + '敲' => 'qiao', + '橇' => 'qiao', + '乔' => 'qiao', + '侨' => 'qiao', + '荞' => 'qiao', + '桥' => 'qiao', + '憔' => 'qiao', + '瞧' => 'qiao', + '巧' => 'qiao', + '俏' => 'qiao', + '诮' => 'qiao', + '峭' => 'qiao', + '窍' => 'qiao', + '翘' => 'qiao', + '撬' => 'qiao', + '切' => 'qie', + '且' => 'qie', + '妾' => 'qie', + '怯' => 'qie', + '窃' => 'qie', + '挈' => 'qie', + '惬' => 'qie', + '趄' => 'qie', + '锲' => 'qie', + '钦' => 'qin', + '侵' => 'qin', + '衾' => 'qin', + '芹' => 'qin', + '芩' => 'qin', + '秦' => 'qin', + '琴' => 'qin', + '禽' => 'qin', + '勤' => 'qin', + '擒' => 'qin', + '噙' => 'qin', + '寝' => 'qin', + '沁' => 'qin', + '青' => 'qing', + '轻' => 'qing', + '氢' => 'qing', + '倾' => 'qing', + '卿' => 'qing', + '清' => 'qing', + '蜻' => 'qing', + '情' => 'qing', + '晴' => 'qing', + '氰' => 'qing', + '擎' => 'qing', + '顷' => 'qing', + '请' => 'qing', + '庆' => 'qing', + '罄' => 'qing', + '穷' => 'qiong', + '穹' => 'qiong', + '琼' => 'qiong', + '丘' => 'qiu', + '秋' => 'qiu', + '蚯' => 'qiu', + '鳅' => 'qiu', + '囚' => 'qiu', + '求' => 'qiu', + '虬' => 'qiu', + '泅' => 'qiu', + '酋' => 'qiu', + '球' => 'qiu', + '遒' => 'qiu', + '裘' => 'qiu', + '岖' => 'qu', + '驱' => 'qu', + '屈' => 'qu', + '蛆' => 'qu', + '躯' => 'qu', + '趋' => 'qu', + '蛐' => 'qu', + '黢' => 'qu', + '渠' => 'qu', + '瞿' => 'qu', + '曲' => 'qu', + '取' => 'qu', + '娶' => 'qu', + '龋' => 'qu', + '去' => 'qu', + '趣' => 'qu', + '觑' => 'qu', + '悛' => 'quan', + '权' => 'quan', + '全' => 'quan', + '诠' => 'quan', + '泉' => 'quan', + '拳' => 'quan', + '痊' => 'quan', + '蜷' => 'quan', + '醛' => 'quan', + '犬' => 'quan', + '劝' => 'quan', + '券' => 'quan', + '炔' => 'que', + '缺' => 'que', + '瘸' => 'que', + '却' => 'que', + '确' => 'que', + '鹊' => 'que', + '阙' => 'que', + '榷' => 'que', + '逡' => 'qun', + '裙' => 'qun', + '群' => 'qun', + '蚺' => 'ran', + '然' => 'ran', + '燃' => 'ran', + '冉' => 'ran', + '苒' => 'ran', + '染' => 'ran', + '瓤' => 'rang', + '壤' => 'rang', + '攘' => 'rang', + '嚷' => 'rang', + '让' => 'rang', + '荛' => 'rao', + '饶' => 'rao', + '娆' => 'rao', + '桡' => 'rao', + '扰' => 'rao', + '绕' => 'rao', + '惹' => 're', + '热' => 're', + '人' => 'ren', + '壬' => 'ren', + '仁' => 'ren', + '忍' => 'ren', + '荏' => 'ren', + '稔' => 'ren', + '刃' => 'ren', + '认' => 'ren', + '任' => 'ren', + '纫' => 'ren', + '韧' => 'ren', + '饪' => 'ren', + '扔' => 'reng', + '仍' => 'reng', + '日' => 'ri', + '戎' => 'rong', + '茸' => 'rong', + '荣' => 'rong', + '绒' => 'rong', + '容' => 'rong', + '嵘' => 'rong', + '蓉' => 'rong', + '溶' => 'rong', + '榕' => 'rong', + '熔' => 'rong', + '融' => 'rong', + '冗' => 'rong', + '氄' => 'rong', + '柔' => 'rou', + '揉' => 'rou', + '糅' => 'rou', + '蹂' => 'rou', + '鞣' => 'rou', + '肉' => 'rou', + '如' => 'ru', + '茹' => 'ru', + '铷' => 'ru', + '儒' => 'ru', + '孺' => 'ru', + '蠕' => 'ru', + '汝' => 'ru', + '乳' => 'ru', + '辱' => 'ru', + '入' => 'ru', + '缛' => 'ru', + '褥' => 'ru', + '阮' => 'ruan', + '软' => 'ruan', + '蕊' => 'rui', + '蚋' => 'rui', + '锐' => 'rui', + '瑞' => 'rui', + '睿' => 'rui', + '闰' => 'run', + '润' => 'run', + '若' => 'ruo', + '偌' => 'ruo', + '弱' => 'ruo', + '仨' => 'sa', + '洒' => 'sa', + '撒' => 'sa', + '卅' => 'sa', + '飒' => 'sa', + '萨' => 'sa', + '腮' => 'sai', + '赛' => 'sai', + '三' => 'san', + '叁' => 'san', + '伞' => 'san', + '散' => 'san', + '桑' => 'sang', + '搡' => 'sang', + '嗓' => 'sang', + '丧' => 'sang', + '搔' => 'sao', + '骚' => 'sao', + '扫' => 'sao', + '嫂' => 'sao', + '臊' => 'sao', + '涩' => 'se', + '啬' => 'se', + '铯' => 'se', + '瑟' => 'se', + '穑' => 'se', + '森' => 'sen', + '僧' => 'seng', + '杀' => 'sha', + '沙' => 'sha', + '纱' => 'sha', + '砂' => 'sha', + '啥' => 'sha', + '傻' => 'sha', + '厦' => 'sha', + '歃' => 'sha', + '煞' => 'sha', + '霎' => 'sha', + '筛' => 'shai', + '晒' => 'shai', + '山' => 'shan', + '删' => 'shan', + '苫' => 'shan', + '衫' => 'shan', + '姗' => 'shan', + '珊' => 'shan', + '煽' => 'shan', + '潸' => 'shan', + '膻' => 'shan', + '闪' => 'shan', + '陕' => 'shan', + '讪' => 'shan', + '汕' => 'shan', + '扇' => 'shan', + '善' => 'shan', + '骟' => 'shan', + '缮' => 'shan', + '擅' => 'shan', + '膳' => 'shan', + '嬗' => 'shan', + '赡' => 'shan', + '鳝' => 'shan', + '伤' => 'shang', + '殇' => 'shang', + '商' => 'shang', + '觞' => 'shang', + '熵' => 'shang', + '晌' => 'shang', + '赏' => 'shang', + '上' => 'shang', + '尚' => 'shang', + '捎' => 'shao', + '烧' => 'shao', + '梢' => 'shao', + '稍' => 'shao', + '艄' => 'shao', + '勺' => 'shao', + '芍' => 'shao', + '韶' => 'shao', + '少' => 'shao', + '邵' => 'shao', + '绍' => 'shao', + '哨' => 'shao', + '潲' => 'shao', + '奢' => 'she', + '赊' => 'she', + '舌' => 'she', + '佘' => 'she', + '蛇' => 'she', + '舍' => 'she', + '设' => 'she', + '社' => 'she', + '射' => 'she', + '涉' => 'she', + '赦' => 'she', + '摄' => 'she', + '慑' => 'she', + '麝' => 'she', + '申' => 'shen', + '伸' => 'shen', + '身' => 'shen', + '呻' => 'shen', + '绅' => 'shen', + '砷' => 'shen', + '深' => 'shen', + '神' => 'shen', + '沈' => 'shen', + '审' => 'shen', + '哂' => 'shen', + '婶' => 'shen', + '肾' => 'shen', + '甚' => 'shen', + '渗' => 'shen', + '葚' => 'shen', + '蜃' => 'shen', + '慎' => 'shen', + '升' => 'sheng', + '生' => 'sheng', + '声' => 'sheng', + '昇' => 'sheng', + '牲' => 'sheng', + '笙' => 'sheng', + '甥' => 'sheng', + '绳' => 'sheng', + '圣' => 'sheng', + '胜' => 'sheng', + '晟' => 'sheng', + '剩' => 'sheng', + '尸' => 'shi', + '失' => 'shi', + '师' => 'shi', + '诗' => 'shi', + '虱' => 'shi', + '狮' => 'shi', + '施' => 'shi', + '湿' => 'shi', + '十' => 'shi', + '时' => 'shi', + '实' => 'shi', + '食' => 'shi', + '蚀' => 'shi', + '史' => 'shi', + '矢' => 'shi', + '使' => 'shi', + '始' => 'shi', + '驶' => 'shi', + '屎' => 'shi', + '士' => 'shi', + '氏' => 'shi', + '示' => 'shi', + '世' => 'shi', + '仕' => 'shi', + '市' => 'shi', + '式' => 'shi', + '势' => 'shi', + '事' => 'shi', + '侍' => 'shi', + '饰' => 'shi', + '试' => 'shi', + '视' => 'shi', + '拭' => 'shi', + '柿' => 'shi', + '是' => 'shi', + '适' => 'shi', + '恃' => 'shi', + '室' => 'shi', + '逝' => 'shi', + '轼' => 'shi', + '舐' => 'shi', + '弑' => 'shi', + '释' => 'shi', + '谥' => 'shi', + '嗜' => 'shi', + '誓' => 'shi', + '收' => 'shou', + '手' => 'shou', + '守' => 'shou', + '首' => 'shou', + '寿' => 'shou', + '受' => 'shou', + '狩' => 'shou', + '授' => 'shou', + '售' => 'shou', + '兽' => 'shou', + '绶' => 'shou', + '瘦' => 'shou', + '殳' => 'shu', + '书' => 'shu', + '抒' => 'shu', + '枢' => 'shu', + '叔' => 'shu', + '姝' => 'shu', + '殊' => 'shu', + '倏' => 'shu', + '梳' => 'shu', + '淑' => 'shu', + '舒' => 'shu', + '疏' => 'shu', + '输' => 'shu', + '蔬' => 'shu', + '秫' => 'shu', + '孰' => 'shu', + '赎' => 'shu', + '塾' => 'shu', + '暑' => 'shu', + '黍' => 'shu', + '署' => 'shu', + '蜀' => 'shu', + '鼠' => 'shu', + '薯' => 'shu', + '曙' => 'shu', + '戍' => 'shu', + '束' => 'shu', + '述' => 'shu', + '树' => 'shu', + '竖' => 'shu', + '恕' => 'shu', + '庶' => 'shu', + '墅' => 'shu', + '漱' => 'shu', + '刷' => 'shua', + '唰' => 'shua', + '耍' => 'shua', + '衰' => 'shuai', + '摔' => 'shuai', + '甩' => 'shuai', + '帅' => 'shuai', + '蟀' => 'shuai', + '闩' => 'shuan', + '拴' => 'shuan', + '栓' => 'shuan', + '涮' => 'shuan', + '双' => 'shuang', + '霜' => 'shuang', + '孀' => 'shuang', + '爽' => 'shuang', + '谁' => 'shui', + '水' => 'shui', + '税' => 'shui', + '睡' => 'shui', + '吮' => 'shun', + '顺' => 'shun', + '舜' => 'shun', + '瞬' => 'shun', + '烁' => 'shuo', + '铄' => 'shuo', + '朔' => 'shuo', + '硕' => 'shuo', + '司' => 'si', + '丝' => 'si', + '私' => 'si', + '咝' => 'si', + '思' => 'si', + '斯' => 'si', + '厮' => 'si', + '撕' => 'si', + '嘶' => 'si', + '死' => 'si', + '巳' => 'si', + '四' => 'si', + '寺' => 'si', + '祀' => 'si', + '饲' => 'si', + '肆' => 'si', + '嗣' => 'si', + '松' => 'song', + '嵩' => 'song', + '怂' => 'song', + '耸' => 'song', + '悚' => 'song', + '讼' => 'song', + '宋' => 'song', + '送' => 'song', + '诵' => 'song', + '颂' => 'song', + '搜' => 'sou', + '嗖' => 'sou', + '馊' => 'sou', + '艘' => 'sou', + '叟' => 'sou', + '擞' => 'sou', + '嗽' => 'sou', + '苏' => 'su', + '酥' => 'su', + '俗' => 'su', + '夙' => 'su', + '诉' => 'su', + '肃' => 'su', + '素' => 'su', + '速' => 'su', + '粟' => 'su', + '嗉' => 'su', + '塑' => 'su', + '溯' => 'su', + '簌' => 'su', + '酸' => 'suan', + '蒜' => 'suan', + '算' => 'suan', + '虽' => 'sui', + '睢' => 'sui', + '绥' => 'sui', + '隋' => 'sui', + '随' => 'sui', + '髓' => 'sui', + '岁' => 'sui', + '祟' => 'sui', + '遂' => 'sui', + '碎' => 'sui', + '隧' => 'sui', + '穗' => 'sui', + '孙' => 'sun', + '损' => 'sun', + '笋' => 'sun', + '隼' => 'sun', + '唆' => 'suo', + '梭' => 'suo', + '蓑' => 'suo', + '羧' => 'suo', + '缩' => 'suo', + '所' => 'suo', + '索' => 'suo', + '唢' => 'suo', + '琐' => 'suo', + '锁' => 'suo', + '他' => 'ta', + '它' => 'ta', + '她' => 'ta', + '铊' => 'ta', + '塌' => 'ta', + '塔' => 'ta', + '獭' => 'ta', + '挞' => 'ta', + '榻' => 'ta', + '踏' => 'ta', + '蹋' => 'ta', + '胎' => 'tai', + '台' => 'tai', + '邰' => 'tai', + '抬' => 'tai', + '苔' => 'tai', + '跆' => 'tai', + '太' => 'tai', + '汰' => 'tai', + '态' => 'tai', + '钛' => 'tai', + '泰' => 'tai', + '酞' => 'tai', + '贪' => 'tan', + '摊' => 'tan', + '滩' => 'tan', + '瘫' => 'tan', + '坛' => 'tan', + '昙' => 'tan', + '谈' => 'tan', + '痰' => 'tan', + '谭' => 'tan', + '潭' => 'tan', + '檀' => 'tan', + '坦' => 'tan', + '袒' => 'tan', + '毯' => 'tan', + '叹' => 'tan', + '炭' => 'tan', + '探' => 'tan', + '碳' => 'tan', + '汤' => 'tang', + '嘡' => 'tang', + '羰' => 'tang', + '唐' => 'tang', + '堂' => 'tang', + '棠' => 'tang', + '塘' => 'tang', + '搪' => 'tang', + '膛' => 'tang', + '镗' => 'tang', + '糖' => 'tang', + '螳' => 'tang', + '倘' => 'tang', + '淌' => 'tang', + '躺' => 'tang', + '烫' => 'tang', + '趟' => 'tang', + '涛' => 'tao', + '绦' => 'tao', + '掏' => 'tao', + '滔' => 'tao', + '韬' => 'tao', + '饕' => 'tao', + '逃' => 'tao', + '桃' => 'tao', + '陶' => 'tao', + '萄' => 'tao', + '淘' => 'tao', + '讨' => 'tao', + '套' => 'tao', + '特' => 'te', + '疼' => 'teng', + '腾' => 'teng', + '誊' => 'teng', + '滕' => 'teng', + '藤' => 'teng', + '剔' => 'ti', + '梯' => 'ti', + '踢' => 'ti', + '啼' => 'ti', + '题' => 'ti', + '醍' => 'ti', + '蹄' => 'ti', + '体' => 'ti', + '屉' => 'ti', + '剃' => 'ti', + '涕' => 'ti', + '悌' => 'ti', + '惕' => 'ti', + '替' => 'ti', + '天' => 'tian', + '添' => 'tian', + '田' => 'tian', + '恬' => 'tian', + '甜' => 'tian', + '填' => 'tian', + '忝' => 'tian', + '殄' => 'tian', + '舔' => 'tian', + '掭' => 'tian', + '佻' => 'tiao', + '挑' => 'tiao', + '条' => 'tiao', + '迢' => 'tiao', + '笤' => 'tiao', + '髫' => 'tiao', + '窕' => 'tiao', + '眺' => 'tiao', + '粜' => 'tiao', + '跳' => 'tiao', + '帖' => 'tie', + '贴' => 'tie', + '铁' => 'tie', + '餮' => 'tie', + '铤' => 'ting', + '厅' => 'ting', + '听' => 'ting', + '烃' => 'ting', + '廷' => 'ting', + '亭' => 'ting', + '庭' => 'ting', + '停' => 'ting', + '蜓' => 'ting', + '婷' => 'ting', + '霆' => 'ting', + '挺' => 'ting', + '艇' => 'ting', + '通' => 'tong', + '嗵' => 'tong', + '同' => 'tong', + '彤' => 'tong', + '桐' => 'tong', + '铜' => 'tong', + '童' => 'tong', + '潼' => 'tong', + '瞳' => 'tong', + '统' => 'tong', + '捅' => 'tong', + '桶' => 'tong', + '筒' => 'tong', + '恸' => 'tong', + '痛' => 'tong', + '偷' => 'tou', + '头' => 'tou', + '投' => 'tou', + '骰' => 'tou', + '透' => 'tou', + '凸' => 'tu', + '秃' => 'tu', + '突' => 'tu', + '图' => 'tu', + '荼' => 'tu', + '徒' => 'tu', + '途' => 'tu', + '涂' => 'tu', + '屠' => 'tu', + '土' => 'tu', + '吐' => 'tu', + '兔' => 'tu', + '菟' => 'tu', + '湍' => 'tuan', + '团' => 'tuan', + '疃' => 'tuan', + '彖' => 'tuan', + '推' => 'tui', + '颓' => 'tui', + '腿' => 'tui', + '退' => 'tui', + '蜕' => 'tui', + '褪' => 'tui', + '吞' => 'tun', + '屯' => 'tun', + '饨' => 'tun', + '豚' => 'tun', + '臀' => 'tun', + '托' => 'tuo', + '拖' => 'tuo', + '脱' => 'tuo', + '佗' => 'tuo', + '陀' => 'tuo', + '驼' => 'tuo', + '鸵' => 'tuo', + '妥' => 'tuo', + '椭' => 'tuo', + '唾' => 'tuo', + '挖' => 'wa', + '哇' => 'wa', + '洼' => 'wa', + '娲' => 'wa', + '蛙' => 'wa', + '娃' => 'wa', + '瓦' => 'wa', + '佤' => 'wa', + '袜' => 'wa', + '歪' => 'wai', + '外' => 'wai', + '弯' => 'wan', + '剜' => 'wan', + '湾' => 'wan', + '蜿' => 'wan', + '豌' => 'wan', + '丸' => 'wan', + '纨' => 'wan', + '完' => 'wan', + '玩' => 'wan', + '顽' => 'wan', + '烷' => 'wan', + '宛' => 'wan', + '挽' => 'wan', + '晚' => 'wan', + '惋' => 'wan', + '婉' => 'wan', + '绾' => 'wan', + '皖' => 'wan', + '碗' => 'wan', + '万' => 'wan', + '腕' => 'wan', + '汪' => 'wang', + '亡' => 'wang', + '王' => 'wang', + '网' => 'wang', + '枉' => 'wang', + '罔' => 'wang', + '往' => 'wang', + '惘' => 'wang', + '妄' => 'wang', + '忘' => 'wang', + '旺' => 'wang', + '望' => 'wang', + '危' => 'wei', + '威' => 'wei', + '偎' => 'wei', + '微' => 'wei', + '煨' => 'wei', + '薇' => 'wei', + '巍' => 'wei', + '韦' => 'wei', + '为' => 'wei', + '违' => 'wei', + '围' => 'wei', + '闱' => 'wei', + '桅' => 'wei', + '唯' => 'wei', + '帷' => 'wei', + '维' => 'wei', + '伟' => 'wei', + '伪' => 'wei', + '苇' => 'wei', + '纬' => 'wei', + '委' => 'wei', + '诿' => 'wei', + '娓' => 'wei', + '萎' => 'wei', + '猥' => 'wei', + '痿' => 'wei', + '卫' => 'wei', + '未' => 'wei', + '位' => 'wei', + '味' => 'wei', + '畏' => 'wei', + '胃' => 'wei', + '谓' => 'wei', + '喂' => 'wei', + '猬' => 'wei', + '渭' => 'wei', + '蔚' => 'wei', + '慰' => 'wei', + '魏' => 'wei', + '温' => 'wen', + '瘟' => 'wen', + '文' => 'wen', + '纹' => 'wen', + '闻' => 'wen', + '蚊' => 'wen', + '雯' => 'wen', + '刎' => 'wen', + '吻' => 'wen', + '紊' => 'wen', + '稳' => 'wen', + '问' => 'wen', + '汶' => 'wen', + '翁' => 'weng', + '嗡' => 'weng', + '瓮' => 'weng', + '挝' => 'wo', + '莴' => 'wo', + '倭' => 'wo', + '喔' => 'wo', + '窝' => 'wo', + '蜗' => 'wo', + '我' => 'wo', + '肟' => 'wo', + '沃' => 'wo', + '卧' => 'wo', + '握' => 'wo', + '幄' => 'wo', + '斡' => 'wo', + '乌' => 'wu', + '邬' => 'wu', + '污' => 'wu', + '巫' => 'wu', + '呜' => 'wu', + '钨' => 'wu', + '诬' => 'wu', + '屋' => 'wu', + '无' => 'wu', + '毋' => 'wu', + '芜' => 'wu', + '吴' => 'wu', + '梧' => 'wu', + '蜈' => 'wu', + '五' => 'wu', + '午' => 'wu', + '伍' => 'wu', + '仵' => 'wu', + '怃' => 'wu', + '忤' => 'wu', + '妩' => 'wu', + '武' => 'wu', + '侮' => 'wu', + '捂' => 'wu', + '鹉' => 'wu', + '舞' => 'wu', + '兀' => 'wu', + '勿' => 'wu', + '戊' => 'wu', + '务' => 'wu', + '坞' => 'wu', + '物' => 'wu', + '误' => 'wu', + '悟' => 'wu', + '晤' => 'wu', + '骛' => 'wu', + '雾' => 'wu', + '寤' => 'wu', + '鹜' => 'wu', + '夕' => 'xi', + '兮' => 'xi', + '西' => 'xi', + '吸' => 'xi', + '汐' => 'xi', + '希' => 'xi', + '昔' => 'xi', + '析' => 'xi', + '唏' => 'xi', + '牺' => 'xi', + '息' => 'xi', + '奚' => 'xi', + '悉' => 'xi', + '烯' => 'xi', + '惜' => 'xi', + '晰' => 'xi', + '稀' => 'xi', + '翕' => 'xi', + '犀' => 'xi', + '皙' => 'xi', + '锡' => 'xi', + '溪' => 'xi', + '熙' => 'xi', + '蜥' => 'xi', + '熄' => 'xi', + '嘻' => 'xi', + '膝' => 'xi', + '嬉' => 'xi', + '羲' => 'xi', + '蟋' => 'xi', + '曦' => 'xi', + '习' => 'xi', + '席' => 'xi', + '袭' => 'xi', + '媳' => 'xi', + '洗' => 'xi', + '玺' => 'xi', + '徙' => 'xi', + '喜' => 'xi', + '禧' => 'xi', + '戏' => 'xi', + '细' => 'xi', + '隙' => 'xi', + '呷' => 'xia', + '虾' => 'xia', + '瞎' => 'xia', + '匣' => 'xia', + '侠' => 'xia', + '峡' => 'xia', + '狭' => 'xia', + '遐' => 'xia', + '瑕' => 'xia', + '暇' => 'xia', + '辖' => 'xia', + '霞' => 'xia', + '黠' => 'xia', + '下' => 'xia', + '夏' => 'xia', + '罅' => 'xia', + '仙' => 'xian', + '先' => 'xian', + '氙' => 'xian', + '掀' => 'xian', + '酰' => 'xian', + '锨' => 'xian', + '鲜' => 'xian', + '闲' => 'xian', + '贤' => 'xian', + '弦' => 'xian', + '咸' => 'xian', + '涎' => 'xian', + '娴' => 'xian', + '衔' => 'xian', + '舷' => 'xian', + '嫌' => 'xian', + '显' => 'xian', + '险' => 'xian', + '跣' => 'xian', + '藓' => 'xian', + '苋' => 'xian', + '县' => 'xian', + '现' => 'xian', + '限' => 'xian', + '线' => 'xian', + '宪' => 'xian', + '陷' => 'xian', + '馅' => 'xian', + '羡' => 'xian', + '献' => 'xian', + '腺' => 'xian', + '乡' => 'xiang', + '相' => 'xiang', + '香' => 'xiang', + '厢' => 'xiang', + '湘' => 'xiang', + '箱' => 'xiang', + '襄' => 'xiang', + '镶' => 'xiang', + '详' => 'xiang', + '祥' => 'xiang', + '翔' => 'xiang', + '享' => 'xiang', + '响' => 'xiang', + '饷' => 'xiang', + '飨' => 'xiang', + '想' => 'xiang', + '向' => 'xiang', + '项' => 'xiang', + '象' => 'xiang', + '像' => 'xiang', + '橡' => 'xiang', + '肖' => 'xiao', + '枭' => 'xiao', + '哓' => 'xiao', + '骁' => 'xiao', + '逍' => 'xiao', + '消' => 'xiao', + '宵' => 'xiao', + '萧' => 'xiao', + '硝' => 'xiao', + '销' => 'xiao', + '箫' => 'xiao', + '潇' => 'xiao', + '霄' => 'xiao', + '魈' => 'xiao', + '嚣' => 'xiao', + '崤' => 'xiao', + '淆' => 'xiao', + '小' => 'xiao', + '晓' => 'xiao', + '孝' => 'xiao', + '哮' => 'xiao', + '笑' => 'xiao', + '效' => 'xiao', + '啸' => 'xiao', + '挟' => 'xie', + '些' => 'xie', + '楔' => 'xie', + '歇' => 'xie', + '蝎' => 'xie', + '协' => 'xie', + '胁' => 'xie', + '偕' => 'xie', + '斜' => 'xie', + '谐' => 'xie', + '揳' => 'xie', + '携' => 'xie', + '撷' => 'xie', + '鞋' => 'xie', + '写' => 'xie', + '泄' => 'xie', + '泻' => 'xie', + '卸' => 'xie', + '屑' => 'xie', + '械' => 'xie', + '亵' => 'xie', + '谢' => 'xie', + '邂' => 'xie', + '懈' => 'xie', + '蟹' => 'xie', + '心' => 'xin', + '芯' => 'xin', + '辛' => 'xin', + '欣' => 'xin', + '锌' => 'xin', + '新' => 'xin', + '歆' => 'xin', + '薪' => 'xin', + '馨' => 'xin', + '鑫' => 'xin', + '信' => 'xin', + '衅' => 'xin', + '星' => 'xing', + '猩' => 'xing', + '惺' => 'xing', + '腥' => 'xing', + '刑' => 'xing', + '邢' => 'xing', + '形' => 'xing', + '型' => 'xing', + '醒' => 'xing', + '擤' => 'xing', + '兴' => 'xing', + '杏' => 'xing', + '幸' => 'xing', + '性' => 'xing', + '姓' => 'xing', + '悻' => 'xing', + '凶' => 'xiong', + '兄' => 'xiong', + '匈' => 'xiong', + '讻' => 'xiong', + '汹' => 'xiong', + '胸' => 'xiong', + '雄' => 'xiong', + '熊' => 'xiong', + '休' => 'xiu', + '咻' => 'xiu', + '修' => 'xiu', + '羞' => 'xiu', + '朽' => 'xiu', + '秀' => 'xiu', + '袖' => 'xiu', + '绣' => 'xiu', + '锈' => 'xiu', + '嗅' => 'xiu', + '欻' => 'xu', + '戌' => 'xu', + '须' => 'xu', + '胥' => 'xu', + '虚' => 'xu', + '墟' => 'xu', + '需' => 'xu', + '魆' => 'xu', + '徐' => 'xu', + '许' => 'xu', + '诩' => 'xu', + '栩' => 'xu', + '旭' => 'xu', + '序' => 'xu', + '叙' => 'xu', + '恤' => 'xu', + '酗' => 'xu', + '勖' => 'xu', + '绪' => 'xu', + '续' => 'xu', + '絮' => 'xu', + '婿' => 'xu', + '蓄' => 'xu', + '煦' => 'xu', + '轩' => 'xuan', + '宣' => 'xuan', + '揎' => 'xuan', + '喧' => 'xuan', + '暄' => 'xuan', + '玄' => 'xuan', + '悬' => 'xuan', + '旋' => 'xuan', + '漩' => 'xuan', + '璇' => 'xuan', + '选' => 'xuan', + '癣' => 'xuan', + '炫' => 'xuan', + '绚' => 'xuan', + '眩' => 'xuan', + '渲' => 'xuan', + '靴' => 'xue', + '薛' => 'xue', + '穴' => 'xue', + '学' => 'xue', + '噱' => 'xue', + '雪' => 'xue', + '谑' => 'xue', + '勋' => 'xun', + '熏' => 'xun', + '薰' => 'xun', + '醺' => 'xun', + '旬' => 'xun', + '寻' => 'xun', + '巡' => 'xun', + '询' => 'xun', + '荀' => 'xun', + '循' => 'xun', + '训' => 'xun', + '讯' => 'xun', + '汛' => 'xun', + '迅' => 'xun', + '驯' => 'xun', + '徇' => 'xun', + '逊' => 'xun', + '殉' => 'xun', + '巽' => 'xun', + '丫' => 'ya', + '压' => 'ya', + '押' => 'ya', + '鸦' => 'ya', + '桠' => 'ya', + '鸭' => 'ya', + '牙' => 'ya', + '伢' => 'ya', + '芽' => 'ya', + '蚜' => 'ya', + '崖' => 'ya', + '涯' => 'ya', + '睚' => 'ya', + '衙' => 'ya', + '哑' => 'ya', + '雅' => 'ya', + '亚' => 'ya', + '讶' => 'ya', + '娅' => 'ya', + '氩' => 'ya', + '揠' => 'ya', + '呀' => 'ya', + '恹' => 'yan', + '胭' => 'yan', + '烟' => 'yan', + '焉' => 'yan', + '阉' => 'yan', + '淹' => 'yan', + '湮' => 'yan', + '嫣' => 'yan', + '延' => 'yan', + '闫' => 'yan', + '严' => 'yan', + '言' => 'yan', + '妍' => 'yan', + '岩' => 'yan', + '炎' => 'yan', + '沿' => 'yan', + '研' => 'yan', + '盐' => 'yan', + '阎' => 'yan', + '蜒' => 'yan', + '筵' => 'yan', + '颜' => 'yan', + '檐' => 'yan', + '奄' => 'yan', + '俨' => 'yan', + '衍' => 'yan', + '掩' => 'yan', + '郾' => 'yan', + '眼' => 'yan', + '偃' => 'yan', + '演' => 'yan', + '魇' => 'yan', + '鼹' => 'yan', + '厌' => 'yan', + '砚' => 'yan', + '彦' => 'yan', + '艳' => 'yan', + '晏' => 'yan', + '唁' => 'yan', + '宴' => 'yan', + '验' => 'yan', + '谚' => 'yan', + '堰' => 'yan', + '雁' => 'yan', + '焰' => 'yan', + '滟' => 'yan', + '餍' => 'yan', + '燕' => 'yan', + '赝' => 'yan', + '央' => 'yang', + '泱' => 'yang', + '殃' => 'yang', + '鸯' => 'yang', + '秧' => 'yang', + '扬' => 'yang', + '羊' => 'yang', + '阳' => 'yang', + '杨' => 'yang', + '佯' => 'yang', + '疡' => 'yang', + '徉' => 'yang', + '洋' => 'yang', + '仰' => 'yang', + '养' => 'yang', + '氧' => 'yang', + '痒' => 'yang', + '怏' => 'yang', + '样' => 'yang', + '恙' => 'yang', + '烊' => 'yang', + '漾' => 'yang', + '幺' => 'yao', + '夭' => 'yao', + '吆' => 'yao', + '妖' => 'yao', + '腰' => 'yao', + '邀' => 'yao', + '爻' => 'yao', + '尧' => 'yao', + '肴' => 'yao', + '姚' => 'yao', + '窑' => 'yao', + '谣' => 'yao', + '摇' => 'yao', + '徭' => 'yao', + '遥' => 'yao', + '瑶' => 'yao', + '杳' => 'yao', + '咬' => 'yao', + '舀' => 'yao', + '窈' => 'yao', + '药' => 'yao', + '要' => 'yao', + '鹞' => 'yao', + '耀' => 'yao', + '耶' => 'ye', + '掖' => 'ye', + '椰' => 'ye', + '噎' => 'ye', + '爷' => 'ye', + '揶' => 'ye', + '也' => 'ye', + '冶' => 'ye', + '野' => 'ye', + '业' => 'ye', + '叶' => 'ye', + '页' => 'ye', + '曳' => 'ye', + '夜' => 'ye', + '液' => 'ye', + '谒' => 'ye', + '腋' => 'ye', + '一' => 'yi', + '伊' => 'yi', + '衣' => 'yi', + '医' => 'yi', + '依' => 'yi', + '咿' => 'yi', + '揖' => 'yi', + '壹' => 'yi', + '漪' => 'yi', + '噫' => 'yi', + '仪' => 'yi', + '夷' => 'yi', + '饴' => 'yi', + '宜' => 'yi', + '咦' => 'yi', + '贻' => 'yi', + '姨' => 'yi', + '胰' => 'yi', + '移' => 'yi', + '痍' => 'yi', + '颐' => 'yi', + '疑' => 'yi', + '彝' => 'yi', + '乙' => 'yi', + '已' => 'yi', + '以' => 'yi', + '苡' => 'yi', + '矣' => 'yi', + '迤' => 'yi', + '蚁' => 'yi', + '倚' => 'yi', + '椅' => 'yi', + '旖' => 'yi', + '乂' => 'yi', + '亿' => 'yi', + '义' => 'yi', + '艺' => 'yi', + '刈' => 'yi', + '忆' => 'yi', + '议' => 'yi', + '屹' => 'yi', + '亦' => 'yi', + '异' => 'yi', + '抑' => 'yi', + '呓' => 'yi', + '邑' => 'yi', + '役' => 'yi', + '译' => 'yi', + '易' => 'yi', + '诣' => 'yi', + '绎' => 'yi', + '驿' => 'yi', + '轶' => 'yi', + '弈' => 'yi', + '奕' => 'yi', + '疫' => 'yi', + '羿' => 'yi', + '益' => 'yi', + '谊' => 'yi', + '逸' => 'yi', + '翌' => 'yi', + '肄' => 'yi', + '裔' => 'yi', + '意' => 'yi', + '溢' => 'yi', + '缢' => 'yi', + '毅' => 'yi', + '薏' => 'yi', + '翳' => 'yi', + '臆' => 'yi', + '翼' => 'yi', + '因' => 'yin', + '阴' => 'yin', + '茵' => 'yin', + '荫' => 'yin', + '音' => 'yin', + '姻' => 'yin', + '铟' => 'yin', + '喑' => 'yin', + '愔' => 'yin', + '吟' => 'yin', + '垠' => 'yin', + '银' => 'yin', + '淫' => 'yin', + '寅' => 'yin', + '龈' => 'yin', + '霪' => 'yin', + '尹' => 'yin', + '引' => 'yin', + '蚓' => 'yin', + '隐' => 'yin', + '瘾' => 'yin', + '印' => 'yin', + '英' => 'ying', + '莺' => 'ying', + '婴' => 'ying', + '嘤' => 'ying', + '罂' => 'ying', + '缨' => 'ying', + '樱' => 'ying', + '鹦' => 'ying', + '膺' => 'ying', + '鹰' => 'ying', + '迎' => 'ying', + '茔' => 'ying', + '荧' => 'ying', + '盈' => 'ying', + '莹' => 'ying', + '萤' => 'ying', + '营' => 'ying', + '萦' => 'ying', + '楹' => 'ying', + '蝇' => 'ying', + '赢' => 'ying', + '瀛' => 'ying', + '颍' => 'ying', + '颖' => 'ying', + '影' => 'ying', + '应' => 'ying', + '映' => 'ying', + '硬' => 'ying', + '哟' => 'yo', + '唷' => 'yo', + '佣' => 'yong', + '拥' => 'yong', + '庸' => 'yong', + '雍' => 'yong', + '壅' => 'yong', + '臃' => 'yong', + '永' => 'yong', + '甬' => 'yong', + '咏' => 'yong', + '泳' => 'yong', + '勇' => 'yong', + '涌' => 'yong', + '恿' => 'yong', + '蛹' => 'yong', + '踊' => 'yong', + '用' => 'yong', + '优' => 'you', + '攸' => 'you', + '忧' => 'you', + '呦' => 'you', + '幽' => 'you', + '悠' => 'you', + '尤' => 'you', + '由' => 'you', + '邮' => 'you', + '犹' => 'you', + '油' => 'you', + '铀' => 'you', + '鱿' => 'you', + '游' => 'you', + '友' => 'you', + '有' => 'you', + '酉' => 'you', + '莠' => 'you', + '黝' => 'you', + '又' => 'you', + '右' => 'you', + '幼' => 'you', + '佑' => 'you', + '柚' => 'you', + '囿' => 'you', + '诱' => 'you', + '鼬' => 'you', + '迂' => 'yu', + '纡' => 'yu', + '於' => 'yu', + '淤' => 'yu', + '瘀' => 'yu', + '于' => 'yu', + '余' => 'yu', + '盂' => 'yu', + '臾' => 'yu', + '鱼' => 'yu', + '竽' => 'yu', + '俞' => 'yu', + '狳' => 'yu', + '谀' => 'yu', + '娱' => 'yu', + '渔' => 'yu', + '隅' => 'yu', + '揄' => 'yu', + '逾' => 'yu', + '腴' => 'yu', + '渝' => 'yu', + '愉' => 'yu', + '瑜' => 'yu', + '榆' => 'yu', + '虞' => 'yu', + '愚' => 'yu', + '舆' => 'yu', + '与' => 'yu', + '予' => 'yu', + '屿' => 'yu', + '宇' => 'yu', + '羽' => 'yu', + '雨' => 'yu', + '禹' => 'yu', + '语' => 'yu', + '圄' => 'yu', + '玉' => 'yu', + '驭' => 'yu', + '芋' => 'yu', + '妪' => 'yu', + '郁' => 'yu', + '育' => 'yu', + '狱' => 'yu', + '浴' => 'yu', + '预' => 'yu', + '域' => 'yu', + '欲' => 'yu', + '谕' => 'yu', + '遇' => 'yu', + '喻' => 'yu', + '御' => 'yu', + '寓' => 'yu', + '裕' => 'yu', + '愈' => 'yu', + '誉' => 'yu', + '豫' => 'yu', + '鹬' => 'yu', + '鸢' => 'yuan', + '鸳' => 'yuan', + '冤' => 'yuan', + '渊' => 'yuan', + '元' => 'yuan', + '园' => 'yuan', + '垣' => 'yuan', + '袁' => 'yuan', + '原' => 'yuan', + '圆' => 'yuan', + '援' => 'yuan', + '媛' => 'yuan', + '缘' => 'yuan', + '猿' => 'yuan', + '源' => 'yuan', + '辕' => 'yuan', + '远' => 'yuan', + '苑' => 'yuan', + '怨' => 'yuan', + '院' => 'yuan', + '愿' => 'yuan', + '曰' => 'yue', + '月' => 'yue', + '岳' => 'yue', + '钺' => 'yue', + '阅' => 'yue', + '悦' => 'yue', + '跃' => 'yue', + '越' => 'yue', + '粤' => 'yue', + '晕' => 'yun', + '云' => 'yun', + '匀' => 'yun', + '芸' => 'yun', + '纭' => 'yun', + '耘' => 'yun', + '允' => 'yun', + '陨' => 'yun', + '殒' => 'yun', + '孕' => 'yun', + '运' => 'yun', + '酝' => 'yun', + '愠' => 'yun', + '韵' => 'yun', + '蕴' => 'yun', + '熨' => 'yun', + '匝' => 'za', + '咂' => 'za', + '杂' => 'za', + '砸' => 'za', + '灾' => 'zai', + '甾' => 'zai', + '哉' => 'zai', + '栽' => 'zai', + '载' => 'zai', + '宰' => 'zai', + '崽' => 'zai', + '再' => 'zai', + '在' => 'zai', + '糌' => 'zan', + '簪' => 'zan', + '咱' => 'zan', + '趱' => 'zan', + '暂' => 'zan', + '錾' => 'zan', + '赞' => 'zan', + '赃' => 'zang', + '脏' => 'zang', + '臧' => 'zang', + '驵' => 'zang', + '葬' => 'zang', + '遭' => 'zao', + '糟' => 'zao', + '凿' => 'zao', + '早' => 'zao', + '枣' => 'zao', + '蚤' => 'zao', + '澡' => 'zao', + '藻' => 'zao', + '皂' => 'zao', + '灶' => 'zao', + '造' => 'zao', + '噪' => 'zao', + '燥' => 'zao', + '躁' => 'zao', + '则' => 'ze', + '责' => 'ze', + '泽' => 'ze', + '啧' => 'ze', + '帻' => 'ze', + '仄' => 'ze', + '贼' => 'zei', + '怎' => 'zen', + '谮' => 'zen', + '增' => 'zeng', + '憎' => 'zeng', + '锃' => 'zeng', + '赠' => 'zeng', + '甑' => 'zeng', + '吒' => 'zha', + '挓' => 'zha', + '哳' => 'zha', + '揸' => 'zha', + '渣' => 'zha', + '楂' => 'zha', + '札' => 'zha', + '闸' => 'zha', + '铡' => 'zha', + '眨' => 'zha', + '砟' => 'zha', + '乍' => 'zha', + '诈' => 'zha', + '咤' => 'zha', + '炸' => 'zha', + '蚱' => 'zha', + '榨' => 'zha', + '拃' => 'zha', + '斋' => 'zhai', + '摘' => 'zhai', + '宅' => 'zhai', + '窄' => 'zhai', + '债' => 'zhai', + '砦' => 'zhai', + '寨' => 'zhai', + '沾' => 'zhan', + '毡' => 'zhan', + '粘' => 'zhan', + '詹' => 'zhan', + '谵' => 'zhan', + '瞻' => 'zhan', + '斩' => 'zhan', + '盏' => 'zhan', + '展' => 'zhan', + '崭' => 'zhan', + '搌' => 'zhan', + '辗' => 'zhan', + '占' => 'zhan', + '栈' => 'zhan', + '战' => 'zhan', + '站' => 'zhan', + '绽' => 'zhan', + '湛' => 'zhan', + '蘸' => 'zhan', + '张' => 'zhang', + '章' => 'zhang', + '獐' => 'zhang', + '彰' => 'zhang', + '樟' => 'zhang', + '蟑' => 'zhang', + '涨' => 'zhang', + '掌' => 'zhang', + '丈' => 'zhang', + '仗' => 'zhang', + '杖' => 'zhang', + '帐' => 'zhang', + '账' => 'zhang', + '胀' => 'zhang', + '障' => 'zhang', + '嶂' => 'zhang', + '瘴' => 'zhang', + '钊' => 'zhao', + '招' => 'zhao', + '昭' => 'zhao', + '找' => 'zhao', + '沼' => 'zhao', + '兆' => 'zhao', + '诏' => 'zhao', + '赵' => 'zhao', + '照' => 'zhao', + '罩' => 'zhao', + '肇' => 'zhao', + '蜇' => 'zhe', + '遮' => 'zhe', + '哲' => 'zhe', + '辄' => 'zhe', + '蛰' => 'zhe', + '谪' => 'zhe', + '辙' => 'zhe', + '者' => 'zhe', + '锗' => 'zhe', + '赭' => 'zhe', + '褶' => 'zhe', + '浙' => 'zhe', + '蔗' => 'zhe', + '鹧' => 'zhe', + '贞' => 'zhen', + '针' => 'zhen', + '侦' => 'zhen', + '珍' => 'zhen', + '帧' => 'zhen', + '胗' => 'zhen', + '真' => 'zhen', + '砧' => 'zhen', + '斟' => 'zhen', + '甄' => 'zhen', + '榛' => 'zhen', + '箴' => 'zhen', + '臻' => 'zhen', + '诊' => 'zhen', + '枕' => 'zhen', + '疹' => 'zhen', + '缜' => 'zhen', + '阵' => 'zhen', + '鸩' => 'zhen', + '振' => 'zhen', + '朕' => 'zhen', + '赈' => 'zhen', + '震' => 'zhen', + '镇' => 'zhen', + '争' => 'zheng', + '征' => 'zheng', + '怔' => 'zheng', + '峥' => 'zheng', + '狰' => 'zheng', + '睁' => 'zheng', + '铮' => 'zheng', + '筝' => 'zheng', + '蒸' => 'zheng', + '拯' => 'zheng', + '整' => 'zheng', + '正' => 'zheng', + '证' => 'zheng', + '郑' => 'zheng', + '诤' => 'zheng', + '政' => 'zheng', + '挣' => 'zheng', + '症' => 'zheng', + '之' => 'zhi', + '支' => 'zhi', + '只' => 'zhi', + '汁' => 'zhi', + '芝' => 'zhi', + '吱' => 'zhi', + '枝' => 'zhi', + '知' => 'zhi', + '肢' => 'zhi', + '织' => 'zhi', + '栀' => 'zhi', + '脂' => 'zhi', + '蜘' => 'zhi', + '执' => 'zhi', + '直' => 'zhi', + '侄' => 'zhi', + '值' => 'zhi', + '职' => 'zhi', + '植' => 'zhi', + '跖' => 'zhi', + '踯' => 'zhi', + '止' => 'zhi', + '旨' => 'zhi', + '址' => 'zhi', + '芷' => 'zhi', + '纸' => 'zhi', + '祉' => 'zhi', + '指' => 'zhi', + '枳' => 'zhi', + '咫' => 'zhi', + '趾' => 'zhi', + '酯' => 'zhi', + '至' => 'zhi', + '志' => 'zhi', + '豸' => 'zhi', + '帜' => 'zhi', + '制' => 'zhi', + '质' => 'zhi', + '炙' => 'zhi', + '治' => 'zhi', + '栉' => 'zhi', + '峙' => 'zhi', + '挚' => 'zhi', + '桎' => 'zhi', + '致' => 'zhi', + '秩' => 'zhi', + '掷' => 'zhi', + '痔' => 'zhi', + '窒' => 'zhi', + '蛭' => 'zhi', + '智' => 'zhi', + '痣' => 'zhi', + '滞' => 'zhi', + '置' => 'zhi', + '雉' => 'zhi', + '稚' => 'zhi', + '中' => 'zhong', + '忠' => 'zhong', + '终' => 'zhong', + '盅' => 'zhong', + '钟' => 'zhong', + '衷' => 'zhong', + '肿' => 'zhong', + '冢' => 'zhong', + '踵' => 'zhong', + '仲' => 'zhong', + '众' => 'zhong', + '舟' => 'zhou', + '州' => 'zhou', + '诌' => 'zhou', + '周' => 'zhou', + '洲' => 'zhou', + '粥' => 'zhou', + '妯' => 'zhou', + '轴' => 'zhou', + '肘' => 'zhou', + '纣' => 'zhou', + '咒' => 'zhou', + '宙' => 'zhou', + '胄' => 'zhou', + '昼' => 'zhou', + '皱' => 'zhou', + '骤' => 'zhou', + '帚' => 'zhou', + '朱' => 'zhu', + '侏' => 'zhu', + '诛' => 'zhu', + '茱' => 'zhu', + '珠' => 'zhu', + '株' => 'zhu', + '诸' => 'zhu', + '铢' => 'zhu', + '猪' => 'zhu', + '蛛' => 'zhu', + '竹' => 'zhu', + '竺' => 'zhu', + '逐' => 'zhu', + '烛' => 'zhu', + '躅' => 'zhu', + '主' => 'zhu', + '拄' => 'zhu', + '煮' => 'zhu', + '嘱' => 'zhu', + '瞩' => 'zhu', + '伫' => 'zhu', + '苎' => 'zhu', + '助' => 'zhu', + '住' => 'zhu', + '贮' => 'zhu', + '注' => 'zhu', + '驻' => 'zhu', + '柱' => 'zhu', + '祝' => 'zhu', + '著' => 'zhu', + '蛀' => 'zhu', + '铸' => 'zhu', + '筑' => 'zhu', + '抓' => 'zhua', + '跩' => 'zhuai', + '拽' => 'zhuai', + '专' => 'zhuan', + '砖' => 'zhuan', + '转' => 'zhuan', + '啭' => 'zhuan', + '撰' => 'zhuan', + '篆' => 'zhuan', + '妆' => 'zhuang', + '庄' => 'zhuang', + '桩' => 'zhuang', + '装' => 'zhuang', + '壮' => 'zhuang', + '状' => 'zhuang', + '撞' => 'zhuang', + '幢' => 'zhuang', + '追' => 'zhui', + '骓' => 'zhui', + '锥' => 'zhui', + '坠' => 'zhui', + '缀' => 'zhui', + '惴' => 'zhui', + '赘' => 'zhui', + '谆' => 'zhun', + '准' => 'zhun', + '拙' => 'zhuo', + '捉' => 'zhuo', + '桌' => 'zhuo', + '灼' => 'zhuo', + '茁' => 'zhuo', + '卓' => 'zhuo', + '斫' => 'zhuo', + '浊' => 'zhuo', + '酌' => 'zhuo', + '啄' => 'zhuo', + '擢' => 'zhuo', + '镯' => 'zhuo', + '孜' => 'zi', + '咨' => 'zi', + '姿' => 'zi', + '赀' => 'zi', + '资' => 'zi', + '辎' => 'zi', + '嗞' => 'zi', + '滋' => 'zi', + '锱' => 'zi', + '龇' => 'zi', + '子' => 'zi', + '姊' => 'zi', + '秭' => 'zi', + '籽' => 'zi', + '梓' => 'zi', + '紫' => 'zi', + '訾' => 'zi', + '滓' => 'zi', + '自' => 'zi', + '字' => 'zi', + '恣' => 'zi', + '眦' => 'zi', + '渍' => 'zi', + '宗' => 'zong', + '综' => 'zong', + '棕' => 'zong', + '踪' => 'zong', + '鬃' => 'zong', + '总' => 'zong', + '纵' => 'zong', + '粽' => 'zong', + '邹' => 'zou', + '走' => 'zou', + '奏' => 'zou', + '揍' => 'zou', + '租' => 'zu', + '足' => 'zu', + '卒' => 'zu', + '族' => 'zu', + '诅' => 'zu', + '阻' => 'zu', + '组' => 'zu', + '俎' => 'zu', + '祖' => 'zu', + '纂' => 'zuan', + '钻' => 'zuan', + '攥' => 'zuan', + '嘴' => 'zui', + '最' => 'zui', + '罪' => 'zui', + '醉' => 'zui', + '尊' => 'zun', + '遵' => 'zun', + '樽' => 'zun', + '鳟' => 'zun', + '昨' => 'zuo', + '左' => 'zuo', + '佐' => 'zuo', + '作' => 'zuo', + '坐' => 'zuo', + '阼' => 'zuo', + '怍' => 'zuo', + '祚' => 'zuo', + '唑' => 'zuo', + '座' => 'zuo', + '做' => 'zuo', + '酢' => 'zuo', + '斌' => 'bin', + '曾' => 'zeng', + '查' => 'zha', + '査' => 'zha', + '乘' => 'cheng', + '传' => 'chuan', + '丁' => 'ding', + '行' => 'xing', + '瑾' => 'jin', + '婧' => 'jing', + '恺' => 'kai', + '阚' => 'kan', + '奎' => 'kui', + '乐' => 'le', + '陆' => 'lu', + '逯' => 'lv', + '璐' => 'lu', + '淼' => 'miao', + '闵' => 'min', + '娜' => 'na', + '奇' => 'qi', + '琦' => 'qi', + '强' => 'qiang', + '邱' => 'qiu', + '芮' => 'rui', + '莎' => 'sha', + '盛' => 'sheng', + '石' => 'shi', + '祎' => 'yi', + '殷' => 'yin', + '瑛' => 'ying', + '昱' => 'yu', + '眃' => 'yun', + '琢' => 'zhuo', + '枰' => 'ping', + '玟' => 'min', + '珉' => 'min', + '珣' => 'xun', + '淇' => 'qi', + '缈' => 'miao', + '彧' => 'yu', + '祺' => 'qi', + '骞' => 'qian', + '垚' => 'yao', + '妸' => 'e', + '烜' => 'hui', + '祁' => 'qi', + '傢' => 'jia', + '珮' => 'pei', + '濮' => 'pu', + '屺' => 'qi', + '珅' => 'shen', + '缇' => 'ti', + '霈' => 'pei', + '晞' => 'xi', + '璠' => 'fan', + '骐' => 'qi', + '姞' => 'ji', + '偲' => 'cai', + '齼' => 'chu', + '宓' => 'mi', + '朴' => 'pu', + '萁' => 'qi', + '颀' => 'qi', + '阗' => 'tian', + '湉' => 'tian', + '翀' => 'chong', + '岷' => 'min', + '桤' => 'qi', + '囯' => 'guo', + '浛' => 'han', + '勐' => 'meng', + '苠' => 'min', + '岍' => 'qian', + '皞' => 'hao', + '岐' => 'qi', + '溥' => 'pu', + '锘' => 'muo', + '渼' => 'mei', + '燊' => 'shen', + '玚' => 'chang', + '亓' => 'qi', + '湋' => 'wei', + '涴' => 'wan', + '沤' => 'ou', + '胖' => 'pang', + '莆' => 'pu', + '扦' => 'qian', + '僳' => 'su', + '坍' => 'tan', + '锑' => 'ti', + '嚏' => 'ti', + '腆' => 'tian', + '丿' => 'pie', + '鼗' => 'tao', + '芈' => 'mi', + '匚' => 'fang', + '刂' => 'li', + '冂' => 'tong', + '亻' => 'dan', + '仳' => 'pi', + '俜' => 'ping', + '俳' => 'pai', + '倜' => 'ti', + '傥' => 'tang', + '傩' => 'nuo', + '佥' => 'qian', + '勹' => 'bao', + '亠' => 'tou', + '廾' => 'gong', + '匏' => 'pao', + '扌' => 'ti', + '拚' => 'pin', + '掊' => 'pou', + '搦' => 'nuo', + '擗' => 'pi', + '啕' => 'tao', + '嗦' => 'suo', + '嗍' => 'suo', + '辔' => 'pei', + '嘌' => 'piao', + '嗾' => 'sou', + '嘧' => 'mi', + '帔' => 'pei', + '帑' => 'tang', + '彡' => 'san', + '犭' => 'fan', + '狍' => 'pao', + '狲' => 'sun', + '狻' => 'jun', + '飧' => 'sun', + '夂' => 'zhi', + '饣' => 'shi', + '庀' => 'pi', + '忄' => 'shu', + '愫' => 'su', + '闼' => 'ta', + '丬' => 'jiang', + '氵' => 'san', + '汔' => 'qi', + '沔' => 'mian', + '汨' => 'mi', + '泮' => 'pan', + '洮' => 'tao', + '涑' => 'su', + '淠' => 'pi', + '湓' => 'pen', + '溻' => 'ta', + '溏' => 'tang', + '濉' => 'sui', + '宀' => 'bao', + '搴' => 'qian', + '辶' => 'zou', + '逄' => 'pang', + '逖' => 'ti', + '遢' => 'ta', + '邈' => 'miao', + '邃' => 'sui', + '彐' => 'ji', + '屮' => 'cao', + '娑' => 'suo', + '嫖' => 'piao', + '纟' => 'jiao', + '缗' => 'min', + '瑭' => 'tang', + '杪' => 'miao', + '桫' => 'suo', + '榀' => 'pin', + '榫' => 'sun', + '槭' => 'qi', + '甓' => 'pi', + '攴' => 'po', + '耆' => 'qi', + '牝' => 'pin', + '犏' => 'pian', + '氆' => 'pu', + '攵' => 'fan', + '肽' => 'tai', + '胼' => 'pian', + '脒' => 'mi', + '脬' => 'pao', + '旆' => 'pei', + '炱' => 'tai', + '燧' => 'sui', + '灬' => 'biao', + '礻' => 'shi', + '祧' => 'tiao', + '忑' => 'te', + '忐' => 'tan', + '愍' => 'min', + '肀' => 'yu', + '碛' => 'qi', + '眄' => 'mian', + '眇' => 'miao', + '眭' => 'sui', + '睃' => 'suo', + '瞍' => 'sou', + '畋' => 'tian', + '罴' => 'pi', + '蠓' => 'meng', + '蠛' => 'mie', + '笸' => 'po', + '筢' => 'pa', + '衄' => 'nv', + '艋' => 'meng', + '敉' => 'mi', + '糸' => 'mi', + '綦' => 'qi', + '醅' => 'pei', + '醣' => 'tang', + '趿' => 'ta', + '觫' => 'su', + '龆' => 'tiao', + '鲆' => 'ping', + '稣' => 'su', + '鲐' => 'tai', + '鲦' => 'tiao', + '鳎' => 'ta', + '髂' => 'qia', + '縻' => 'mi', + '裒' => 'pou', + '冫' => 'liang', + '冖' => 'tu', + '讠' => 'yan', + '谇' => 'sui', + '谝' => 'pian', + '谡' => 'su', + '卩' => 'dan', + '阝' => 'zuo', + '陴' => 'pi', + '邳' => 'pi', + '郫' => 'pi', + '郯' => 'tan', + '廴' => 'yin', + '凵' => 'qian', + '圮' => 'pi', + '堋' => 'peng', + '鼙' => 'pi', + '艹' => 'cao', + '芑' => 'qi', + '苤' => 'pie', + '荪' => 'sun', + '荽' => 'sui', + '葜' => 'qia', + '蒎' => 'pai', + '蔌' => 'su', + '蕲' => 'qi', + '薮' => 'sou', + '薹' => 'tai', + '蘼' => 'mi', + '钅' => 'jin', + '钷' => 'po', + '钽' => 'tan', + '铍' => 'pi', + '铴' => 'tang', + '铽' => 'te', + '锫' => 'pei', + '锬' => 'tan', + '锼' => 'sou', + '镤' => 'pu', + '镨' => 'pu', + '皤' => 'po', + '鹈' => 'ti', + '鹋' => 'miao', + '疒' => 'bing', + '疱' => 'pao', + '衤' => 'yi', + '袢' => 'pan', + '裼' => 'ti', + '襻' => 'pan', + '耥' => 'tang', + '耦' => 'ou', + '虍' => 'hu', + '蛴' => 'qi', + '蜞' => 'qi', + '蜱' => 'pi', + '螋' => 'sou', + '螗' => 'tang', + '螵' => 'piao', + '蟛' => 'peng', + ), + 'croatian' => + array ( + 'Č' => 'C', + 'Ć' => 'C', + 'Ž' => 'Z', + 'Š' => 'S', + 'Đ' => 'Dj', + 'č' => 'c', + 'ć' => 'c', + 'ž' => 'z', + 'š' => 's', + 'đ' => 'dj', + ), + 'czech' => + array ( + 'Č' => 'C', + 'Ď' => 'D', + 'Ě' => 'E', + 'Ň' => 'N', + 'Ř' => 'R', + 'Š' => 'S', + 'Ť' => 'T', + 'Ů' => 'U', + 'Ž' => 'Z', + 'č' => 'c', + 'ď' => 'd', + 'ě' => 'e', + 'ň' => 'n', + 'ř' => 'r', + 'š' => 's', + 'ť' => 't', + 'ů' => 'u', + 'ž' => 'z', + ), + 'danish' => + array ( + 'Æ' => 'Ae', + 'æ' => 'ae', + 'Ø' => 'Oe', + 'ø' => 'oe', + 'Å' => 'Aa', + 'å' => 'aa', + 'É' => 'E', + 'é' => 'e', + ), + 'default' => + array ( + '°' => '0', + '¹' => '1', + '²' => '2', + '³' => '3', + '⁴' => '4', + '⁵' => '5', + '⁶' => '6', + '⁷' => '7', + '⁸' => '8', + '⁹' => '9', + '₀' => '0', + '₁' => '1', + '₂' => '2', + '₃' => '3', + '₄' => '4', + '₅' => '5', + '₆' => '6', + '₇' => '7', + '₈' => '8', + '₉' => '9', + 'æ' => 'ae', + 'ǽ' => 'ae', + 'À' => 'A', + 'Á' => 'A', + 'Â' => 'A', + 'Ã' => 'A', + 'Å' => 'AA', + 'Ǻ' => 'A', + 'Ă' => 'A', + 'Ǎ' => 'A', + 'Æ' => 'AE', + 'Ǽ' => 'AE', + 'à' => 'a', + 'á' => 'a', + 'â' => 'a', + 'ã' => 'a', + 'å' => 'aa', + 'ǻ' => 'a', + 'ă' => 'a', + 'ǎ' => 'a', + 'ª' => 'a', + '@' => 'at', + 'Ĉ' => 'C', + 'Ċ' => 'C', + 'Ç' => 'C', + 'ç' => 'c', + 'ĉ' => 'c', + 'ċ' => 'c', + '©' => 'c', + 'Ð' => 'Dj', + 'Đ' => 'D', + 'ð' => 'dj', + 'đ' => 'd', + 'È' => 'E', + 'É' => 'E', + 'Ê' => 'E', + 'Ë' => 'E', + 'Ĕ' => 'E', + 'Ė' => 'E', + 'è' => 'e', + 'é' => 'e', + 'ê' => 'e', + 'ë' => 'e', + 'ĕ' => 'e', + 'ė' => 'e', + 'ƒ' => 'f', + 'Ĝ' => 'G', + 'Ġ' => 'G', + 'ĝ' => 'g', + 'ġ' => 'g', + 'Ĥ' => 'H', + 'Ħ' => 'H', + 'ĥ' => 'h', + 'ħ' => 'h', + 'Ì' => 'I', + 'Í' => 'I', + 'Î' => 'I', + 'Ï' => 'I', + 'Ĩ' => 'I', + 'Ĭ' => 'I', + 'Ǐ' => 'I', + 'Į' => 'I', + 'IJ' => 'IJ', + 'ì' => 'i', + 'í' => 'i', + 'î' => 'i', + 'ï' => 'i', + 'ĩ' => 'i', + 'ĭ' => 'i', + 'ǐ' => 'i', + 'į' => 'i', + 'ij' => 'ij', + 'Ĵ' => 'J', + 'ĵ' => 'j', + 'Ĺ' => 'L', + 'Ľ' => 'L', + 'Ŀ' => 'L', + 'ĺ' => 'l', + 'ľ' => 'l', + 'ŀ' => 'l', + 'Ñ' => 'N', + 'ñ' => 'n', + 'ʼn' => 'n', + 'Ò' => 'O', + 'Ó' => 'O', + 'Ô' => 'O', + 'Õ' => 'O', + 'Ō' => 'O', + 'Ŏ' => 'O', + 'Ǒ' => 'O', + 'Ő' => 'O', + 'Ơ' => 'O', + 'Ø' => 'OE', + 'Ǿ' => 'O', + 'Œ' => 'OE', + 'ò' => 'o', + 'ó' => 'o', + 'ô' => 'o', + 'õ' => 'o', + 'ō' => 'o', + 'ŏ' => 'o', + 'ǒ' => 'o', + 'ő' => 'o', + 'ơ' => 'o', + 'ø' => 'oe', + 'ǿ' => 'o', + 'º' => 'o', + 'œ' => 'oe', + 'Ŕ' => 'R', + 'Ŗ' => 'R', + 'ŕ' => 'r', + 'ŗ' => 'r', + 'Ŝ' => 'S', + 'Ș' => 'S', + 'ŝ' => 's', + 'ș' => 's', + 'ſ' => 's', + 'Ţ' => 'T', + 'Ț' => 'T', + 'Ŧ' => 'T', + 'Þ' => 'TH', + 'ţ' => 't', + 'ț' => 't', + 'ŧ' => 't', + 'þ' => 'th', + 'Ù' => 'U', + 'Ú' => 'U', + 'Û' => 'U', + 'Ü' => 'U', + 'Ũ' => 'U', + 'Ŭ' => 'U', + 'Ű' => 'U', + 'Ų' => 'U', + 'Ư' => 'U', + 'Ǔ' => 'U', + 'Ǖ' => 'U', + 'Ǘ' => 'U', + 'Ǚ' => 'U', + 'Ǜ' => 'U', + 'ù' => 'u', + 'ú' => 'u', + 'û' => 'u', + 'ü' => 'u', + 'ũ' => 'u', + 'ŭ' => 'u', + 'ű' => 'u', + 'ų' => 'u', + 'ư' => 'u', + 'ǔ' => 'u', + 'ǖ' => 'u', + 'ǘ' => 'u', + 'ǚ' => 'u', + 'ǜ' => 'u', + 'Ŵ' => 'W', + 'ŵ' => 'w', + 'Ý' => 'Y', + 'Ÿ' => 'Y', + 'Ŷ' => 'Y', + 'ý' => 'y', + 'ÿ' => 'y', + 'ŷ' => 'y', + ), + 'esperanto' => + array ( + 'ĉ' => 'cx', + 'ĝ' => 'gx', + 'ĥ' => 'hx', + 'ĵ' => 'jx', + 'ŝ' => 'sx', + 'ŭ' => 'ux', + 'Ĉ' => 'CX', + 'Ĝ' => 'GX', + 'Ĥ' => 'HX', + 'Ĵ' => 'JX', + 'Ŝ' => 'SX', + 'Ŭ' => 'UX', + ), + 'estonian' => + array ( + 'Š' => 'S', + 'Ž' => 'Z', + 'Õ' => 'O', + 'Ä' => 'A', + 'Ö' => 'O', + 'Ü' => 'U', + 'š' => 's', + 'ž' => 'z', + 'õ' => 'o', + 'ä' => 'a', + 'ö' => 'o', + 'ü' => 'u', + ), + 'finnish' => + array ( + 'Ä' => 'A', + 'Ö' => 'O', + 'ä' => 'a', + 'ö' => 'o', + ), + 'french' => + array ( + 'À' => 'A', + 'Â' => 'A', + 'Æ' => 'AE', + 'Ç' => 'C', + 'É' => 'E', + 'È' => 'E', + 'Ê' => 'E', + 'Ë' => 'E', + 'Ï' => 'I', + 'Î' => 'I', + 'Ô' => 'O', + 'Œ' => 'OE', + 'Ù' => 'U', + 'Û' => 'U', + 'Ü' => 'U', + 'à' => 'a', + 'â' => 'a', + 'æ' => 'ae', + 'ç' => 'c', + 'é' => 'e', + 'è' => 'e', + 'ê' => 'e', + 'ë' => 'e', + 'ï' => 'i', + 'î' => 'i', + 'ô' => 'o', + 'œ' => 'oe', + 'ù' => 'u', + 'û' => 'u', + 'ü' => 'u', + 'ÿ' => 'y', + 'Ÿ' => 'Y', + ), + 'georgian' => + array ( + 'ა' => 'a', + 'ბ' => 'b', + 'გ' => 'g', + 'დ' => 'd', + 'ე' => 'e', + 'ვ' => 'v', + 'ზ' => 'z', + 'თ' => 't', + 'ი' => 'i', + 'კ' => 'k', + 'ლ' => 'l', + 'მ' => 'm', + 'ნ' => 'n', + 'ო' => 'o', + 'პ' => 'p', + 'ჟ' => 'zh', + 'რ' => 'r', + 'ს' => 's', + 'ტ' => 't', + 'უ' => 'u', + 'ფ' => 'f', + 'ქ' => 'k', + 'ღ' => 'gh', + 'ყ' => 'q', + 'შ' => 'sh', + 'ჩ' => 'ch', + 'ც' => 'ts', + 'ძ' => 'dz', + 'წ' => 'ts', + 'ჭ' => 'ch', + 'ხ' => 'kh', + 'ჯ' => 'j', + 'ჰ' => 'h', + ), + 'german' => + array ( + 'Ä' => 'AE', + 'Ö' => 'OE', + 'Ü' => 'UE', + 'ß' => 'ss', + 'ä' => 'ae', + 'ö' => 'oe', + 'ü' => 'ue', + ), + 'greek' => + array ( + 'ΑΥ' => 'AU', + 'Αυ' => 'Au', + 'ΟΥ' => 'OU', + 'Ου' => 'Ou', + 'ΕΥ' => 'EU', + 'Ευ' => 'Eu', + 'ΕΙ' => 'I', + 'Ει' => 'I', + 'ΟΙ' => 'I', + 'Οι' => 'I', + 'ΥΙ' => 'I', + 'Υι' => 'I', + 'ΑΎ' => 'AU', + 'Αύ' => 'Au', + 'ΟΎ' => 'OU', + 'Ού' => 'Ou', + 'ΕΎ' => 'EU', + 'Εύ' => 'Eu', + 'ΕΊ' => 'I', + 'Εί' => 'I', + 'ΟΊ' => 'I', + 'Οί' => 'I', + 'ΎΙ' => 'I', + 'Ύι' => 'I', + 'ΥΊ' => 'I', + 'Υί' => 'I', + 'αυ' => 'au', + 'ου' => 'ou', + 'ευ' => 'eu', + 'ει' => 'i', + 'οι' => 'i', + 'υι' => 'i', + 'αύ' => 'au', + 'ού' => 'ou', + 'εύ' => 'eu', + 'εί' => 'i', + 'οί' => 'i', + 'ύι' => 'i', + 'υί' => 'i', + 'Α' => 'A', + 'Β' => 'V', + 'Γ' => 'G', + 'Δ' => 'D', + 'Ε' => 'E', + 'Ζ' => 'Z', + 'Η' => 'I', + 'Θ' => 'Th', + 'Ι' => 'I', + 'Κ' => 'K', + 'Λ' => 'L', + 'Μ' => 'M', + 'Ν' => 'N', + 'Ξ' => 'X', + 'Ο' => 'O', + 'Π' => 'P', + 'Ρ' => 'R', + 'Σ' => 'S', + 'Τ' => 'T', + 'Υ' => 'I', + 'Φ' => 'F', + 'Χ' => 'Ch', + 'Ψ' => 'Ps', + 'Ω' => 'O', + 'Ά' => 'A', + 'Έ' => 'E', + 'Ή' => 'I', + 'Ί' => 'I', + 'Ό' => 'O', + 'Ύ' => 'I', + 'Ϊ' => 'I', + 'Ϋ' => 'I', + 'ϒ' => 'I', + 'α' => 'a', + 'β' => 'v', + 'γ' => 'g', + 'δ' => 'd', + 'ε' => 'e', + 'ζ' => 'z', + 'η' => 'i', + 'θ' => 'th', + 'ι' => 'i', + 'κ' => 'k', + 'λ' => 'l', + 'μ' => 'm', + 'ν' => 'n', + 'ξ' => 'x', + 'ο' => 'o', + 'π' => 'p', + 'ρ' => 'r', + 'ς' => 's', + 'σ' => 's', + 'τ' => 't', + 'υ' => 'i', + 'φ' => 'f', + 'χ' => 'ch', + 'ψ' => 'ps', + 'ω' => 'o', + 'ά' => 'a', + 'έ' => 'e', + 'ή' => 'i', + 'ί' => 'i', + 'ό' => 'o', + 'ύ' => 'i', + 'ϊ' => 'i', + 'ϋ' => 'i', + 'ΰ' => 'i', + 'ώ' => 'o', + 'ϐ' => 'v', + 'ϑ' => 'th', + ), + 'hindi' => + array ( + 'अ' => 'a', + 'आ' => 'aa', + 'ए' => 'e', + 'ई' => 'ii', + 'ऍ' => 'ei', + 'ऎ' => 'ae', + 'ऐ' => 'ai', + 'इ' => 'i', + 'ओ' => 'o', + 'ऑ' => 'oi', + 'ऒ' => 'oii', + 'ऊ' => 'uu', + 'औ' => 'ou', + 'उ' => 'u', + 'ब' => 'B', + 'भ' => 'Bha', + 'च' => 'Ca', + 'छ' => 'Chha', + 'ड' => 'Da', + 'ढ' => 'Dha', + 'फ' => 'Fa', + 'फ़' => 'Fi', + 'ग' => 'Ga', + 'घ' => 'Gha', + 'ग़' => 'Ghi', + 'ह' => 'Ha', + 'ज' => 'Ja', + 'झ' => 'Jha', + 'क' => 'Ka', + 'ख' => 'Kha', + 'ख़' => 'Khi', + 'ल' => 'L', + 'ळ' => 'Li', + 'ऌ' => 'Li', + 'ऴ' => 'Lii', + 'ॡ' => 'Lii', + 'म' => 'Ma', + 'न' => 'Na', + 'ङ' => 'Na', + 'ञ' => 'Nia', + 'ण' => 'Nae', + 'ऩ' => 'Ni', + 'ॐ' => 'oms', + 'प' => 'Pa', + 'क़' => 'Qi', + 'र' => 'Ra', + 'ऋ' => 'Ri', + 'ॠ' => 'Ri', + 'ऱ' => 'Ri', + 'स' => 'Sa', + 'श' => 'Sha', + 'ष' => 'Shha', + 'ट' => 'Ta', + 'त' => 'Ta', + 'ठ' => 'Tha', + 'द' => 'Tha', + 'थ' => 'Tha', + 'ध' => 'Thha', + 'ड़' => 'ugDha', + 'ढ़' => 'ugDhha', + 'व' => 'Va', + 'य' => 'Ya', + 'य़' => 'Yi', + 'ज़' => 'Za', + ), + 'hungarian' => + array ( + 'Á' => 'a', + 'É' => 'e', + 'Í' => 'i', + 'Ó' => 'o', + 'Ö' => 'o', + 'Ő' => 'o', + 'Ú' => 'u', + 'Ü' => 'u', + 'Ű' => 'u', + 'á' => 'a', + 'é' => 'e', + 'í' => 'i', + 'ó' => 'o', + 'ö' => 'o', + 'ő' => 'o', + 'ú' => 'u', + 'ü' => 'u', + 'ű' => 'u', + ), + 'italian' => + array ( + 'À' => 'a', + 'È' => 'e', + 'Ì' => 'i', + 'Ò' => 'o', + 'Ù' => 'u', + 'à' => 'a', + 'é' => 'e', + 'è' => 'e', + 'ì' => 'i', + 'ò' => 'o', + 'ù' => 'u', + ), + 'latvian' => + array ( + 'Ā' => 'A', + 'Ē' => 'E', + 'Ģ' => 'G', + 'Ī' => 'I', + 'Ķ' => 'K', + 'Ļ' => 'L', + 'Ņ' => 'N', + 'Ū' => 'U', + 'ā' => 'a', + 'ē' => 'e', + 'ģ' => 'g', + 'ī' => 'i', + 'ķ' => 'k', + 'ļ' => 'l', + 'ņ' => 'n', + 'ū' => 'u', + ), + 'lithuanian' => + array ( + 'Ą' => 'A', + 'Č' => 'C', + 'Ę' => 'E', + 'Ė' => 'E', + 'Į' => 'I', + 'Š' => 'S', + 'Ų' => 'U', + 'Ū' => 'U', + 'Ž' => 'Z', + 'ą' => 'a', + 'č' => 'c', + 'ę' => 'e', + 'ė' => 'e', + 'į' => 'i', + 'š' => 's', + 'ų' => 'u', + 'ū' => 'u', + 'ž' => 'z', + ), + 'macedonian' => + array ( + 'А' => 'A', + 'Б' => 'B', + 'В' => 'V', + 'Г' => 'G', + 'Д' => 'D', + 'Ѓ' => 'Gj', + 'Е' => 'E', + 'Ж' => 'Zh', + 'З' => 'Z', + 'Ѕ' => 'Dz', + 'И' => 'I', + 'Ј' => 'J', + 'К' => 'K', + 'Л' => 'L', + 'Љ' => 'Lj', + 'М' => 'M', + 'Н' => 'N', + 'Њ' => 'Nj', + 'О' => 'O', + 'П' => 'P', + 'Р' => 'R', + 'С' => 'S', + 'Т' => 'T', + 'Ќ' => 'Kj', + 'У' => 'U', + 'Ф' => 'F', + 'Х' => 'H', + 'Ц' => 'C', + 'Ч' => 'Ch', + 'Џ' => 'Dj', + 'Ш' => 'Sh', + 'а' => 'a', + 'б' => 'b', + 'в' => 'v', + 'г' => 'g', + 'д' => 'd', + 'ѓ' => 'gj', + 'е' => 'e', + 'ж' => 'zh', + 'з' => 'z', + 'ѕ' => 'dz', + 'и' => 'i', + 'ј' => 'j', + 'к' => 'k', + 'л' => 'l', + 'љ' => 'lj', + 'м' => 'm', + 'н' => 'n', + 'њ' => 'nj', + 'о' => 'o', + 'п' => 'p', + 'р' => 'r', + 'с' => 's', + 'т' => 't', + 'ќ' => 'kj', + 'у' => 'u', + 'ф' => 'f', + 'х' => 'h', + 'ц' => 'c', + 'ч' => 'ch', + 'џ' => 'dj', + 'ш' => 'sh', + ), + 'norwegian' => + array ( + 'Æ' => 'AE', + 'Ø' => 'OE', + 'Å' => 'AA', + 'æ' => 'ae', + 'ø' => 'oe', + 'å' => 'aa', + ), + 'persian' => + array ( + 'ا' => 'a', + 'ب' => 'b', + 'پ' => 'p', + 'ت' => 't', + 'ث' => 'th', + 'ج' => 'j', + 'چ' => 'ch', + 'ح' => 'h', + 'خ' => 'kh', + 'د' => 'd', + 'ذ' => 'th', + 'ر' => 'r', + 'ز' => 'z', + 'ژ' => 'zh', + 'س' => 's', + 'ش' => 'sh', + 'ص' => 's', + 'ض' => 'z', + 'ط' => 't', + 'ظ' => 'z', + 'ع' => 'a', + 'غ' => 'gh', + 'ف' => 'f', + 'ق' => 'g', + 'ك' => 'k', + 'گ' => 'g', + 'ل' => 'l', + 'م' => 'm', + 'ن' => 'n', + 'و' => 'o', + 'ه' => 'h', + 'ی' => 'y', + ), + 'polish' => + array ( + 'Ą' => 'A', + 'Ć' => 'C', + 'Ę' => 'E', + 'Ł' => 'L', + 'Ń' => 'N', + 'Ó' => 'O', + 'Ś' => 'S', + 'Ź' => 'Z', + 'Ż' => 'Z', + 'ą' => 'a', + 'ć' => 'c', + 'ę' => 'e', + 'ł' => 'l', + 'ń' => 'n', + 'ó' => 'o', + 'ś' => 's', + 'ź' => 'z', + 'ż' => 'z', + ), + 'portuguese-brazil' => + array ( + '°' => '0', + '¹' => '1', + '²' => '2', + '³' => '3', + '⁴' => '4', + '⁵' => '5', + '⁶' => '6', + '⁷' => '7', + '⁸' => '8', + '⁹' => '9', + '₀' => '0', + '₁' => '1', + '₂' => '2', + '₃' => '3', + '₄' => '4', + '₅' => '5', + '₆' => '6', + '₇' => '7', + '₈' => '8', + '₉' => '9', + 'æ' => 'ae', + 'ǽ' => 'ae', + 'À' => 'A', + 'Á' => 'A', + 'Â' => 'A', + 'Ã' => 'A', + 'Å' => 'AA', + 'Ǻ' => 'A', + 'Ă' => 'A', + 'Ǎ' => 'A', + 'Æ' => 'AE', + 'Ǽ' => 'AE', + 'à' => 'a', + 'á' => 'a', + 'â' => 'a', + 'ã' => 'a', + 'å' => 'aa', + 'ǻ' => 'a', + 'ă' => 'a', + 'ǎ' => 'a', + 'ª' => 'a', + '@' => 'at', + 'Ĉ' => 'C', + 'Ċ' => 'C', + 'Ç' => 'Ç', + 'ç' => 'ç', + 'ĉ' => 'c', + 'ċ' => 'c', + '©' => 'c', + 'Ð' => 'Dj', + 'Đ' => 'D', + 'ð' => 'dj', + 'đ' => 'd', + 'È' => 'E', + 'É' => 'E', + 'Ê' => 'E', + 'Ë' => 'E', + 'Ĕ' => 'E', + 'Ė' => 'E', + 'è' => 'e', + 'é' => 'é', + 'ê' => 'e', + 'ë' => 'e', + 'ĕ' => 'e', + 'ė' => 'e', + 'ƒ' => 'f', + 'Ĝ' => 'G', + 'Ġ' => 'G', + 'ĝ' => 'g', + 'ġ' => 'g', + 'Ĥ' => 'H', + 'Ħ' => 'H', + 'ĥ' => 'h', + 'ħ' => 'h', + 'Ì' => 'I', + 'Í' => 'I', + 'Î' => 'I', + 'Ï' => 'I', + 'Ĩ' => 'I', + 'Ĭ' => 'I', + 'Ǐ' => 'I', + 'Į' => 'I', + 'IJ' => 'IJ', + 'ì' => 'i', + 'í' => 'i', + 'î' => 'i', + 'ï' => 'i', + 'ĩ' => 'i', + 'ĭ' => 'i', + 'ǐ' => 'i', + 'į' => 'i', + 'ij' => 'ij', + 'Ĵ' => 'J', + 'ĵ' => 'j', + 'Ĺ' => 'L', + 'Ľ' => 'L', + 'Ŀ' => 'L', + 'ĺ' => 'l', + 'ľ' => 'l', + 'ŀ' => 'l', + 'Ñ' => 'N', + 'ñ' => 'n', + 'ʼn' => 'n', + 'Ò' => 'O', + 'Ó' => 'O', + 'Ô' => 'O', + 'Õ' => 'O', + 'Ō' => 'O', + 'Ŏ' => 'O', + 'Ǒ' => 'O', + 'Ő' => 'O', + 'Ơ' => 'O', + 'Ø' => 'OE', + 'Ǿ' => 'O', + 'Œ' => 'OE', + 'ò' => 'o', + 'ó' => 'o', + 'ô' => 'o', + 'õ' => 'o', + 'ō' => 'o', + 'ŏ' => 'o', + 'ǒ' => 'o', + 'ő' => 'o', + 'ơ' => 'o', + 'ø' => 'oe', + 'ǿ' => 'o', + 'º' => 'o', + 'œ' => 'oe', + 'Ŕ' => 'R', + 'Ŗ' => 'R', + 'ŕ' => 'r', + 'ŗ' => 'r', + 'Ŝ' => 'S', + 'Ș' => 'S', + 'ŝ' => 's', + 'ș' => 's', + 'ſ' => 's', + 'Ţ' => 'T', + 'Ț' => 'T', + 'Ŧ' => 'T', + 'Þ' => 'TH', + 'ţ' => 't', + 'ț' => 't', + 'ŧ' => 't', + 'þ' => 'th', + 'Ù' => 'U', + 'Ú' => 'U', + 'Û' => 'U', + 'Ü' => 'U', + 'Ũ' => 'U', + 'Ŭ' => 'U', + 'Ű' => 'U', + 'Ų' => 'U', + 'Ư' => 'U', + 'Ǔ' => 'U', + 'Ǖ' => 'U', + 'Ǘ' => 'U', + 'Ǚ' => 'U', + 'Ǜ' => 'U', + 'ù' => 'u', + 'ú' => 'u', + 'û' => 'u', + 'ü' => 'u', + 'ũ' => 'u', + 'ŭ' => 'u', + 'ű' => 'u', + 'ų' => 'u', + 'ư' => 'u', + 'ǔ' => 'u', + 'ǖ' => 'u', + 'ǘ' => 'u', + 'ǚ' => 'u', + 'ǜ' => 'u', + 'Ŵ' => 'W', + 'ŵ' => 'w', + 'Ý' => 'Y', + 'Ÿ' => 'Y', + 'Ŷ' => 'Y', + 'ý' => 'y', + 'ÿ' => 'y', + 'ŷ' => 'y', + ), + 'romanian' => + array ( + 'ă' => 'a', + 'î' => 'i', + 'â' => 'a', + 'ş' => 's', + 'ș' => 's', + 'ţ' => 't', + 'ț' => 't', + 'Ă' => 'A', + 'Î' => 'I', + 'Â' => 'A', + 'Ş' => 'S', + 'Ș' => 'S', + 'Ţ' => 'T', + 'Ț' => 'T', + ), + 'russian' => + array ( + 'Ъ' => '', + 'Ь' => '', + 'А' => 'A', + 'Б' => 'B', + 'Ц' => 'C', + 'Ч' => 'Ch', + 'Д' => 'D', + 'Е' => 'E', + 'Ё' => 'E', + 'Э' => 'E', + 'Ф' => 'F', + 'Г' => 'G', + 'Х' => 'H', + 'И' => 'I', + 'Й' => 'Y', + 'Я' => 'Ya', + 'Ю' => 'Yu', + 'К' => 'K', + 'Л' => 'L', + 'М' => 'M', + 'Н' => 'N', + 'О' => 'O', + 'П' => 'P', + 'Р' => 'R', + 'С' => 'S', + 'Ш' => 'Sh', + 'Щ' => 'Shch', + 'Т' => 'T', + 'У' => 'U', + 'В' => 'V', + 'Ы' => 'Y', + 'З' => 'Z', + 'Ж' => 'Zh', + 'ъ' => '', + 'ь' => '', + 'а' => 'a', + 'б' => 'b', + 'ц' => 'c', + 'ч' => 'ch', + 'д' => 'd', + 'е' => 'e', + 'ё' => 'e', + 'э' => 'e', + 'ф' => 'f', + 'г' => 'g', + 'х' => 'h', + 'и' => 'i', + 'й' => 'y', + 'я' => 'ya', + 'ю' => 'yu', + 'к' => 'k', + 'л' => 'l', + 'м' => 'm', + 'н' => 'n', + 'о' => 'o', + 'п' => 'p', + 'р' => 'r', + 'с' => 's', + 'ш' => 'sh', + 'щ' => 'shch', + 'т' => 't', + 'у' => 'u', + 'в' => 'v', + 'ы' => 'y', + 'з' => 'z', + 'ж' => 'zh', + ), + 'serbian' => + array ( + 'а' => 'a', + 'б' => 'b', + 'в' => 'v', + 'г' => 'g', + 'д' => 'd', + 'ђ' => 'dj', + 'е' => 'e', + 'ж' => 'z', + 'з' => 'z', + 'и' => 'i', + 'ј' => 'j', + 'к' => 'k', + 'л' => 'l', + 'љ' => 'lj', + 'м' => 'm', + 'н' => 'n', + 'њ' => 'nj', + 'о' => 'o', + 'п' => 'p', + 'р' => 'r', + 'с' => 's', + 'т' => 't', + 'ћ' => 'c', + 'у' => 'u', + 'ф' => 'f', + 'х' => 'h', + 'ц' => 'c', + 'ч' => 'c', + 'џ' => 'dz', + 'ш' => 's', + 'А' => 'A', + 'Б' => 'B', + 'В' => 'V', + 'Г' => 'G', + 'Д' => 'D', + 'Ђ' => 'Dj', + 'Е' => 'E', + 'Ж' => 'Z', + 'З' => 'Z', + 'И' => 'I', + 'Ј' => 'J', + 'К' => 'K', + 'Л' => 'L', + 'Љ' => 'Lj', + 'М' => 'M', + 'Н' => 'N', + 'Њ' => 'Nj', + 'О' => 'O', + 'П' => 'P', + 'Р' => 'R', + 'С' => 'S', + 'Т' => 'T', + 'Ћ' => 'C', + 'У' => 'U', + 'Ф' => 'F', + 'Х' => 'H', + 'Ц' => 'C', + 'Ч' => 'C', + 'Џ' => 'Dz', + 'Ш' => 'S', + 'š' => 's', + 'đ' => 'dj', + 'ž' => 'z', + 'ć' => 'c', + 'č' => 'c', + 'Š' => 'S', + 'Đ' => 'DJ', + 'Ž' => 'Z', + 'Ć' => 'C', + 'Č' => 'C', + ), + 'slovak' => + array( + "Á" => "A", + "Ä" => "A", + "Č" => "C", + "Ď" => "D", + "É" => "E", + "Í" => "I", + "Ĺ" => "L", + "Ľ" => "L", + "Ň" => "N", + "Ó" => "O", + "Ô" => "O", + "Ŕ" => "R", + "Š" => "S", + "Ť" => "T", + "Ú" => "U", + "Ý" => "Y", + "Ž" => "Z", + "á" => "a", + "ä" => "a", + "č" => "c", + "ď" => "d", + "é" => "e", + "í" => "i", + "ĺ" => "l", + "ľ" => "l", + "ň" => "n", + "ó" => "o", + "ô" => "o", + "ŕ" => "r", + "š" => "s", + "ť" => "t", + "ú" => "u", + "ý" => "y", + "ž" => "z", + ), + 'swedish' => + array ( + 'Ä' => 'A', + 'Å' => 'a', + 'Ö' => 'O', + 'ä' => 'a', + 'å' => 'a', + 'ö' => 'o', + ), + 'turkish' => + array ( + 'Ç' => 'C', + 'Ğ' => 'G', + 'İ' => 'I', + 'Ş' => 'S', + 'Ö' => 'O', + 'Ü' => 'U', + 'ç' => 'c', + 'ğ' => 'g', + 'ı' => 'i', + 'ş' => 's', + 'ö' => 'o', + 'ü' => 'u', + ), + 'turkmen' => + array ( + 'Ç' => 'C', + 'Ä' => 'A', + 'Ž' => 'Z', + 'Ň' => 'N', + 'Ö' => 'O', + 'Ş' => 'S', + 'Ü' => 'U', + 'Ý' => 'Y', + 'ç' => 'c', + 'ä' => 'a', + 'ž' => 'z', + 'ň' => 'n', + 'ö' => 'o', + 'ş' => 's', + 'ü' => 'u', + 'ý' => 'y', + ), + 'ukrainian' => + array ( + 'Ґ' => 'G', + 'І' => 'I', + 'Ї' => 'Ji', + 'Є' => 'Ye', + 'ґ' => 'g', + 'і' => 'i', + 'ї' => 'ji', + 'є' => 'ye', + ), + 'vietnamese' => + array ( + 'ạ' => 'a', + 'ả' => 'a', + 'ầ' => 'a', + 'ấ' => 'a', + 'ậ' => 'a', + 'ẩ' => 'a', + 'ẫ' => 'a', + 'ằ' => 'a', + 'ắ' => 'a', + 'ặ' => 'a', + 'ẳ' => 'a', + 'ẵ' => 'a', + 'ẹ' => 'e', + 'ẻ' => 'e', + 'ẽ' => 'e', + 'ề' => 'e', + 'ế' => 'e', + 'ệ' => 'e', + 'ể' => 'e', + 'ễ' => 'e', + 'ị' => 'i', + 'ỉ' => 'i', + 'ọ' => 'o', + 'ỏ' => 'o', + 'ồ' => 'o', + 'ố' => 'o', + 'ộ' => 'o', + 'ổ' => 'o', + 'ỗ' => 'o', + 'ờ' => 'o', + 'ớ' => 'o', + 'ợ' => 'o', + 'ở' => 'o', + 'ỡ' => 'o', + 'ụ' => 'u', + 'ủ' => 'u', + 'ừ' => 'u', + 'ứ' => 'u', + 'ự' => 'u', + 'ử' => 'u', + 'ữ' => 'u', + 'ỳ' => 'y', + 'ỵ' => 'y', + 'ỷ' => 'y', + 'ỹ' => 'y', + 'Ạ' => 'A', + 'Ả' => 'A', + 'Ầ' => 'A', + 'Ấ' => 'A', + 'Ậ' => 'A', + 'Ẩ' => 'A', + 'Ẫ' => 'A', + 'Ằ' => 'A', + 'Ắ' => 'A', + 'Ặ' => 'A', + 'Ẳ' => 'A', + 'Ẵ' => 'A', + 'Ẹ' => 'E', + 'Ẻ' => 'E', + 'Ẽ' => 'E', + 'Ề' => 'E', + 'Ế' => 'E', + 'Ệ' => 'E', + 'Ể' => 'E', + 'Ễ' => 'E', + 'Ị' => 'I', + 'Ỉ' => 'I', + 'Ọ' => 'O', + 'Ỏ' => 'O', + 'Ồ' => 'O', + 'Ố' => 'O', + 'Ộ' => 'O', + 'Ổ' => 'O', + 'Ỗ' => 'O', + 'Ờ' => 'O', + 'Ớ' => 'O', + 'Ợ' => 'O', + 'Ở' => 'O', + 'Ỡ' => 'O', + 'Ụ' => 'U', + 'Ủ' => 'U', + 'Ừ' => 'U', + 'Ứ' => 'U', + 'Ự' => 'U', + 'Ử' => 'U', + 'Ữ' => 'U', + 'Ỳ' => 'Y', + 'Ỵ' => 'Y', + 'Ỷ' => 'Y', + 'Ỹ' => 'Y', + ), +)/*INSERT_END*/; + + /** + * @param string $ruleset + * + * @return array + */ + public function getRules($ruleset) + { + return $this->rules[$ruleset]; + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/RuleProvider/FileRuleProvider.php b/plugins/page-toc/vendor/cocur/slugify/src/RuleProvider/FileRuleProvider.php new file mode 100644 index 0000000..6065933 --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/RuleProvider/FileRuleProvider.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cocur\Slugify\RuleProvider; + +/** + * FileRuleProvider + * + * @package Cocur\Slugify\RuleProvider + * @author Florian Eckerstorfer + * @copyright 2015 Florian Eckerstorfer + */ +class FileRuleProvider implements RuleProviderInterface +{ + /** + * @var string + */ + protected $directoryName; + + /** + * @param string $directoryName + */ + public function __construct($directoryName) + { + $this->directoryName = $directoryName; + } + + /** + * @param $ruleset + * + * @return array + */ + public function getRules($ruleset) + { + $fileName = $this->directoryName.DIRECTORY_SEPARATOR.$ruleset.'.json'; + + return json_decode(file_get_contents($fileName), true); + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/RuleProvider/RuleProviderInterface.php b/plugins/page-toc/vendor/cocur/slugify/src/RuleProvider/RuleProviderInterface.php new file mode 100644 index 0000000..f5648cc --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/RuleProvider/RuleProviderInterface.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cocur\Slugify\RuleProvider; + +/** + * RuleProviderInterface + * + * @package Cocur\Slugify\RuleProvider + * @author Florian Eckerstorfer + * @copyright 2015 Florian Eckerstorfer + */ +interface RuleProviderInterface +{ + /** + * @param $ruleset + * + * @return array + */ + public function getRules($ruleset); +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/Slugify.php b/plugins/page-toc/vendor/cocur/slugify/src/Slugify.php new file mode 100644 index 0000000..712cea3 --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/Slugify.php @@ -0,0 +1,192 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cocur\Slugify; + +use Cocur\Slugify\RuleProvider\DefaultRuleProvider; +use Cocur\Slugify\RuleProvider\RuleProviderInterface; + +/** + * Slugify + * + * @package Cocur\Slugify + * @author Florian Eckerstorfer + * @author Ivo Bathke + * @author Marchenko Alexandr + * @copyright 2012-2015 Florian Eckerstorfer + * @license http://www.opensource.org/licenses/MIT The MIT License + */ +class Slugify implements SlugifyInterface +{ + const LOWERCASE_NUMBERS_DASHES = '/[^A-Za-z0-9]+/'; + + /** + * @var array + */ + protected $rules = []; + + /** + * @var RuleProviderInterface + */ + protected $provider; + + /** + * @var array + */ + protected $options = [ + 'regexp' => self::LOWERCASE_NUMBERS_DASHES, + 'separator' => '-', + 'lowercase' => true, + 'lowercase_after_regexp' => false, + 'trim' => true, + 'strip_tags' => false, + 'rulesets' => [ + 'default', + // Languages are preferred if they appear later, list is ordered by number of + // websites in that language + // https://en.wikipedia.org/wiki/Languages_used_on_the_Internet#Content_languages_for_websites + 'armenian', + 'azerbaijani', + 'burmese', + 'hindi', + 'georgian', + 'norwegian', + 'vietnamese', + 'ukrainian', + 'latvian', + 'finnish', + 'greek', + 'czech', + 'arabic', + 'slovak', + 'turkish', + 'polish', + 'german', + 'russian', + 'romanian' + ], + ]; + + /** + * @param array $options + * @param RuleProviderInterface $provider + */ + public function __construct(array $options = [], RuleProviderInterface $provider = null) + { + $this->options = array_merge($this->options, $options); + $this->provider = $provider ? $provider : new DefaultRuleProvider(); + + foreach ($this->options['rulesets'] as $ruleSet) { + $this->activateRuleSet($ruleSet); + } + } + + /** + * Returns the slug-version of the string. + * + * @param string $string String to slugify + * @param string|array|null $options Options + * + * @return string Slugified version of the string + */ + public function slugify($string, $options = null) + { + // BC: the second argument used to be the separator + if (is_string($options)) { + $separator = $options; + $options = []; + $options['separator'] = $separator; + } + + $options = array_merge($this->options, (array) $options); + + // Add a custom ruleset without touching the default rules + if (isset($options['ruleset'])) { + $rules = array_merge($this->rules, $this->provider->getRules($options['ruleset'])); + } else { + $rules = $this->rules; + } + + $string = ($options['strip_tags']) + ? strip_tags($string) + : $string; + + $string = strtr($string, $rules); + unset($rules); + + if ($options['lowercase'] && !$options['lowercase_after_regexp']) { + $string = mb_strtolower($string); + } + + $string = preg_replace($options['regexp'], $options['separator'], $string); + + if ($options['lowercase'] && $options['lowercase_after_regexp']) { + $string = mb_strtolower($string); + } + + return ($options['trim']) + ? trim($string, $options['separator']) + : $string; + } + + /** + * Adds a custom rule to Slugify. + * + * @param string $character Character + * @param string $replacement Replacement character + * + * @return Slugify + */ + public function addRule($character, $replacement) + { + $this->rules[$character] = $replacement; + + return $this; + } + + /** + * Adds multiple rules to Slugify. + * + * @param array $rules + * + * @return Slugify + */ + public function addRules(array $rules) + { + foreach ($rules as $character => $replacement) { + $this->addRule($character, $replacement); + } + + return $this; + } + + /** + * @param string $ruleSet + * + * @return Slugify + */ + public function activateRuleSet($ruleSet) + { + return $this->addRules($this->provider->getRules($ruleSet)); + } + + /** + * Static method to create new instance of {@see Slugify}. + * + * @param array $options + * + * @return Slugify + */ + public static function create(array $options = []) + { + return new static($options); + } +} diff --git a/plugins/page-toc/vendor/cocur/slugify/src/SlugifyInterface.php b/plugins/page-toc/vendor/cocur/slugify/src/SlugifyInterface.php new file mode 100644 index 0000000..2160bc1 --- /dev/null +++ b/plugins/page-toc/vendor/cocur/slugify/src/SlugifyInterface.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cocur\Slugify; + +/** + * SlugifyInterface + * + * @package org.cocur.slugify + * @author Florian Eckerstorfer + * @author Marchenko Alexandr + * @copyright 2012-2014 Florian Eckerstorfer + * @license http://www.opensource.org/licenses/MIT The MIT License + */ +interface SlugifyInterface +{ + /** + * Return a URL safe version of a string. + * + * @param string $string + * @param string|array|null $options + * + * @return string + * + * @api + */ + public function slugify($string, $options = null); +} diff --git a/plugins/page-toc/vendor/composer/ClassLoader.php b/plugins/page-toc/vendor/composer/ClassLoader.php new file mode 100644 index 0000000..0cd6055 --- /dev/null +++ b/plugins/page-toc/vendor/composer/ClassLoader.php @@ -0,0 +1,572 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + /** @var ?string */ + private $vendorDir; + + // PSR-4 + /** + * @var array[] + * @psalm-var array> + */ + private $prefixLengthsPsr4 = array(); + /** + * @var array[] + * @psalm-var array> + */ + private $prefixDirsPsr4 = array(); + /** + * @var array[] + * @psalm-var array + */ + private $fallbackDirsPsr4 = array(); + + // PSR-0 + /** + * @var array[] + * @psalm-var array> + */ + private $prefixesPsr0 = array(); + /** + * @var array[] + * @psalm-var array + */ + private $fallbackDirsPsr0 = array(); + + /** @var bool */ + private $useIncludePath = false; + + /** + * @var string[] + * @psalm-var array + */ + private $classMap = array(); + + /** @var bool */ + private $classMapAuthoritative = false; + + /** + * @var bool[] + * @psalm-var array + */ + private $missingClasses = array(); + + /** @var ?string */ + private $apcuPrefix; + + /** + * @var self[] + */ + private static $registeredLoaders = array(); + + /** + * @param ?string $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + } + + /** + * @return string[] + */ + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); + } + + return array(); + } + + /** + * @return array[] + * @psalm-return array> + */ + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + /** + * @return array[] + * @psalm-return array + */ + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + /** + * @return array[] + * @psalm-return array + */ + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + /** + * @return string[] Array of classname => path + * @psalm-var array + */ + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param string[] $classMap Class to filename map + * @psalm-param array $classMap + * + * @return void + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void + */ + public function add($prefix, $paths, $prepend = false) + { + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + (array) $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + (array) $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + (array) $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + (array) $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + (array) $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + (array) $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 base directories + * + * @return void + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + * + * @return void + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + * + * @return void + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + * + * @return void + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } + } + + /** + * Unregisters this instance as an autoloader. + * + * @return void + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return true|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + includeFile($file); + + return true; + } + + return null; + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + /** + * Returns the currently registered loaders indexed by their corresponding vendor directories. + * + * @return self[] + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private + */ +function includeFile($file) +{ + include $file; +} diff --git a/plugins/page-toc/vendor/composer/InstalledVersions.php b/plugins/page-toc/vendor/composer/InstalledVersions.php new file mode 100644 index 0000000..d50e0c9 --- /dev/null +++ b/plugins/page-toc/vendor/composer/InstalledVersions.php @@ -0,0 +1,350 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + */ +class InstalledVersions +{ + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints($constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = require __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + $installed[] = self::$installed; + + return $installed; + } +} diff --git a/plugins/page-toc/vendor/composer/LICENSE b/plugins/page-toc/vendor/composer/LICENSE new file mode 100644 index 0000000..f27399a --- /dev/null +++ b/plugins/page-toc/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +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. + diff --git a/plugins/page-toc/vendor/composer/autoload_classmap.php b/plugins/page-toc/vendor/composer/autoload_classmap.php new file mode 100644 index 0000000..fde5e12 --- /dev/null +++ b/plugins/page-toc/vendor/composer/autoload_classmap.php @@ -0,0 +1,11 @@ + $vendorDir . '/composer/InstalledVersions.php', + 'Grav\\Plugin\\PageTOCPlugin' => $baseDir . '/page-toc.php', +); diff --git a/plugins/page-toc/vendor/composer/autoload_namespaces.php b/plugins/page-toc/vendor/composer/autoload_namespaces.php new file mode 100644 index 0000000..b7fc012 --- /dev/null +++ b/plugins/page-toc/vendor/composer/autoload_namespaces.php @@ -0,0 +1,9 @@ + array($vendorDir . '/knplabs/knp-menu/src/Knp/Menu'), + 'Grav\\Plugin\\PageToc\\' => array($baseDir . '/classes'), + 'Cocur\\Slugify\\' => array($vendorDir . '/cocur/slugify/src'), +); diff --git a/plugins/page-toc/vendor/composer/autoload_real.php b/plugins/page-toc/vendor/composer/autoload_real.php new file mode 100644 index 0000000..f0ab1fe --- /dev/null +++ b/plugins/page-toc/vendor/composer/autoload_real.php @@ -0,0 +1,57 @@ += 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); + if ($useStaticLoader) { + require __DIR__ . '/autoload_static.php'; + + call_user_func(\Composer\Autoload\ComposerStaticInit88b09b7fda3e99f2e22346b58205e375::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + } + + $loader->register(true); + + return $loader; + } +} diff --git a/plugins/page-toc/vendor/composer/autoload_static.php b/plugins/page-toc/vendor/composer/autoload_static.php new file mode 100644 index 0000000..0b46124 --- /dev/null +++ b/plugins/page-toc/vendor/composer/autoload_static.php @@ -0,0 +1,53 @@ + + array ( + 'Knp\\Menu\\' => 9, + ), + 'G' => + array ( + 'Grav\\Plugin\\PageToc\\' => 20, + ), + 'C' => + array ( + 'Cocur\\Slugify\\' => 14, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'Knp\\Menu\\' => + array ( + 0 => __DIR__ . '/..' . '/knplabs/knp-menu/src/Knp/Menu', + ), + 'Grav\\Plugin\\PageToc\\' => + array ( + 0 => __DIR__ . '/../..' . '/classes', + ), + 'Cocur\\Slugify\\' => + array ( + 0 => __DIR__ . '/..' . '/cocur/slugify/src', + ), + ); + + public static $classMap = array ( + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + 'Grav\\Plugin\\PageTOCPlugin' => __DIR__ . '/../..' . '/page-toc.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInit88b09b7fda3e99f2e22346b58205e375::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit88b09b7fda3e99f2e22346b58205e375::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit88b09b7fda3e99f2e22346b58205e375::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/plugins/page-toc/vendor/composer/installed.json b/plugins/page-toc/vendor/composer/installed.json new file mode 100644 index 0000000..ae2b15f --- /dev/null +++ b/plugins/page-toc/vendor/composer/installed.json @@ -0,0 +1,158 @@ +{ + "packages": [ + { + "name": "cocur/slugify", + "version": "v4.0.0", + "version_normalized": "4.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/cocur/slugify.git", + "reference": "3f1ffc300f164f23abe8b64ffb3f92d35cec8307" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cocur/slugify/zipball/3f1ffc300f164f23abe8b64ffb3f92d35cec8307", + "reference": "3f1ffc300f164f23abe8b64ffb3f92d35cec8307", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=7.0" + }, + "conflict": { + "symfony/config": "<3.4 || >=4,<4.3", + "symfony/dependency-injection": "<3.4 || >=4,<4.3", + "symfony/http-kernel": "<3.4 || >=4,<4.3", + "twig/twig": "<2.12.1" + }, + "require-dev": { + "laravel/framework": "~5.1", + "latte/latte": "~2.2", + "league/container": "^2.2.0", + "mikey179/vfsstream": "~1.6.8", + "mockery/mockery": "^1.3", + "nette/di": "~2.4", + "phpunit/phpunit": "^5.7.27", + "pimple/pimple": "~1.1", + "plumphp/plum": "~0.1", + "symfony/config": "^3.4 || ^4.3 || ^5.0", + "symfony/dependency-injection": "^3.4 || ^4.3 || ^5.0", + "symfony/http-kernel": "^3.4 || ^4.3 || ^5.0", + "twig/twig": "^2.12.1 || ~3.0", + "zendframework/zend-modulemanager": "~2.2", + "zendframework/zend-servicemanager": "~2.2", + "zendframework/zend-view": "~2.2" + }, + "time": "2019-12-14T13:04:14+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Cocur\\Slugify\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florian Eckerstorfer", + "email": "florian@eckerstorfer.co", + "homepage": "https://florian.ec" + }, + { + "name": "Ivo Bathke", + "email": "ivo.bathke@gmail.com" + } + ], + "description": "Converts a string into a slug.", + "keywords": [ + "slug", + "slugify" + ], + "support": { + "issues": "https://github.com/cocur/slugify/issues", + "source": "https://github.com/cocur/slugify/tree/master" + }, + "install-path": "../cocur/slugify" + }, + { + "name": "knplabs/knp-menu", + "version": "v3.3.0", + "version_normalized": "3.3.0.0", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/KnpMenu.git", + "reference": "8bd3dc2afa22c65617c563c5e25e62d6e23e98c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/KnpMenu/zipball/8bd3dc2afa22c65617c563c5e25e62d6e23e98c7", + "reference": "8bd3dc2afa22c65617c563c5e25e62d6e23e98c7", + "shasum": "" + }, + "require": { + "php": "^7.3 || ^8.0" + }, + "conflict": { + "twig/twig": "<1.40 || >=2,<2.9" + }, + "require-dev": { + "phpunit/phpunit": "^9.5", + "psr/container": "^1.0", + "symfony/http-foundation": "^4.4 || ^5.0 || ^6.0", + "symfony/phpunit-bridge": "^5.3", + "symfony/routing": "^4.4 || ^5.0 || ^6.0", + "twig/twig": "^1.40 || ^2.9 || ^3.0" + }, + "suggest": { + "twig/twig": "for the TwigRenderer and the integration with your templates" + }, + "time": "2021-10-23T15:01:04+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-4": { + "Knp\\Menu\\": "src/Knp/Menu" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KnpLabs", + "homepage": "https://knplabs.com" + }, + { + "name": "Christophe Coevoet", + "email": "stof@notk.org" + }, + { + "name": "The Community", + "homepage": "https://github.com/KnpLabs/KnpMenu/contributors" + } + ], + "description": "An object oriented menu library", + "homepage": "https://knplabs.com", + "keywords": [ + "menu", + "tree" + ], + "support": { + "issues": "https://github.com/KnpLabs/KnpMenu/issues", + "source": "https://github.com/KnpLabs/KnpMenu/tree/v3.3.0" + }, + "install-path": "../knplabs/knp-menu" + } + ], + "dev": true, + "dev-package-names": [] +} diff --git a/plugins/page-toc/vendor/composer/installed.php b/plugins/page-toc/vendor/composer/installed.php new file mode 100644 index 0000000..b07e9cc --- /dev/null +++ b/plugins/page-toc/vendor/composer/installed.php @@ -0,0 +1,41 @@ + array( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'type' => 'grav-plugin', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'reference' => '435d66f673904945450ba0f04add1a4b765abe7b', + 'name' => 'trilbymedia/page-toc', + 'dev' => true, + ), + 'versions' => array( + 'cocur/slugify' => array( + 'pretty_version' => 'v4.0.0', + 'version' => '4.0.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../cocur/slugify', + 'aliases' => array(), + 'reference' => '3f1ffc300f164f23abe8b64ffb3f92d35cec8307', + 'dev_requirement' => false, + ), + 'knplabs/knp-menu' => array( + 'pretty_version' => 'v3.3.0', + 'version' => '3.3.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../knplabs/knp-menu', + 'aliases' => array(), + 'reference' => '8bd3dc2afa22c65617c563c5e25e62d6e23e98c7', + 'dev_requirement' => false, + ), + 'trilbymedia/page-toc' => array( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'type' => 'grav-plugin', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'reference' => '435d66f673904945450ba0f04add1a4b765abe7b', + 'dev_requirement' => false, + ), + ), +); diff --git a/plugins/page-toc/vendor/composer/platform_check.php b/plugins/page-toc/vendor/composer/platform_check.php new file mode 100644 index 0000000..0109125 --- /dev/null +++ b/plugins/page-toc/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 70306)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.3.6". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/plugins/page-toc/vendor/composer/tmp-f711f3efca8baf836db7f0f0b18aef94~ b/plugins/page-toc/vendor/composer/tmp-f711f3efca8baf836db7f0f0b18aef94~ new file mode 100644 index 0000000..629caa1 --- /dev/null +++ b/plugins/page-toc/vendor/composer/tmp-f711f3efca8baf836db7f0f0b18aef94~ @@ -0,0 +1 @@ +{"message":"Bad credentials","documentation_url":"https://docs.github.com/rest"} \ No newline at end of file diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/CHANGELOG.md b/plugins/page-toc/vendor/knplabs/knp-menu/CHANGELOG.md new file mode 100644 index 0000000..0166456 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/CHANGELOG.md @@ -0,0 +1,174 @@ +## 3.2 (2021-05-28) + +* Remove Symfony 6 deprecations +* Enforce phpstan rules (max level) + +## 3.1 (2019-12-01) + +* Allowed Symfony 5 components +* Removed support for unsupported Symfony versions (4.0 and 4.1) +* Allowed Twig 3 + +## 3.0 (2019-09-02) + +* Raised PHP requirements +* [BC break] Enforced strong types on all interfaces and classes +* [BC break] Removed deprecated features. Specifically, MenuFactory and MenuItem are not accepting a `null` name anymore + +## 2.4 (2019-07-29) + +* Fixed Twig deprecations +* Switched to namespaced Twig +* Fixed sprintf use + +## 2.3 (2017-11-18) + +* Deprecated the Silex 1 KnpMenuServiceProvider. Use the `knplabs/knp-menu-silex` package instead. +* Fixed RouteVoter to also match on non-string request arguments like integers as long as both string representations are identical. +* Add Symfony 4 support + +## 2.2 (2016-09-22) + +* Added a new function to twig: `knp_menu_get_current_item` + +## 2.1.1 (2016-01-08) + +* Made compatible with Symfony 3 + +## 2.1.0 (2015-09-20) + +* Added a new function to twig: `knp_menu_get_breadcrumbs_array` +* Added a new filter to twig: `knp_menu_as_string` +* Added 2 new tests to twig: `knp_menu_current`, `knp_menu_ancestor` +* Made the templates compatible with Twig 2 +* Add menu and renderer providers supporting any ArrayAccess implementations. The + Pimple-based providers (supporting only Pimple 1) are dperecated in favor of these + new providers. + +## 2.0.1 (2014-08-01) + +* Fixed voter conventions on RouteVoter + +## 2.0.0 (2014-07-18) + +* [BC break] Clean code and removed the BC layer + +## 2.0.0 beta 1 (2014-06-19) + +* [BC break] Added the new `Integration` namespace and removed the `Silex` one. +* Added a new Voter based on regular expression: `Knp\Menu\Matcher\Voter\RegexVoter` + +## 2.0.0 alpha 2 (2014-05-01) + +* [BC break] Changed the TwigRenderer to accept a menu template only as a string +* [BC break] Refactored the way of rendering twig templates. Every template should extends + the `knp_menu.html.twig` template. +* Introduced extension points in the MenuFactory through `Knp\Menu\Factory\ExtensionInterface` +* [BC break compared to 2.0 alpha 1] The inheritance extension points introduced in alpha1 are + deprecated in favor of extensions and will be removed before the stable release. +* `Knp\Menu\Silex\RouterAwareFactory` is deprecated in favor of `Knp\Menu\Silex\RoutingExtension`. +* [BC break] Deprecated the methods `createFromArray` and `createFromNode` in the MenuFactory and + removed them from `Knp\Menu\FactoryInterface`. Use `Knp\Menu\Loader\ArrayLoader` and + `Knp\Menu\Loader\NodeLoader` instead. +* [BC break] Deprecated the methods `moveToPosition`, `moveToFirstPosition`, `moveToLastPosition`, + `moveChildToPosition`, `callRecursively`, `toArray`, `getPathAsString` and `getBreadcrumbsArray` + in the MenuItem and removed them from `Knp\Menu\ItemInterface`. Use `Knp\Menu\Util\MenuManipulator` + instead. +* Made the RouterVoter compatible with SensioFrameworkExtraBundle param converters +* Added the possibility to match routes using a regex on their name in the RouterVoter +* [BC break compared to 2.0 alpha 1] Refactored the RouterVoter to make it more flexible + The way to pass routes in the item extras has changed. + + Before: + + ```php + 'extras' => array( + 'routes' => array('foo', 'bar'), + 'routeParameters' => array('foo' => array('id' => 4)), + ) + ``` + + After: + + ```php + 'extras' => array( + 'routes' => array( + array('route' => 'foo', 'parameters' => array('id' => 4)), + 'bar', + ) + ) + ``` + + The old syntax is kept until the final release, but using it will trigger a E_USER_DEPRECATED error. + +## 2.0.0 alpha 1 (2013-06-23) + +* Added protected methods `buildOptions` and `configureItem` in the MenuFactory as extension point by inheritance +* [BC break] Refactored the way to mark items as current + ``setCurrentUri``, ``getCurrentUri`` and ``getCurrentItem`` have been removed from the ItemInterface. + Determining the current items is now delegated to a matcher, and the default implementation + uses voters to apply the matching. Getting the current items can be done thanks to the CurrentItemFilterIterator. +* [BC break] The signature of the CurrentItemFilterIterator constructor changed to accept the item matcher +* [BC break] Changed the format of the breadcrumb array + Instead of storing the elements with the label as key and the uri as value + the array now stores an array of array elements with 3 keys: `label`, `uri` and `item`. + +## 1.1.2 (2012-06-10) + +* Updated the Silex service provider for the change in the interface + +## 1.1.1 (2012-05-17) + +* Added the children attributes and the extras in the array export + +## 1.1.0 (2012-05-17) + +* Marked `Knp\Menu\ItemInterface::getCurrentItem` as deprecated +* Added a recursive filter iterator keeping only displayed items +* Added a filter iterator keeping only current items +* Added a recursive iterator for the item +* Fixed building an array of breadcrumbs when a label has only digits +* Added a way to mark a label as safe +* Refactored the ListRenderer to be consistent with the TwigRenderer and provide the same extension points +* Added a way to attach extra data to an item +* Removed unnecessary optimization in the TwigRenderer +* Added some whitespace control in the Twig template to ensure an empty rendering is really empty +* [BC break] Use the childrenAttributes for the root instead of the attributes +* Made the default options configurable for the TwigRenderer +* Added the support for menu registered as factory in PimpleProvider +* Added a way to use the options in `knp_menu_get()` in Twig templates +* Added an array of options for the MenuProviderInterface +* Added a template to render an ordered list +* Refactored the template a bit to make it easier to use an ordered list +* Allow omitting the name of the child in `fromArray` (the key is used instead) + +## 1.0.0 (2011-12-03) + +* Add composer.json file +* Added more flexible list element blocks +* Add support for attributes on the children collection. +* Added a default renderer +* Added a ChainProvider for the menus. +* Added the Silex extension +* Added a RouterAwareFactory +* Added an helper to be able to reuse the logic more easily for other templating engines +* Added a way to retrieve an item using a path in a menu tree +* Changed the toArray method to use a depth instead of simply using a boolean flag +* Refactored the export to array and the creation from an array +* Added better support for encoding problems when escaping a string in the ListRenderer +* Added a Twig renderer +* Added missing escaping in the ListRenderer +* Renamed some methods in the ItemInterface +* Removed the configuration of the current item as link from the item +* Refactored the ListRenderer to use options +* Changed the interface of callRecursively +* Refactored the NodeInterface to be consistent +* Moved the creation of the item to the factory +* Added a Twig extension to render the menu easily +* Changed the menu provider interface with a pimple-based implementation +* Added a renderer provider to get a renderer by name and a Pimple-based implementation +* Removed the renderer from the menu +* Removed the num in the item by refactoring isLast and isFirst +* Changed the RendererInterface to accept an array of options to be more flexible +* Added an ItemInterface +* Initial import of KnpMenuBundle decoupled classes with a new namespace diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/LICENSE b/plugins/page-toc/vendor/knplabs/knp-menu/LICENSE new file mode 100644 index 0000000..0cc2c38 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011-present KnpLabs - https://knplabs.com + +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. diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/composer.json b/plugins/page-toc/vendor/knplabs/knp-menu/composer.json new file mode 100644 index 0000000..b50ad8b --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/composer.json @@ -0,0 +1,52 @@ +{ + "name": "knplabs/knp-menu", + "type": "library", + "description": "An object oriented menu library", + "keywords": ["menu", "tree"], + "homepage": "https://knplabs.com", + "license": "MIT", + "authors": [ + { + "name": "KnpLabs", + "homepage": "https://knplabs.com" + }, + { + "name": "Christophe Coevoet", + "email": "stof@notk.org" + }, + { + "name": "The Community", + "homepage": "https://github.com/KnpLabs/KnpMenu/contributors" + } + ], + "require": { + "php": "^7.3 || ^8.0" + }, + "conflict": { + "twig/twig": "<1.40 || >=2,<2.9" + }, + "require-dev": { + "phpunit/phpunit": "^9.5", + "psr/container": "^1.0", + "symfony/http-foundation": "^4.4 || ^5.0 || ^6.0", + "symfony/phpunit-bridge": "^5.3", + "symfony/routing": "^4.4 || ^5.0 || ^6.0", + "twig/twig": "^1.40 || ^2.9 || ^3.0" + }, + "suggest": { + "twig/twig": "for the TwigRenderer and the integration with your templates" + }, + "autoload": { + "psr-4": { "Knp\\Menu\\": "src/Knp/Menu" } + }, + "autoload-dev": { + "psr-4": { + "Knp\\Menu\\Tests\\": "tests/Knp/Menu/Tests" + } + }, + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Factory/CoreExtension.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Factory/CoreExtension.php new file mode 100644 index 0000000..8cf1735 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Factory/CoreExtension.php @@ -0,0 +1,62 @@ + null, + 'label' => null, + 'attributes' => [], + 'linkAttributes' => [], + 'childrenAttributes' => [], + 'labelAttributes' => [], + 'extras' => [], + 'current' => null, + 'display' => true, + 'displayChildren' => true, + ], + $options + ); + } + + public function buildItem(ItemInterface $item, array $options): void + { + $item + ->setUri($options['uri']) + ->setLabel($options['label']) + ->setAttributes($options['attributes']) + ->setLinkAttributes($options['linkAttributes']) + ->setChildrenAttributes($options['childrenAttributes']) + ->setLabelAttributes($options['labelAttributes']) + ->setCurrent($options['current']) + ->setDisplay($options['display']) + ->setDisplayChildren($options['displayChildren']) + ; + + $this->buildExtras($item, $options); + } + + /** + * Configures the newly created item's extras + * Extras are processed one by one in order not to reset values set by other extensions + * + * @param array> $options + */ + private function buildExtras(ItemInterface $item, array $options): void + { + if (!empty($options['extras'])) { + foreach ($options['extras'] as $key => $value) { + $item->setExtra($key, $value); + } + } + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Factory/ExtensionInterface.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Factory/ExtensionInterface.php new file mode 100644 index 0000000..5b764c2 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Factory/ExtensionInterface.php @@ -0,0 +1,24 @@ + $options The options processed by the previous extensions + * + * @return array + */ + public function buildOptions(array $options): array; + + /** + * Configures the item with the passed options + * + * @param array $options + */ + public function buildItem(ItemInterface $item, array $options): void; +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/FactoryInterface.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/FactoryInterface.php new file mode 100644 index 0000000..c4a292b --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/FactoryInterface.php @@ -0,0 +1,16 @@ + $options + */ + public function createItem(string $name, array $options = []): ItemInterface; +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Integration/Symfony/RoutingExtension.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Integration/Symfony/RoutingExtension.php new file mode 100644 index 0000000..7f7902f --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Integration/Symfony/RoutingExtension.php @@ -0,0 +1,44 @@ +generator = $generator; + } + + public function buildOptions(array $options = []): array + { + if (!empty($options['route'])) { + $params = $options['routeParameters'] ?? []; + $absolute = (isset($options['routeAbsolute']) && $options['routeAbsolute']) ? UrlGeneratorInterface::ABSOLUTE_URL : UrlGeneratorInterface::ABSOLUTE_PATH; + $options['uri'] = $this->generator->generate($options['route'], $params, $absolute); + + // adding the item route to the extras under the 'routes' key (for the Silex RouteVoter) + $options['extras']['routes'][] = [ + 'route' => $options['route'], + 'parameters' => $params, + ]; + } + + return $options; + } + + public function buildItem(ItemInterface $item, array $options): void + { + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/ItemInterface.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/ItemInterface.php new file mode 100644 index 0000000..a73d6e2 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/ItemInterface.php @@ -0,0 +1,333 @@ + tag and is what you should interact with + * most of the time by default. + * Originally taken from ioMenuPlugin (http://github.com/weaverryan/ioMenuPlugin) + * + * @extends \ArrayAccess + * @extends \IteratorAggregate + */ +interface ItemInterface extends \ArrayAccess, \Countable, \IteratorAggregate +{ + public function setFactory(FactoryInterface $factory): self; + + public function getName(): string; + + /** + * Renames the item. + * + * This method must also update the key in the parent. + * + * Provides a fluent interface + * + * @throws \InvalidArgumentException if the name is already used by a sibling + */ + public function setName(string $name): self; + + /** + * Get the uri for a menu item + */ + public function getUri(): ?string; + + /** + * Set the uri for a menu item + * + * Provides a fluent interface + * + * @param string|null $uri The uri to set on this menu item + */ + public function setUri(?string $uri): self; + + /** + * Returns the label that will be used to render this menu item + * + * Defaults to the name of no label was specified + */ + public function getLabel(): string; + + /** + * Provides a fluent interface + * + * @param string|null $label The text to use when rendering this menu item + */ + public function setLabel(?string $label): self; + + /** + * @return array + */ + public function getAttributes(): array; + + /** + * @param array $attributes + */ + public function setAttributes(array $attributes): self; + + /** + * @param string $name The name of the attribute to return + * @param string|bool|null $default The value to return if the attribute doesn't exist + * + * @return string|bool|null + */ + public function getAttribute(string $name, $default = null); + + /** + * @param string|bool|null $value + */ + public function setAttribute(string $name, $value): self; + + /** + * @return array + */ + public function getLinkAttributes(): array; + + /** + * @param array $linkAttributes + */ + public function setLinkAttributes(array $linkAttributes): self; + + /** + * @param string $name The name of the attribute to return + * @param string|bool|null $default The value to return if the attribute doesn't exist + * + * @return string|bool|null + */ + public function getLinkAttribute(string $name, $default = null); + + /** + * @param string|bool|null $value + */ + public function setLinkAttribute(string $name, $value): self; + + /** + * @return array + */ + public function getChildrenAttributes(): array; + + /** + * @param array $childrenAttributes + */ + public function setChildrenAttributes(array $childrenAttributes): self; + + /** + * @param string $name The name of the attribute to return + * @param string|bool|null $default The value to return if the attribute doesn't exist + * + * @return string|bool|null + */ + public function getChildrenAttribute(string $name, $default = null); + + /** + * @param string|bool|null $value + */ + public function setChildrenAttribute(string $name, $value): self; + + /** + * @return array + */ + public function getLabelAttributes(): array; + + /** + * @param array $labelAttributes + */ + public function setLabelAttributes(array $labelAttributes): self; + + /** + * @param string $name The name of the attribute to return + * @param string|bool|null $default The value to return if the attribute doesn't exist + * + * @return string|bool|null + */ + public function getLabelAttribute(string $name, $default = null); + + /** + * @param string|bool|null $value + */ + public function setLabelAttribute(string $name, $value): self; + + /** + * @return array + */ + public function getExtras(): array; + + /** + * @param array $extras + */ + public function setExtras(array $extras): self; + + /** + * @param string $name The name of the extra to return + * @param mixed $default The value to return if the extra doesn't exist + * + * @return mixed + */ + public function getExtra(string $name, $default = null); + + /** + * @param mixed $value + */ + public function setExtra(string $name, $value): self; + + public function getDisplayChildren(): bool; + + /** + * Set whether or not this menu item should show its children + * + * Provides a fluent interface + */ + public function setDisplayChildren(bool $bool): self; + + /** + * Whether or not to display this menu item + */ + public function isDisplayed(): bool; + + /** + * Set whether or not this menu should be displayed + * + * Provides a fluent interface + */ + public function setDisplay(bool $bool): self; + + /** + * Add a child menu item to this menu + * + * Returns the child item + * + * @param ItemInterface|string $child An ItemInterface instance or the name of a new item to create + * @param array $options If creating a new item, the options passed to the factory for the item + * + * @throws \InvalidArgumentException if the item is already in a tree + */ + public function addChild($child, array $options = []): self; + + /** + * Returns the child menu identified by the given name + * + * @param string $name Then name of the child menu to return + */ + public function getChild(string $name): ?self; + + /** + * Reorder children. + * + * Provides a fluent interface + * + * @param array $order new order of children + */ + public function reorderChildren(array $order): self; + + /** + * Makes a deep copy of menu tree. Every item is copied as another object. + */ + public function copy(): self; + + /** + * Returns the level of this menu item + * + * The root menu item is 0, followed by 1, 2, etc + */ + public function getLevel(): int; + + /** + * Returns the root ItemInterface of this menu tree + */ + public function getRoot(): self; + + /** + * Returns whether or not this menu item is the root menu item + */ + public function isRoot(): bool; + + public function getParent(): ?self; + + /** + * Used internally when adding and removing children + * + * Provides a fluent interface + */ + public function setParent(?self $parent = null): self; + + /** + * Return the children as an array of ItemInterface objects + * + * @return array + */ + public function getChildren(): array; + + /** + * Provides a fluent interface + * + * @param array $children An array of ItemInterface objects + */ + public function setChildren(array $children): self; + + /** + * Removes a child from this menu item + * + * Provides a fluent interface + * + * @param ItemInterface|string $name The name of ItemInterface instance or the ItemInterface to remove + */ + public function removeChild($name): self; + + public function getFirstChild(): self; + + public function getLastChild(): self; + + /** + * Returns whether or not this menu items has viewable children + * + * This menu MAY have children, but this will return false if the current + * user does not have access to view any of those items + */ + public function hasChildren(): bool; + + /** + * Sets whether or not this menu item is "current". + * + * If the state is unknown, use null. + * + * Provides a fluent interface + * + * @param bool|null $bool Specify that this menu item is current + */ + public function setCurrent(?bool $bool): self; + + /** + * Gets whether or not this menu item is "current". + */ + public function isCurrent(): ?bool; + + /** + * Whether this menu item is last in its parent + */ + public function isLast(): bool; + + /** + * Whether this menu item is first in its parent + */ + public function isFirst(): bool; + + /** + * Whereas isFirst() returns if this is the first child of the parent + * menu item, this function takes into consideration whether children are rendered or not. + * + * This returns true if this is the first child that would be rendered + * for the current user + */ + public function actsLikeFirst(): bool; + + /** + * Whereas isLast() returns if this is the last child of the parent + * menu item, this function takes into consideration whether children are rendered or not. + * + * This returns true if this is the last child that would be rendered + * for the current user + */ + public function actsLikeLast(): bool; +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Iterator/CurrentItemFilterIterator.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Iterator/CurrentItemFilterIterator.php new file mode 100644 index 0000000..9da8427 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Iterator/CurrentItemFilterIterator.php @@ -0,0 +1,35 @@ + $iterator + */ + public function __construct(\Iterator $iterator, MatcherInterface $matcher) + { + $this->matcher = $matcher; + + parent::__construct($iterator); + } + + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function accept() + { + return $this->matcher->isCurrent($this->current()); + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Iterator/DisplayedItemFilterIterator.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Iterator/DisplayedItemFilterIterator.php new file mode 100644 index 0000000..1b8a0f9 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Iterator/DisplayedItemFilterIterator.php @@ -0,0 +1,27 @@ +current()->isDisplayed(); + } + + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function hasChildren() + { + return $this->current()->getDisplayChildren() && parent::hasChildren(); + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Iterator/RecursiveItemIterator.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Iterator/RecursiveItemIterator.php new file mode 100644 index 0000000..6969af8 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Iterator/RecursiveItemIterator.php @@ -0,0 +1,33 @@ +> + */ +class RecursiveItemIterator extends \IteratorIterator implements \RecursiveIterator +{ + /** + * @param \Traversable $iterator + */ + final public function __construct(\Traversable $iterator) + { + parent::__construct($iterator); + } + + public function hasChildren(): bool + { + return 0 < \count($this->current()); + } + + /** + * @return \RecursiveIterator + */ + #[\ReturnTypeWillChange] + public function getChildren() + { + return new static($this->current()); + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Loader/ArrayLoader.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Loader/ArrayLoader.php new file mode 100644 index 0000000..e1e2109 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Loader/ArrayLoader.php @@ -0,0 +1,62 @@ +factory = $factory; + } + + public function load($data): ItemInterface + { + if (!$this->supports($data)) { + throw new \InvalidArgumentException(\sprintf('Unsupported data. Expected an array but got %s', \is_object($data) ? \get_class($data) : \gettype($data))); + } + + return $this->fromArray($data); + } + + public function supports($data): bool + { + return \is_array($data); + } + + /** + * @param array $data + * @param string|null $name (the name of the item, used only if there is no name in the data themselves) + */ + private function fromArray(array $data, ?string $name = null): ItemInterface + { + $name = $data['name'] ?? $name; + + if (isset($data['children'])) { + $children = $data['children']; + unset($data['children']); + } else { + $children = []; + } + + $item = $this->factory->createItem($name, $data); + + foreach ($children as $childName => $child) { + $item->addChild($this->fromArray($child, $childName)); + } + + return $item; + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Loader/LoaderInterface.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Loader/LoaderInterface.php new file mode 100644 index 0000000..a2d9eec --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Loader/LoaderInterface.php @@ -0,0 +1,22 @@ +factory = $factory; + } + + public function load($data): ItemInterface + { + if (!$data instanceof NodeInterface) { + throw new \InvalidArgumentException(\sprintf('Unsupported data. Expected Knp\Menu\NodeInterface but got %s', \is_object($data) ? \get_class($data) : \gettype($data))); + } + + $item = $this->factory->createItem($data->getName(), $data->getOptions()); + + foreach ($data->getChildren() as $childNode) { + $item->addChild($this->load($childNode)); + } + + return $item; + } + + public function supports($data): bool + { + return $data instanceof NodeInterface; + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Matcher/Matcher.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Matcher/Matcher.php new file mode 100644 index 0000000..6835afa --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Matcher/Matcher.php @@ -0,0 +1,76 @@ + + */ + private $cache; + + /** + * @var iterable|VoterInterface[] + */ + private $voters; + + /** + * @param VoterInterface[]|iterable $voters + */ + public function __construct($voters = []) + { + $this->voters = $voters; + $this->cache = new \SplObjectStorage(); + } + + public function isCurrent(ItemInterface $item): bool + { + $current = $item->isCurrent(); + if (null !== $current) { + return $current; + } + + if ($this->cache->contains($item)) { + return $this->cache[$item]; + } + + foreach ($this->voters as $voter) { + $current = $voter->matchItem($item); + if (null !== $current) { + break; + } + } + + $current = (bool) $current; + $this->cache[$item] = $current; + + return $current; + } + + public function isAncestor(ItemInterface $item, ?int $depth = null): bool + { + if (0 === $depth) { + return false; + } + + $childDepth = null === $depth ? null : $depth - 1; + foreach ($item->getChildren() as $child) { + if ($this->isCurrent($child) || $this->isAncestor($child, $childDepth)) { + return true; + } + } + + return false; + } + + public function clear(): void + { + $this->cache = new \SplObjectStorage(); + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Matcher/MatcherInterface.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Matcher/MatcherInterface.php new file mode 100644 index 0000000..31e53ec --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Matcher/MatcherInterface.php @@ -0,0 +1,28 @@ +regexp = $regexp; + } + + public function matchItem(ItemInterface $item): ?bool + { + if (null === $this->regexp || null === $item->getUri()) { + return null; + } + + if (\preg_match($this->regexp, $item->getUri())) { + return true; + } + + return null; + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Matcher/Voter/RouteVoter.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Matcher/Voter/RouteVoter.php new file mode 100644 index 0000000..1026581 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Matcher/Voter/RouteVoter.php @@ -0,0 +1,94 @@ +requestStack = $requestStack; + } + + public function matchItem(ItemInterface $item): ?bool + { + if (\is_callable([$this->requestStack, 'getMainRequest'])) { + $request = $this->requestStack->getMainRequest(); // symfony 5.3+ + } else { + $request = $this->requestStack->getMasterRequest(); + } + + if (null === $request) { + return null; + } + + $route = $request->attributes->get('_route'); + if (null === $route) { + return null; + } + + $routes = (array) $item->getExtra('routes', []); + + foreach ($routes as $testedRoute) { + if (\is_string($testedRoute)) { + $testedRoute = ['route' => $testedRoute]; + } + + if (!\is_array($testedRoute)) { + throw new \InvalidArgumentException('Routes extra items must be strings or arrays.'); + } + + if ($this->isMatchingRoute($request, $testedRoute)) { + return true; + } + } + + return null; + } + + /** + * @phpstan-param array{route?: string|null, pattern?: string|null, parameters?: array} $testedRoute + */ + private function isMatchingRoute(Request $request, array $testedRoute): bool + { + $route = $request->attributes->get('_route'); + + if (isset($testedRoute['route'])) { + if ($route !== $testedRoute['route']) { + return false; + } + } elseif (!empty($testedRoute['pattern'])) { + if (!\preg_match($testedRoute['pattern'], $route)) { + return false; + } + } else { + throw new \InvalidArgumentException('Routes extra items must have a "route" or "pattern" key.'); + } + + if (!isset($testedRoute['parameters'])) { + return true; + } + + $routeParameters = $request->attributes->get('_route_params', []); + + foreach ($testedRoute['parameters'] as $name => $value) { + // cast both to string so that we handle integer and other non-string parameters, but don't stumble on 0 == 'abc'. + if (!isset($routeParameters[$name]) || (string) $routeParameters[$name] !== (string) $value) { + return false; + } + } + + return true; + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Matcher/Voter/UriVoter.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Matcher/Voter/UriVoter.php new file mode 100644 index 0000000..2358425 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Matcher/Voter/UriVoter.php @@ -0,0 +1,34 @@ +uri = $uri; + } + + public function matchItem(ItemInterface $item): ?bool + { + if (null === $this->uri || null === $item->getUri()) { + return null; + } + + if ($item->getUri() === $this->uri) { + return true; + } + + return null; + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Matcher/Voter/VoterInterface.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Matcher/Voter/VoterInterface.php new file mode 100644 index 0000000..5e319c1 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Matcher/Voter/VoterInterface.php @@ -0,0 +1,19 @@ +addExtension(new CoreExtension(), -10); + } + + public function createItem(string $name, array $options = []): ItemInterface + { + foreach ($this->getExtensions() as $extension) { + $options = $extension->buildOptions($options); + } + + $item = new MenuItem($name, $this); + + foreach ($this->getExtensions() as $extension) { + $extension->buildItem($item, $options); + } + + return $item; + } + + /** + * Adds a factory extension + */ + public function addExtension(ExtensionInterface $extension, int $priority = 0): void + { + $this->extensions[$priority][] = $extension; + $this->sorted = null; + } + + /** + * Sorts the internal list of extensions by priority. + * + * @return ExtensionInterface[] + */ + private function getExtensions(): array + { + if (null === $this->sorted) { + \krsort($this->extensions); + $this->sorted = !empty($this->extensions) ? \array_merge(...$this->extensions) : []; + } + + return $this->sorted; + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/MenuItem.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/MenuItem.php new file mode 100644 index 0000000..bbd8908 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/MenuItem.php @@ -0,0 +1,620 @@ + + */ + protected $linkAttributes = []; + + /** + * Attributes for the children list + * + * @var array + */ + protected $childrenAttributes = []; + + /** + * Attributes for the item text + * + * @var array + */ + protected $labelAttributes = []; + + /** + * Uri to use in the anchor tag + * + * @var string|null + */ + protected $uri; + + /** + * Attributes for the item + * + * @var array + */ + protected $attributes = []; + + /** + * Extra stuff associated to the item + * + * @var array + */ + protected $extras = []; + + /** + * Whether the item is displayed + * + * @var bool + */ + protected $display = true; + + /** + * Whether the children of the item are displayed + * + * @var bool + */ + protected $displayChildren = true; + + /** + * Child items + * + * @var array + */ + protected $children = []; + + /** + * Parent item + * + * @var ItemInterface|null + */ + protected $parent; + + /** + * whether the item is current. null means unknown + * + * @var bool|null + */ + protected $isCurrent; + + /** + * @var FactoryInterface + */ + protected $factory; + + /** + * Class constructor + * + * @param string $name The name of this menu, which is how its parent will + * reference it. Also used as label if label not specified + */ + public function __construct(string $name, FactoryInterface $factory) + { + $this->name = $name; + $this->factory = $factory; + } + + public function setFactory(FactoryInterface $factory): ItemInterface + { + $this->factory = $factory; + + return $this; + } + + public function getName(): string + { + return $this->name; + } + + public function setName(string $name): ItemInterface + { + if ($this->name === $name) { + return $this; + } + + $parent = $this->getParent(); + if (null !== $parent && isset($parent[$name])) { + throw new \InvalidArgumentException('Cannot rename item, name is already used by sibling.'); + } + + $oldName = $this->name; + $this->name = $name; + + if (null !== $parent) { + $names = \array_keys($parent->getChildren()); + $items = \array_values($parent->getChildren()); + + $offset = \array_search($oldName, $names); + $names[$offset] = $name; + + if (false === $children = \array_combine($names, $items)) { + throw new \InvalidArgumentException('Number of elements is not matching.'); + } + + $parent->setChildren($children); + } + + return $this; + } + + public function getUri(): ?string + { + return $this->uri; + } + + public function setUri(?string $uri): ItemInterface + { + $this->uri = $uri; + + return $this; + } + + public function getLabel(): string + { + return $this->label ?? $this->name; + } + + public function setLabel(?string $label): ItemInterface + { + $this->label = $label; + + return $this; + } + + public function getAttributes(): array + { + return $this->attributes; + } + + public function setAttributes(array $attributes): ItemInterface + { + $this->attributes = $attributes; + + return $this; + } + + public function getAttribute(string $name, $default = null) + { + return $this->attributes[$name] ?? $default; + } + + public function setAttribute(string $name, $value): ItemInterface + { + $this->attributes[$name] = $value; + + return $this; + } + + public function getLinkAttributes(): array + { + return $this->linkAttributes; + } + + public function setLinkAttributes(array $linkAttributes): ItemInterface + { + $this->linkAttributes = $linkAttributes; + + return $this; + } + + public function getLinkAttribute(string $name, $default = null) + { + return $this->linkAttributes[$name] ?? $default; + } + + public function setLinkAttribute(string $name, $value): ItemInterface + { + $this->linkAttributes[$name] = $value; + + return $this; + } + + public function getChildrenAttributes(): array + { + return $this->childrenAttributes; + } + + public function setChildrenAttributes(array $childrenAttributes): ItemInterface + { + $this->childrenAttributes = $childrenAttributes; + + return $this; + } + + public function getChildrenAttribute(string $name, $default = null) + { + return $this->childrenAttributes[$name] ?? $default; + } + + public function setChildrenAttribute(string $name, $value): ItemInterface + { + $this->childrenAttributes[$name] = $value; + + return $this; + } + + public function getLabelAttributes(): array + { + return $this->labelAttributes; + } + + public function setLabelAttributes(array $labelAttributes): ItemInterface + { + $this->labelAttributes = $labelAttributes; + + return $this; + } + + public function getLabelAttribute(string $name, $default = null) + { + return $this->labelAttributes[$name] ?? $default; + } + + public function setLabelAttribute(string $name, $value): ItemInterface + { + $this->labelAttributes[$name] = $value; + + return $this; + } + + public function getExtras(): array + { + return $this->extras; + } + + public function setExtras(array $extras): ItemInterface + { + $this->extras = $extras; + + return $this; + } + + public function getExtra(string $name, $default = null) + { + return $this->extras[$name] ?? $default; + } + + public function setExtra(string $name, $value): ItemInterface + { + $this->extras[$name] = $value; + + return $this; + } + + public function getDisplayChildren(): bool + { + return $this->displayChildren; + } + + public function setDisplayChildren(bool $bool): ItemInterface + { + $this->displayChildren = $bool; + + return $this; + } + + public function isDisplayed(): bool + { + return $this->display; + } + + public function setDisplay(bool $bool): ItemInterface + { + $this->display = $bool; + + return $this; + } + + public function addChild($child, array $options = []): ItemInterface + { + if (!$child instanceof ItemInterface) { + $child = $this->factory->createItem($child, $options); + } elseif (null !== $child->getParent()) { + throw new \InvalidArgumentException('Cannot add menu item as child, it already belongs to another menu (e.g. has a parent).'); + } + + $child->setParent($this); + + $this->children[$child->getName()] = $child; + + return $child; + } + + public function getChild(string $name): ?ItemInterface + { + return $this->children[$name] ?? null; + } + + public function reorderChildren(array $order): ItemInterface + { + if (\count($order) !== $this->count()) { + throw new \InvalidArgumentException('Cannot reorder children, order does not contain all children.'); + } + + $newChildren = []; + + foreach ($order as $name) { + if (!isset($this->children[$name])) { + throw new \InvalidArgumentException('Cannot find children named '.$name); + } + + $child = $this->children[$name]; + $newChildren[$name] = $child; + } + + $this->setChildren($newChildren); + + return $this; + } + + public function copy(): ItemInterface + { + $newMenu = clone $this; + $newMenu->setChildren([]); + $newMenu->setParent(); + foreach ($this->getChildren() as $child) { + $newMenu->addChild($child->copy()); + } + + return $newMenu; + } + + public function getLevel(): int + { + return $this->parent ? $this->parent->getLevel() + 1 : 0; + } + + public function getRoot(): ItemInterface + { + $obj = $this; + do { + $found = $obj; + } while ($obj = $obj->getParent()); + + return $found; + } + + public function isRoot(): bool + { + return null === $this->parent; + } + + public function getParent(): ?ItemInterface + { + return $this->parent; + } + + public function setParent(?ItemInterface $parent = null): ItemInterface + { + if ($parent === $this) { + throw new \InvalidArgumentException('Item cannot be a child of itself'); + } + + $this->parent = $parent; + + return $this; + } + + public function getChildren(): array + { + return $this->children; + } + + public function setChildren(array $children): ItemInterface + { + $this->children = $children; + + return $this; + } + + public function removeChild($name): ItemInterface + { + $name = $name instanceof ItemInterface ? $name->getName() : $name; + + if (isset($this->children[$name])) { + // unset the child and reset it so it looks independent + $this->children[$name]->setParent(null); + unset($this->children[$name]); + } + + return $this; + } + + public function getFirstChild(): ItemInterface + { + if (empty($this->children)) { + throw new \LogicException('Cannot get first child: there are no children.'); + } + + return \reset($this->children); + } + + public function getLastChild(): ItemInterface + { + if (empty($this->children)) { + throw new \LogicException('Cannot get last child: there are no children.'); + } + + return \end($this->children); + } + + public function hasChildren(): bool + { + foreach ($this->children as $child) { + if ($child->isDisplayed()) { + return true; + } + } + + return false; + } + + public function setCurrent(?bool $bool): ItemInterface + { + $this->isCurrent = $bool; + + return $this; + } + + public function isCurrent(): ?bool + { + return $this->isCurrent; + } + + public function isLast(): bool + { + // if this is root, then return false + if (null === $this->parent) { + return false; + } + + return $this->parent->getLastChild() === $this; + } + + public function isFirst(): bool + { + // if this is root, then return false + if (null === $this->parent) { + return false; + } + + return $this->parent->getFirstChild() === $this; + } + + public function actsLikeFirst(): bool + { + // root items are never "marked" as first + if (null === $this->parent) { + return false; + } + + // A menu acts like first only if it is displayed + if (!$this->isDisplayed()) { + return false; + } + + // if we're first and visible, we're first, period. + if ($this->isFirst()) { + return true; + } + + $children = $this->parent->getChildren(); + foreach ($children as $child) { + // loop until we find a visible menu. If its this menu, we're first + if ($child->isDisplayed()) { + return $child->getName() === $this->getName(); + } + } + + return false; + } + + public function actsLikeLast(): bool + { + // root items are never "marked" as last + if (null === $this->parent) { + return false; + } + + // A menu acts like last only if it is displayed + if (!$this->isDisplayed()) { + return false; + } + + // if we're last and visible, we're last, period. + if ($this->isLast()) { + return true; + } + + $children = \array_reverse($this->parent->getChildren()); + foreach ($children as $child) { + // loop until we find a visible menu. If its this menu, we're first + if ($child->isDisplayed()) { + return $child->getName() === $this->getName(); + } + } + + return false; + } + + /** + * Implements Countable + */ + public function count(): int + { + return \count($this->children); + } + + /** + * Implements IteratorAggregate + */ + public function getIterator(): \Traversable + { + return new \ArrayIterator($this->children); + } + + /** + * Implements ArrayAccess + * + * @param string $offset + */ + public function offsetExists($offset): bool + { + return isset($this->children[$offset]); + } + + /** + * Implements ArrayAccess + * + * @param string $offset + * + * @return ItemInterface|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->getChild($offset); + } + + /** + * Implements ArrayAccess + * + * @param string $offset + * @param string|null $value + */ + public function offsetSet($offset, $value): void + { + $this->addChild($offset)->setLabel($value); + } + + /** + * Implements ArrayAccess + * + * @param string $offset + */ + public function offsetUnset($offset): void + { + $this->removeChild($offset); + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/NodeInterface.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/NodeInterface.php new file mode 100644 index 0000000..59a9e63 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/NodeInterface.php @@ -0,0 +1,30 @@ + + */ + public function getOptions(): array; + + /** + * Get the child nodes implementing NodeInterface + * + * @return \Traversable + */ + public function getChildren(): \Traversable; +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Provider/ArrayAccessProvider.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Provider/ArrayAccessProvider.php new file mode 100644 index 0000000..a25a855 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Provider/ArrayAccessProvider.php @@ -0,0 +1,55 @@ + + */ + private $registry; + + /** + * @var array + */ + private $menuIds; + + /** + * @param \ArrayAccess $registry + * @param array $menuIds The map between menu identifiers and registry keys + */ + public function __construct(\ArrayAccess $registry, array $menuIds = []) + { + $this->registry = $registry; + $this->menuIds = $menuIds; + } + + public function get(string $name, array $options = []): ItemInterface + { + if (!isset($this->menuIds[$name])) { + throw new \InvalidArgumentException(\sprintf('The menu "%s" is not defined.', $name)); + } + + $menu = $this->registry[$this->menuIds[$name]]; + + if (\is_callable($menu)) { + $menu = $menu($options, $this->registry); + } + + return $menu; + } + + public function has(string $name, array $options = []): bool + { + return isset($this->menuIds[$name]); + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Provider/ChainProvider.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Provider/ChainProvider.php new file mode 100644 index 0000000..2caa253 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Provider/ChainProvider.php @@ -0,0 +1,43 @@ +providers = $providers; + } + + public function get(string $name, array $options = []): ItemInterface + { + foreach ($this->providers as $provider) { + if ($provider->has($name, $options)) { + return $provider->get($name, $options); + } + } + + throw new \InvalidArgumentException(\sprintf('The menu "%s" is not defined.', $name)); + } + + public function has(string $name, array $options = []): bool + { + foreach ($this->providers as $provider) { + if ($provider->has($name, $options)) { + return true; + } + } + + return false; + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Provider/LazyProvider.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Provider/LazyProvider.php new file mode 100644 index 0000000..3865555 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Provider/LazyProvider.php @@ -0,0 +1,52 @@ + + */ + private $builders; + + /** + * @phpstan-param array $builders + */ + public function __construct(array $builders) + { + $this->builders = $builders; + } + + public function get(string $name, array $options = []): ItemInterface + { + if (!isset($this->builders[$name])) { + throw new \InvalidArgumentException(\sprintf('The menu "%s" is not defined.', $name)); + } + + $builder = $this->builders[$name]; + + if (\is_array($builder) && isset($builder[0]) && $builder[0] instanceof \Closure) { + $builder[0] = $builder[0](); + } + + if (!\is_callable($builder)) { + throw new \LogicException(\sprintf('Invalid menu builder for "%s". A callable or a factory for an object callable are expected.', $name)); + } + + return $builder($options); + } + + public function has(string $name, array $options = []): bool + { + return isset($this->builders[$name]); + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Provider/MenuProviderInterface.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Provider/MenuProviderInterface.php new file mode 100644 index 0000000..f6ceb21 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Provider/MenuProviderInterface.php @@ -0,0 +1,24 @@ + $options + * + * @throws \InvalidArgumentException if the menu does not exists + */ + public function get(string $name, array $options = []): ItemInterface; + + /** + * Checks whether a menu exists in this provider + * + * @param array $options + */ + public function has(string $name, array $options = []): bool; +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Provider/PsrProvider.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Provider/PsrProvider.php new file mode 100644 index 0000000..dd3761f --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Provider/PsrProvider.php @@ -0,0 +1,39 @@ +container = $container; + } + + public function get(string $name, array $options = []): ItemInterface + { + if (!$this->container->has($name)) { + throw new \InvalidArgumentException(\sprintf('The menu "%s" is not defined.', $name)); + } + + return $this->container->get($name); + } + + public function has(string $name, array $options = []): bool + { + return $this->container->has($name); + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/ArrayAccessProvider.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/ArrayAccessProvider.php new file mode 100644 index 0000000..e460e59 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/ArrayAccessProvider.php @@ -0,0 +1,54 @@ + + */ + private $registry; + + /** + * @var array + */ + private $rendererIds; + + /** + * @var string + */ + private $defaultRenderer; + + /** + * @param \ArrayAccess $registry + * @param string $defaultRenderer The name of the renderer used by default + * @param array $rendererIds The map between renderer names and registry keys + */ + public function __construct(\ArrayAccess $registry, string $defaultRenderer, array $rendererIds) + { + $this->registry = $registry; + $this->rendererIds = $rendererIds; + $this->defaultRenderer = $defaultRenderer; + } + + public function get(?string $name = null): RendererInterface + { + if (null === $name) { + $name = $this->defaultRenderer; + } + + if (!isset($this->rendererIds[$name]) || null === $this->registry[$this->rendererIds[$name]]) { + throw new \InvalidArgumentException(\sprintf('The renderer "%s" is not defined.', $name)); + } + + return $this->registry[$this->rendererIds[$name]]; + } + + public function has(string $name): bool + { + return isset($this->rendererIds[$name]); + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/ListRenderer.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/ListRenderer.php new file mode 100644 index 0000000..36068f8 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/ListRenderer.php @@ -0,0 +1,260 @@ + + */ + protected $defaultOptions; + + /** + * @param array $defaultOptions + */ + public function __construct(MatcherInterface $matcher, array $defaultOptions = [], ?string $charset = null) + { + $this->matcher = $matcher; + $this->defaultOptions = \array_merge([ + 'depth' => null, + 'matchingDepth' => null, + 'currentAsLink' => true, + 'currentClass' => 'current', + 'ancestorClass' => 'current_ancestor', + 'firstClass' => 'first', + 'lastClass' => 'last', + 'compressed' => false, + 'allow_safe_labels' => false, + 'clear_matcher' => true, + 'leaf_class' => null, + 'branch_class' => null, + ], $defaultOptions); + + parent::__construct($charset); + } + + public function render(ItemInterface $item, array $options = []): string + { + $options = \array_merge($this->defaultOptions, $options); + + $html = $this->renderList($item, $item->getChildrenAttributes(), $options); + + if ($options['clear_matcher']) { + $this->matcher->clear(); + } + + return $html; + } + + /** + * @param array $attributes + * @param array $options + */ + protected function renderList(ItemInterface $item, array $attributes, array $options): string + { + /* + * Return an empty string if any of the following are true: + * a) The menu has no children eligible to be displayed + * b) The depth is 0 + * c) This menu item has been explicitly set to hide its children + */ + if (0 === $options['depth'] || !$item->hasChildren() || !$item->getDisplayChildren()) { + return ''; + } + + $html = $this->format('renderHtmlAttributes($attributes).'>', 'ul', $item->getLevel(), $options); + $html .= $this->renderChildren($item, $options); + $html .= $this->format('', 'ul', $item->getLevel(), $options); + + return $html; + } + + /** + * Renders all of the children of this menu. + * + * This calls ->renderItem() on each menu item, which instructs each + * menu item to render themselves as an
  • tag (with nested ul if it + * has children). + * This method updates the depth for the children. + * + * @param array $options the options to render the item + */ + protected function renderChildren(ItemInterface $item, array $options): string + { + // render children with a depth - 1 + if (null !== $options['depth']) { + --$options['depth']; + } + + if (null !== $options['matchingDepth'] && $options['matchingDepth'] > 0) { + --$options['matchingDepth']; + } + + $html = ''; + foreach ($item->getChildren() as $child) { + $html .= $this->renderItem($child, $options); + } + + return $html; + } + + /** + * Called by the parent menu item to render this menu. + * + * This renders the li tag to fit into the parent ul as well as its + * own nested ul tag if this menu item has children + * + * @param array $options The options to render the item + */ + protected function renderItem(ItemInterface $item, array $options): string + { + // if we don't have access or this item is marked to not be shown + if (!$item->isDisplayed()) { + return ''; + } + + // create an array than can be imploded as a class list + $class = (array) $item->getAttribute('class'); + + if ($this->matcher->isCurrent($item)) { + $class[] = $options['currentClass']; + } elseif ($this->matcher->isAncestor($item, $options['matchingDepth'])) { + $class[] = $options['ancestorClass']; + } + + if ($item->actsLikeFirst()) { + $class[] = $options['firstClass']; + } + if ($item->actsLikeLast()) { + $class[] = $options['lastClass']; + } + + if (0 !== $options['depth'] && $item->hasChildren()) { + if (null !== $options['branch_class'] && $item->getDisplayChildren()) { + $class[] = $options['branch_class']; + } + } elseif (null !== $options['leaf_class']) { + $class[] = $options['leaf_class']; + } + + // retrieve the attributes and put the final class string back on it + $attributes = $item->getAttributes(); + if (!empty($class)) { + $attributes['class'] = \implode(' ', $class); + } + + // opening li tag + $html = $this->format('renderHtmlAttributes($attributes).'>', 'li', $item->getLevel(), $options); + + // render the text/link inside the li tag + //$html .= $this->format($item->getUri() ? $item->renderLink() : $item->renderLabel(), 'link', $item->getLevel()); + $html .= $this->renderLink($item, $options); + + // renders the embedded ul + $childrenClass = (array) $item->getChildrenAttribute('class'); + $childrenClass[] = 'menu_level_'.$item->getLevel(); + + $childrenAttributes = $item->getChildrenAttributes(); + $childrenAttributes['class'] = \implode(' ', $childrenClass); + + $html .= $this->renderList($item, $childrenAttributes, $options); + + // closing li tag + $html .= $this->format('
  • ', 'li', $item->getLevel(), $options); + + return $html; + } + + /** + * Renders the link in a a tag with link attributes or + * the label in a span tag with label attributes + * + * Tests if item has a an uri and if not tests if it's + * the current item and if the text has to be rendered + * as a link or not. + * + * @param ItemInterface $item The item to render the link or label for + * @param array $options The options to render the item + */ + protected function renderLink(ItemInterface $item, array $options = []): string + { + if (null !== $item->getUri() && (!$this->matcher->isCurrent($item) || $options['currentAsLink'])) { + $text = $this->renderLinkElement($item, $options); + } else { + $text = $this->renderSpanElement($item, $options); + } + + return $this->format($text, 'link', $item->getLevel(), $options); + } + + /** + * @param array $options + */ + protected function renderLinkElement(ItemInterface $item, array $options): string + { + \assert(null !== $item->getUri()); + + return \sprintf('%s', $this->escape($item->getUri()), $this->renderHtmlAttributes($item->getLinkAttributes()), $this->renderLabel($item, $options)); + } + + /** + * @param array $options + */ + protected function renderSpanElement(ItemInterface $item, array $options): string + { + return \sprintf('%s', $this->renderHtmlAttributes($item->getLabelAttributes()), $this->renderLabel($item, $options)); + } + + /** + * @param array $options + */ + protected function renderLabel(ItemInterface $item, array $options): string + { + if ($options['allow_safe_labels'] && $item->getExtra('safe_label', false)) { + return $item->getLabel(); + } + + return $this->escape($item->getLabel()); + } + + /** + * If $this->renderCompressed is on, this will apply the necessary + * spacing and line-breaking so that the particular thing being rendered + * makes up its part in a fully-rendered and spaced menu. + * + * @param string $html The html to render in an (un)formatted way + * @param string $type The type [ul,link,li] of thing being rendered + * @param array $options + */ + protected function format(string $html, string $type, int $level, array $options): string + { + if ($options['compressed']) { + return $html; + } + + $spacing = 0; + + switch ($type) { + case 'ul': + case 'link': + $spacing = $level * 4; + break; + + case 'li': + $spacing = $level * 4 - 2; + } + + return \str_repeat(' ', $spacing).$html."\n"; + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/PsrProvider.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/PsrProvider.php new file mode 100644 index 0000000..0abdebd --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/PsrProvider.php @@ -0,0 +1,51 @@ +container = $container; + $this->defaultRenderer = $defaultRenderer; + } + + public function get(?string $name = null): RendererInterface + { + if (null === $name) { + $name = $this->defaultRenderer; + } + + if (!$this->container->has($name)) { + throw new \InvalidArgumentException(\sprintf('The renderer "%s" is not defined.', $name)); + } + + return $this->container->get($name); + } + + public function has(string $name): bool + { + return $this->container->has($name); + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/Renderer.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/Renderer.php new file mode 100644 index 0000000..e9f6c30 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/Renderer.php @@ -0,0 +1,100 @@ +charset = $charset; + } + } + + /** + * Renders a HTML attribute + * + * @param string|bool $value + */ + protected function renderHtmlAttribute(string $name, $value): string + { + if (true === $value) { + return \sprintf('%s="%s"', $name, $this->escape($name)); + } + if (false === $value) { + throw new \InvalidArgumentException('Value cannot be false.'); + } + + return \sprintf('%s="%s"', $name, $this->escape($value)); + } + + /** + * Renders HTML attributes + * + * @param array $attributes + */ + protected function renderHtmlAttributes(array $attributes): string + { + return \implode('', \array_map([$this, 'htmlAttributesCallback'], \array_keys($attributes), \array_values($attributes))); + } + + /** + * Prepares an attribute key and value for HTML representation. + * + * It removes empty attributes. + * + * @param string $name The attribute name + * @param string|bool|null $value The attribute value + * + * @return string the HTML representation of the HTML key attribute pair + */ + private function htmlAttributesCallback(string $name, $value): string + { + if (false === $value || null === $value) { + return ''; + } + + return ' '.$this->renderHtmlAttribute($name, $value); + } + + /** + * Escapes an HTML value + */ + protected function escape(string $value): string + { + return $this->fixDoubleEscape(\htmlspecialchars($value, \ENT_QUOTES | \ENT_SUBSTITUTE, $this->charset)); + } + + /** + * Fixes double escaped strings. + * + * @param string $escaped string to fix + * + * @return string A single escaped string + */ + protected function fixDoubleEscape(string $escaped): string + { + return (string) \preg_replace('/&([a-z]+|(#\d+)|(#x[\da-f]+));/i', '&$1;', $escaped); + } + + /** + * Get the HTML charset + */ + public function getCharset(): string + { + return $this->charset; + } + + /** + * Set the HTML charset + */ + public function setCharset(string $charset): void + { + $this->charset = $charset; + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/RendererInterface.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/RendererInterface.php new file mode 100644 index 0000000..1855c46 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/RendererInterface.php @@ -0,0 +1,27 @@ + $options some rendering options + */ + public function render(ItemInterface $item, array $options = []): string; +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/RendererProviderInterface.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/RendererProviderInterface.php new file mode 100644 index 0000000..9fe1d28 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/RendererProviderInterface.php @@ -0,0 +1,20 @@ + + */ + private $defaultOptions; + + /** + * @param array $defaultOptions + */ + public function __construct( + Environment $environment, + string $template, + MatcherInterface $matcher, + array $defaultOptions = [] + ) { + $this->environment = $environment; + $this->matcher = $matcher; + $this->defaultOptions = \array_merge([ + 'depth' => null, + 'matchingDepth' => null, + 'currentAsLink' => true, + 'currentClass' => 'current', + 'ancestorClass' => 'current_ancestor', + 'firstClass' => 'first', + 'lastClass' => 'last', + 'template' => $template, + 'compressed' => false, + 'allow_safe_labels' => false, + 'clear_matcher' => true, + 'leaf_class' => null, + 'branch_class' => null, + ], $defaultOptions); + } + + public function render(ItemInterface $item, array $options = []): string + { + $options = \array_merge($this->defaultOptions, $options); + + $html = $this->environment->render($options['template'], ['item' => $item, 'options' => $options, 'matcher' => $this->matcher]); + + if ($options['clear_matcher']) { + $this->matcher->clear(); + } + + return $html; + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views/knp_menu.html.twig b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views/knp_menu.html.twig new file mode 100644 index 0000000..0ac53f6 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views/knp_menu.html.twig @@ -0,0 +1,101 @@ +{% extends 'knp_menu_base.html.twig' %} + +{% macro attributes(attributes) %} +{% for name, value in attributes %} + {%- if value is not none and value is not same as(false) -%} + {{- ' %s="%s"'|format(name, value is same as(true) ? name|e : value|e)|raw -}} + {%- endif -%} +{%- endfor -%} +{% endmacro %} + +{% block compressed_root %} +{% apply spaceless %} +{{ block('root') }} +{% endapply %} +{% endblock %} + +{% block root %} +{% set listAttributes = item.childrenAttributes %} +{{ block('list') -}} +{% endblock %} + +{% block list %} +{% if item.hasChildren and options.depth is not same as(0) and item.displayChildren %} + {% import _self as knp_menu %} + + {{ block('children') }} + +{% endif %} +{% endblock %} + +{% block children %} +{# save current variables #} +{% set currentOptions = options %} +{% set currentItem = item %} +{# update the depth for children #} +{% if options.depth is not none %} +{% set options = options|merge({'depth': currentOptions.depth - 1}) %} +{% endif %} +{# update the matchingDepth for children #} +{% if options.matchingDepth is not none and options.matchingDepth > 0 %} +{% set options = options|merge({'matchingDepth': currentOptions.matchingDepth - 1}) %} +{% endif %} +{% for item in currentItem.children %} + {{ block('item') }} +{% endfor %} +{# restore current variables #} +{% set item = currentItem %} +{% set options = currentOptions %} +{% endblock %} + +{% block item %} +{% if item.displayed %} +{# building the class of the item #} + {%- set classes = item.attribute('class') is not empty ? [item.attribute('class')] : [] %} + {%- if matcher.isCurrent(item) %} + {%- set classes = classes|merge([options.currentClass]) %} + {%- elseif matcher.isAncestor(item, options.matchingDepth) %} + {%- set classes = classes|merge([options.ancestorClass]) %} + {%- endif %} + {%- if item.actsLikeFirst %} + {%- set classes = classes|merge([options.firstClass]) %} + {%- endif %} + {%- if item.actsLikeLast %} + {%- set classes = classes|merge([options.lastClass]) %} + {%- endif %} + + {# Mark item as "leaf" (no children) or as "branch" (has children that are displayed) #} + {% if item.hasChildren and options.depth is not same as(0) %} + {% if options.branch_class is not empty and item.displayChildren %} + {%- set classes = classes|merge([options.branch_class]) %} + {% endif %} + {% elseif options.leaf_class is not empty %} + {%- set classes = classes|merge([options.leaf_class]) %} + {%- endif %} + + {%- set attributes = item.attributes %} + {%- if classes is not empty %} + {%- set attributes = attributes|merge({'class': classes|join(' ')}) %} + {%- endif %} +{# displaying the item #} + {% import _self as knp_menu %} + + {%- if item.uri is not empty and (not matcher.isCurrent(item) or options.currentAsLink) %} + {{ block('linkElement') }} + {%- else %} + {{ block('spanElement') }} + {%- endif %} +{# render the list of children#} + {%- set childrenClasses = item.childrenAttribute('class') is not empty ? [item.childrenAttribute('class')] : [] %} + {%- set childrenClasses = childrenClasses|merge(['menu_level_' ~ item.level]) %} + {%- set listAttributes = item.childrenAttributes|merge({'class': childrenClasses|join(' ') }) %} + {{ block('list') }} + +{% endif %} +{% endblock %} + +{% block linkElement %}{% import _self as knp_menu %}{{ block('label') }}{% endblock %} + +{% block spanElement %}{% import _self as knp_menu %}{{ block('label') }}{% endblock %} + +{% block label %}{% if options.allow_safe_labels and item.getExtra('safe_label', false) %}{{ item.label|raw }}{% else %}{{ item.label }}{% endif %}{% endblock %} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views/knp_menu_base.html.twig b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views/knp_menu_base.html.twig new file mode 100644 index 0000000..26965d8 --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views/knp_menu_base.html.twig @@ -0,0 +1 @@ +{% if options.compressed %}{{ block('compressed_root') }}{% else %}{{ block('root') }}{% endif %} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views/knp_menu_ordered.html.twig b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views/knp_menu_ordered.html.twig new file mode 100644 index 0000000..d21c2cf --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views/knp_menu_ordered.html.twig @@ -0,0 +1,11 @@ +{% extends 'knp_menu.html.twig' %} + +{% block list %} +{% import 'knp_menu.html.twig' as macros %} + +{% if item.hasChildren and options.depth is not same as(0) and item.displayChildren %} + + {{ block('children') }} + +{% endif %} +{% endblock %} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Twig/Helper.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Twig/Helper.php new file mode 100644 index 0000000..22462cd --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Twig/Helper.php @@ -0,0 +1,192 @@ +rendererProvider = $rendererProvider; + $this->menuProvider = $menuProvider; + $this->menuManipulator = $menuManipulator; + $this->matcher = $matcher; + } + + /** + * Retrieves item in the menu, eventually using the menu provider. + * + * @param ItemInterface|string $menu + * @param array $path + * @param array $options + * + * @throws \BadMethodCallException when there is no menu provider and the menu is given by name + * @throws \LogicException + * @throws \InvalidArgumentException when the path is invalid + */ + public function get($menu, array $path = [], array $options = []): ItemInterface + { + if (!$menu instanceof ItemInterface) { + if (null === $this->menuProvider) { + throw new \BadMethodCallException('A menu provider must be set to retrieve a menu'); + } + + $menuName = $menu; + $menu = $this->menuProvider->get($menuName, $options); + + if (!$menu instanceof ItemInterface) { + throw new \LogicException(\sprintf('The menu "%s" exists, but is not a valid menu item object. Check where you created the menu to be sure it returns an ItemInterface object.', $menuName)); + } + } + + foreach ($path as $child) { + $menu = $menu->getChild($child); + if (null === $menu) { + throw new \InvalidArgumentException(\sprintf('The menu has no child named "%s"', $child)); + } + } + + return $menu; + } + + /** + * Renders a menu with the specified renderer. + * + * If the argument is an array, it will follow the path in the tree to + * get the needed item. The first element of the array is the whole menu. + * If the menu is a string instead of an ItemInterface, the provider + * will be used. + * + * @param ItemInterface|string|array $menu + * @param array $options + * + * @throws \InvalidArgumentException + */ + public function render($menu, array $options = [], ?string $renderer = null): string + { + $menu = $this->castMenu($menu); + + return $this->rendererProvider->get($renderer)->render($menu, $options); + } + + /** + * Renders an array ready to be used for breadcrumbs. + * + * Each element in the array will be an array with 3 keys: + * - `label` containing the label of the item + * - `url` containing the url of the item (may be `null`) + * - `item` containing the original item (may be `null` for the extra items) + * + * The subItem can be one of the following forms + * * 'subItem' + * * ItemInterface object + * * ['subItem' => '@homepage'] + * * ['subItem1', 'subItem2'] + * * [['label' => 'subItem1', 'url' => '@homepage'], ['label' => 'subItem2']] + * + * @param mixed $menu + * @param mixed $subItem A string or array to append onto the end of the array + * @phpstan-param string|ItemInterface|array|\Traversable $subItem + * + * @return array> + * @phpstan-return list + */ + public function getBreadcrumbsArray($menu, $subItem = null): array + { + if (null === $this->menuManipulator) { + throw new \BadMethodCallException('The menu manipulator must be set to get the breadcrumbs array'); + } + + $menu = $this->castMenu($menu); + + return $this->menuManipulator->getBreadcrumbsArray($menu, $subItem); + } + + /** + * Returns the current item of a menu. + * + * @param ItemInterface|string|array $menu + */ + public function getCurrentItem($menu): ?ItemInterface + { + $menu = $this->castMenu($menu); + + return $this->retrieveCurrentItem($menu); + } + + /** + * @param ItemInterface|string|array $menu + */ + private function castMenu($menu): ItemInterface + { + if (!$menu instanceof ItemInterface) { + $path = []; + if (\is_array($menu)) { + if (empty($menu)) { + throw new \InvalidArgumentException('The array cannot be empty'); + } + $path = $menu; + $menu = \array_shift($path); + } + + return $this->get($menu, $path); + } + + return $menu; + } + + private function retrieveCurrentItem(ItemInterface $item): ?ItemInterface + { + if (null === $this->matcher) { + throw new \BadMethodCallException('The matcher must be set to get the current item of a menu'); + } + + if ($this->matcher->isCurrent($item)) { + return $item; + } + + if ($this->matcher->isAncestor($item)) { + foreach ($item->getChildren() as $child) { + $currentItem = $this->retrieveCurrentItem($child); + + if (null !== $currentItem) { + return $currentItem; + } + } + } + + return null; + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Twig/MenuExtension.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Twig/MenuExtension.php new file mode 100644 index 0000000..b5e749b --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Twig/MenuExtension.php @@ -0,0 +1,166 @@ +helper = $helper; + $this->matcher = $matcher; + $this->menuManipulator = $menuManipulator; + } + + /** + * @return array + */ + public function getFunctions(): array + { + return [ + new TwigFunction('knp_menu_get', [$this, 'get']), + new TwigFunction('knp_menu_render', [$this, 'render'], ['is_safe' => ['html']]), + new TwigFunction('knp_menu_get_breadcrumbs_array', [$this, 'getBreadcrumbsArray']), + new TwigFunction('knp_menu_get_current_item', [$this, 'getCurrentItem']), + ]; + } + + /** + * @return array + */ + public function getFilters(): array + { + return [ + new TwigFilter('knp_menu_as_string', [$this, 'pathAsString']), + ]; + } + + /** + * @return array + */ + public function getTests(): array + { + return [ + new TwigTest('knp_menu_current', [$this, 'isCurrent']), + new TwigTest('knp_menu_ancestor', [$this, 'isAncestor']), + ]; + } + + /** + * Retrieves an item following a path in the tree. + * + * @param ItemInterface|string $menu + * @param array $path + * @param array $options + */ + public function get($menu, array $path = [], array $options = []): ItemInterface + { + return $this->helper->get($menu, $path, $options); + } + + /** + * Renders a menu with the specified renderer. + * + * @param ItemInterface|string|array $menu + * @param array $options + */ + public function render($menu, array $options = [], ?string $renderer = null): string + { + return $this->helper->render($menu, $options, $renderer); + } + + /** + * Returns an array ready to be used for breadcrumbs. + * + * @param ItemInterface|string|array $menu + * @param string|array|null $subItem + * @phpstan-param string|ItemInterface|array|\Traversable $subItem + * + * @return array> + * @phpstan-return list + */ + public function getBreadcrumbsArray($menu, $subItem = null): array + { + return $this->helper->getBreadcrumbsArray($menu, $subItem); + } + + /** + * Returns the current item of a menu. + * + * @param ItemInterface|string $menu + */ + public function getCurrentItem($menu): ItemInterface + { + $rootItem = $this->get($menu); + + $currentItem = $this->helper->getCurrentItem($rootItem); + + if (null === $currentItem) { + $currentItem = $rootItem; + } + + return $currentItem; + } + + /** + * A string representation of this menu item + * + * e.g. Top Level > Second Level > This menu + */ + public function pathAsString(ItemInterface $menu, string $separator = ' > '): string + { + if (null === $this->menuManipulator) { + throw new \BadMethodCallException('The menu manipulator must be set to get the breadcrumbs array'); + } + + return $this->menuManipulator->getPathAsString($menu, $separator); + } + + /** + * Checks whether an item is current. + */ + public function isCurrent(ItemInterface $item): bool + { + if (null === $this->matcher) { + throw new \BadMethodCallException('The matcher must be set to get the breadcrumbs array'); + } + + return $this->matcher->isCurrent($item); + } + + /** + * Checks whether an item is the ancestor of a current item. + * + * @param int|null $depth The max depth to look for the item + */ + public function isAncestor(ItemInterface $item, ?int $depth = null): bool + { + if (null === $this->matcher) { + throw new \BadMethodCallException('The matcher must be set to get the breadcrumbs array'); + } + + return $this->matcher->isAncestor($item, $depth); + } +} diff --git a/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Util/MenuManipulator.php b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Util/MenuManipulator.php new file mode 100644 index 0000000..345433a --- /dev/null +++ b/plugins/page-toc/vendor/knplabs/knp-menu/src/Knp/Menu/Util/MenuManipulator.php @@ -0,0 +1,304 @@ +getParent()) { + $this->moveChildToPosition($parent, $item, $position); + } + } + + /** + * Moves child to specified position. Rearrange other children accordingly. + * + * @param ItemInterface $child Child to move + * @param int $position Position to move child to + */ + public function moveChildToPosition(ItemInterface $item, ItemInterface $child, int $position): void + { + $name = $child->getName(); + $order = \array_keys($item->getChildren()); + + $oldPosition = \array_search($name, $order); + unset($order[$oldPosition]); + + $order = \array_values($order); + + \array_splice($order, $position, 0, $name); + $item->reorderChildren($order); + } + + /** + * Moves item to first position. Rearrange siblings accordingly. + */ + public function moveToFirstPosition(ItemInterface $item): void + { + $this->moveToPosition($item, 0); + } + + /** + * Moves item to last position. Rearrange siblings accordingly. + */ + public function moveToLastPosition(ItemInterface $item): void + { + if (null !== $parent = $item->getParent()) { + $this->moveToPosition($item, $parent->count()); + } + } + + /** + * Get slice of menu as another menu. + * + * If offset and/or length are numeric, it works like in array_slice function: + * + * If offset is non-negative, slice will start at the offset. + * If offset is negative, slice will start that far from the end. + * + * If length is null, slice will have all elements. + * If length is positive, slice will have that many elements. + * If length is negative, slice will stop that far from the end. + * + * It's possible to mix names/object/numeric, for example: + * slice("child1", 2); + * slice(3, $child5); + * Note: when using a child as limit, it will not be included in the returned menu. + * the slice is done before this menu. + * + * @param mixed $offset name of child, child object, or numeric offset + * @param string|int|ItemInterface $length name of child, child object, or numeric length + */ + public function slice(ItemInterface $item, $offset, $length = null): ItemInterface + { + $names = \array_keys($item->getChildren()); + if ($offset instanceof ItemInterface) { + $offset = $offset->getName(); + } + if (!\is_int($offset)) { + $offset = \array_search($offset, $names, true); + if (false === $offset) { + throw new \InvalidArgumentException('Not found.'); + } + } + + if (null !== $length) { + if ($length instanceof ItemInterface) { + $length = $length->getName(); + } + if (!\is_int($length)) { + $index = \array_search($length, $names, true); + $length = ($index < $offset) ? 0 : $index - $offset; + } + } + + $slicedItem = $item->copy(); + $children = \array_slice($slicedItem->getChildren(), $offset, $length); + $slicedItem->setChildren($children); + + return $slicedItem; + } + + /** + * Split menu into two distinct menus. + * + * @param string|int|ItemInterface $length name of child, child object, or numeric length + * + * @phpstan-return array{primary: ItemInterface, secondary: ItemInterface} + * + * @return array Array with two menus, with "primary" and "secondary" key + */ + public function split(ItemInterface $item, $length): array + { + return [ + 'primary' => $this->slice($item, 0, $length), + 'secondary' => $this->slice($item, $length), + ]; + } + + /** + * Calls a method recursively on all of the children of this item + * + * @example + * $menu->callRecursively('setShowChildren', [false]); + * + * @param array $arguments + */ + public function callRecursively(ItemInterface $item, string $method, array $arguments = []): void + { + $item->$method(...$arguments); + + foreach ($item->getChildren() as $child) { + $this->callRecursively($child, $method, $arguments); + } + } + + /** + * A string representation of this menu item + * + * e.g. Top Level > Second Level > This menu + */ + public function getPathAsString(ItemInterface $item, string $separator = ' > '): string + { + $children = []; + $obj = $item; + + do { + $children[] = $obj->getLabel(); + } while ($obj = $obj->getParent()); + + return \implode($separator, \array_reverse($children)); + } + + /** + * @param int|null $depth the depth until which children should be exported (null means unlimited) + * + * @return array + */ + public function toArray(ItemInterface $item, ?int $depth = null): array + { + $array = [ + 'name' => $item->getName(), + 'label' => $item->getLabel(), + 'uri' => $item->getUri(), + 'attributes' => $item->getAttributes(), + 'labelAttributes' => $item->getLabelAttributes(), + 'linkAttributes' => $item->getLinkAttributes(), + 'childrenAttributes' => $item->getChildrenAttributes(), + 'extras' => $item->getExtras(), + 'display' => $item->isDisplayed(), + 'displayChildren' => $item->getDisplayChildren(), + 'current' => $item->isCurrent(), + ]; + + // export the children as well, unless explicitly disabled + if (0 !== $depth) { + $childDepth = null === $depth ? null : $depth - 1; + $array['children'] = []; + foreach ($item->getChildren() as $key => $child) { + $array['children'][$key] = $this->toArray($child, $childDepth); + } + } + + return $array; + } + + /** + * Renders an array ready to be used for breadcrumbs. + * + * Each element in the array will be an array with 3 keys: + * - `label` containing the label of the item + * - `url` containing the url of the item (may be `null`) + * - `item` containing the original item (may be `null` for the extra items) + * + * The subItem can be one of the following forms + * * 'subItem' + * * ItemInterface object + * * ['subItem' => '@homepage'] + * * ['subItem1', 'subItem2'] + * * [['label' => 'subItem1', 'url' => '@homepage'], ['label' => 'subItem2']] + * + * @param string|ItemInterface|array|\Traversable $subItem A string or array to append onto the end of the array + * @phpstan-param string|ItemInterface|array|\Traversable $subItem + * + * @return array> + * @phpstan-return list + * + * @throws \InvalidArgumentException if an element of the subItem is invalid + */ + public function getBreadcrumbsArray(ItemInterface $item, $subItem = null): array + { + $breadcrumbs = $this->buildBreadcrumbsArray($item); + + if (null === $subItem) { + return $breadcrumbs; + } + + if ($subItem instanceof ItemInterface) { + $breadcrumbs[] = $this->getBreadcrumbsItem($subItem); + + return $breadcrumbs; + } + + if (!\is_array($subItem) && !$subItem instanceof \Traversable) { + $subItem = [$subItem]; + } + + foreach ($subItem as $key => $value) { + switch (true) { + case $value instanceof ItemInterface: + $value = $this->getBreadcrumbsItem($value); + break; + + case \is_array($value): + // Assume we already have the appropriate array format for the element + break; + + case \is_int($key) && \is_string($value): + $value = [ + 'label' => (string) $value, + 'uri' => null, + 'item' => null, + ]; + break; + + case \is_scalar($value): + $value = [ + 'label' => (string) $key, + 'uri' => (string) $value, + 'item' => null, + ]; + break; + + case null === $value: + $value = [ + 'label' => (string) $key, + 'uri' => null, + 'item' => null, + ]; + break; + + default: + throw new \InvalidArgumentException(\sprintf('Invalid value supplied for the key "%s". It should be an item, an array or a scalar', $key)); + } + + $breadcrumbs[] = $value; + } + + return $breadcrumbs; + } + + /** + * @phpstan-return list + */ + private function buildBreadcrumbsArray(ItemInterface $item): array + { + $breadcrumb = []; + + do { + $breadcrumb[] = $this->getBreadcrumbsItem($item); + } while ($item = $item->getParent()); + + return \array_reverse($breadcrumb); + } + + /** + * @phpstan-return array{label: string, uri: string|null, item: ItemInterface} + */ + private function getBreadcrumbsItem(ItemInterface $item): array + { + return [ + 'label' => $item->getLabel(), + 'uri' => $item->getUri(), + 'item' => $item, + ]; + } +}