Compare commits
222 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c9af0b9018 | |||
| b2b47095eb | |||
| 002ebda06f | |||
| 551938f0b4 | |||
| 9d6ee9feef | |||
| 1bd56105b7 | |||
| b7dba0713e | |||
| dd4f422dba | |||
| aaebdfb02c | |||
| 9eb18b9e75 | |||
| 594c89eb1e | |||
| 976d1ea82a | |||
| b16a06893c | |||
| 32711ff29c | |||
| 38eb829194 | |||
| 4c9b5b6773 | |||
| 8b2dd976e6 | |||
| 8789f6eaff | |||
| 34021a58a3 | |||
| 804d1e484d | |||
| e482fbe36a | |||
| de5fd0c3f7 | |||
| 07756a8c34 | |||
| ef84231860 | |||
| 0c87728979 | |||
| 90032a4471 | |||
| 2ebc77797c | |||
| 714a656ca8 | |||
| 175a307673 | |||
| 8e3d880557 | |||
| 9f24e82770 | |||
| 7e8e2e9431 | |||
| fbe58346e5 | |||
| 7aface4334 | |||
| b9539e9d69 | |||
| 927e6f9946 | |||
| da54fef151 | |||
| 0c3148b3ee | |||
| 7c7b81f589 | |||
| d777b2cfaf | |||
| 928fba19a8 | |||
| 68f4d5fb80 | |||
| df3aaa7ea3 | |||
| 4753da9236 | |||
| e4bc95172c | |||
| f5a79bac03 | |||
| 8beeb2dfa5 | |||
| 9894cf6263 | |||
| bece9f6fa2 | |||
| 9f7bce87a7 | |||
| 6c6a326607 | |||
| 4342d40158 | |||
| e4367587f1 | |||
| 2cc276e5f5 | |||
| caeb3d443e | |||
| 4b2ff9e773 | |||
| 95612e33f5 | |||
| 443abcf784 | |||
| 7b7fba261b | |||
| d02a9977a2 | |||
| 4bfe3962a9 | |||
| 9718a1c5c7 | |||
| a846d74e43 | |||
| c606e8c96e | |||
| 307851fc25 | |||
| 94a1796e63 | |||
| c783ced12f | |||
| 5d16e1ac0f | |||
| c7a03ea847 | |||
| 8ccf57862c | |||
| 86f4630f0b | |||
| 8416b6f757 | |||
| 30dbc469bd | |||
| 1cfabbe8bc | |||
| d4d2a95f98 | |||
| b5208b3f4b | |||
| fb16d9e1a2 | |||
| dc288de30f | |||
| e953d16f1c | |||
| a8e815aaa0 | |||
| 7991f97e7a | |||
| 65875dec78 | |||
| 8aa3cf96a9 | |||
| ac39b35cd5 | |||
| dba2e38ac8 | |||
| 9e3a440909 | |||
| 8cfd7d30a4 | |||
| 6f16b3ffe1 | |||
| a1833aaf41 | |||
| 2d0887173e | |||
| 17070d6fba | |||
| e3c69a6b13 | |||
| 5e9f24e3d3 | |||
| 1761aa17b9 | |||
| fdc501904c | |||
| 9ec83753d3 | |||
| 1121c9df57 | |||
| 95c8113d62 | |||
| 6fe37cef59 | |||
| 4e29d5e5ca | |||
| 02dda642ea | |||
| c2bb7e0f80 | |||
| 4fb9711fa6 | |||
| 6682d38af2 | |||
| eaa1fea5dc | |||
| 81f6d68f0a | |||
| a9678bf73c | |||
| c4a1b10e6a | |||
| fa952dfac7 | |||
| 089fce6a1c | |||
| bdad5f7758 | |||
| d484414e20 | |||
| d22d261e69 | |||
| 0de8e5053f | |||
| ecb0d964ad | |||
| c4606930ff | |||
| a631096b29 | |||
| b9fe4cc207 | |||
| aae1380688 | |||
| 223a42e3b7 | |||
| c4519a9194 | |||
| 98bf58d9bc | |||
| 4d223bdc29 | |||
| b3b9e358fd | |||
| 9f1773b6c7 | |||
| 1f412dc12d | |||
| e11caf7a59 | |||
| 496b60cff1 | |||
| b4741cc1a3 | |||
| b58fddda9c | |||
| 5c043e2c0f | |||
| 98c5a1ad54 | |||
| 23626dd604 | |||
| deed146884 | |||
| 9b47648aa5 | |||
| a25331bca3 | |||
| 8bb2a35dcc | |||
| 608693c962 | |||
| 5df739e5dc | |||
| 8611f00cf4 | |||
| 7fa16bbf66 | |||
| 88ec3aad5b | |||
| aff8b7f2c9 | |||
| 2956b9927c | |||
| 78416fa920 | |||
| 3443e0745b | |||
| 1b359b7f14 | |||
| 6df8f283f2 | |||
| 38043616ef | |||
| d7a25beafa | |||
| d64a6210f2 | |||
| ff95cfaed7 | |||
| 80ae5003f7 | |||
| 566c2238a2 | |||
| db6335cee3 | |||
| 1cc75302f1 | |||
| 901f47bac9 | |||
| d4e1a2392f | |||
| 60e9d6f0b9 | |||
| f2b0bd5aca | |||
| 0ac4c06d66 | |||
| 869b4f5798 | |||
| 68849f644f | |||
| 0f5e60274a | |||
| 913b79b30a | |||
| 6e3f3200e2 | |||
| 11422bfcd2 | |||
| bc6d8f47c2 | |||
| 40cb2e412a | |||
| 0ace5e2aad | |||
| eef8efde25 | |||
| 2fdb240b2c | |||
| cd12da45b4 | |||
| cbcb9c53cb | |||
| 06250ca531 | |||
| cb7ea11a81 | |||
| 46e107b507 | |||
| d90b51c02d | |||
| 6abad2937e | |||
| a7bb6cf835 | |||
| d441e8487e | |||
| 7376238567 | |||
| 433c631110 | |||
| 9ca9a6e284 | |||
| 914f02643e | |||
| 0b5e40e2bf | |||
| 4e20b85420 | |||
| 19396e7e5f | |||
| 089e96f6fa | |||
| 88ee7146d5 | |||
| e685b2d33e | |||
| c4cedfe6c1 | |||
| 2a25978ee6 | |||
| afc79a1809 | |||
| 9ed873a0dd | |||
| 9b8c94761e | |||
| 04b9cceed9 | |||
| 8dceb3ea6e | |||
| a98fa072fd | |||
| 541bad62ae | |||
| 1f40755ce1 | |||
| 25eebf642f | |||
| 7ff750ab0a | |||
| 22149b2082 | |||
| 703349de9d | |||
| af282b0935 | |||
| 81bc55c46f | |||
| 934c57cdff | |||
| 3195fc5d62 | |||
| 56bc897f36 | |||
| b9b2c40103 | |||
| d45a13e939 | |||
| 264bb76b53 | |||
| 3687dd17fb | |||
| 9d527f0e2e | |||
| 14fc25888c | |||
| a951ccfea8 | |||
| 78c53f0aca | |||
| ddc33ec1da | |||
| 595bdd908b | |||
| de4ff5d8d7 | |||
| 866203a4ce |
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"comments": false,
|
||||
"minified": true,
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": "> 0.25%, not dead"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
assets/lib/**/* linguist-vendored
|
||||
@@ -1,5 +1,3 @@
|
||||
custom: [
|
||||
"https://paypal.me/Lruihao",
|
||||
"https://lruihao.cn/images/alipay.gif",
|
||||
"https://lruihao.cn/images/wechatpay.gif"
|
||||
"https://paypal.me/Lruihao"
|
||||
]
|
||||
@@ -48,4 +48,4 @@ body:
|
||||
label: Additional Information 补充信息
|
||||
description: |
|
||||
Configuration files or front matter code ...
|
||||
配置文件或者前置参数的代码 ...
|
||||
配置文件或者前置参数的代码……
|
||||
|
||||
@@ -12,7 +12,7 @@ body:
|
||||
请针对不同的功能建议提交新的 issue。
|
||||
placeholder: |
|
||||
I recommend adding this feature ...
|
||||
我希望添加这样的一个功能 ...
|
||||
我希望添加这样的一个功能……
|
||||
- type: textarea
|
||||
id: reference
|
||||
attributes:
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
name: Update Algolia Search Index
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'docs'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
algolia-atomic:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true # Fetch Hugo themes (true OR recursive)
|
||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2
|
||||
with:
|
||||
hugo-version: 'latest'
|
||||
extended: true
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
- name: Update Algolia Index (en)
|
||||
env:
|
||||
ALGOLIA_APP_ID: YKOM6PKLUY
|
||||
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}
|
||||
ALGOLIA_INDEX_NAME: 'index.en'
|
||||
ALGOLIA_INDEX_FILE: './docs/public/index.json'
|
||||
run: |
|
||||
npm run algolia
|
||||
|
||||
- name: Update Algolia Index (zh-cn)
|
||||
env:
|
||||
ALGOLIA_APP_ID: YKOM6PKLUY
|
||||
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}
|
||||
ALGOLIA_INDEX_NAME: 'index.zh-cn'
|
||||
ALGOLIA_INDEX_FILE: './docs/public/zh-cn/index.json'
|
||||
run: |
|
||||
npm run algolia
|
||||
@@ -8,7 +8,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive # Fetch Hugo themes (true OR recursive)
|
||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||
|
||||
@@ -19,7 +19,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
schedule:
|
||||
- cron: '30 18 * * 5'
|
||||
- cron: "30 18 * * 5"
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
@@ -29,18 +29,21 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'javascript' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||
language: [ "javascript" ]
|
||||
# CodeQL supports [ "cpp", "csharp", "go", "java", "javascript", "python" ]
|
||||
# Learn more:
|
||||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true # Fetch Hugo themes (true OR recursive)
|
||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
config-file: ./.github/configs/codeql.yml
|
||||
@@ -52,7 +55,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
@@ -66,4 +69,4 @@ jobs:
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: github/codeql-action/analyze@v3
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "docs"]
|
||||
path = docs
|
||||
url = https://github.com/hugo-fixit/docs.git
|
||||
@@ -1,277 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
<!-- Releases see https://github.com/hugo-fixit/FixIt/releases -->
|
||||
|
||||
## v0.2.17 [2023.1.29]
|
||||
|
||||
> Snapshot: <>
|
||||
|
||||
- :tada: Feat: add support for [Fusejs search](https://fusejs.io/) ([#203](https://github.com/hugo-fixit/FixIt/issues/203))
|
||||
- :sparkles: Feat: add feature post reward support ([#216](https://github.com/hugo-fixit/FixIt/issues/216), @Lruihao[#234](https://github.com/hugo-fixit/FixIt/pull/234))
|
||||
- :sparkles: Feat: add reward shortcode support ([#216](https://github.com/hugo-fixit/FixIt/issues/216))
|
||||
- :sparkles: Feat: add TagCloud config support for tags page, see parameter `params.tagcloud` ([#235](https://github.com/hugo-fixit/FixIt/issues/235))
|
||||
- :sparkles: Feat: add [pace](https://github.com/CodeByZach/pace) support ([#190](https://github.com/hugo-fixit/FixIt/issues/190))
|
||||
- :sparkles: Feat: add custom templates and parameter `params.customFilePath` support
|
||||
- :sparkles: Feat: add feature end of post flag support ([#236](https://github.com/hugo-fixit/FixIt/issues/236))
|
||||
- :sparkles: Feat: refactor parameter `params.footer.siteTime`
|
||||
- :sparkles: Feat: add params to close wordcount and readingTime in post ([#209](https://github.com/hugo-fixit/FixIt/issues/209))
|
||||
- :sparkles: Feat: add parameter `params.footer.order` to order footer lines
|
||||
- :sparkles: Feat: add parameter `params.home.profile.avatarMenu`
|
||||
- :truck: Feat: migrate parameter `params.autoBookmark` to `params.page.autoBookmark` ([#55](https://github.com/hugo-fixit/FixIt/issues/55))
|
||||
- :truck: Feat: move `assets/data/emoji` to `assets/lib/valine/emoji/`
|
||||
- :zap: Perf: optimize close comment feature when the post has expired ([#204](https://github.com/hugo-fixit/FixIt/issues/204))
|
||||
- :zap: Perf: optimize sub menu position calculation in desktop header with css replace of javascript
|
||||
- :zap: Perf: enhance pangu spelling correction
|
||||
- :bug: Fix: remove the leading and trailing whitespace of the code string ([#205](https://github.com/hugo-fixit/FixIt/issues/205))
|
||||
- :bento: Fix: update webfonts for fontawesome 6.2.0 (@NicoDreamzZ[#228](https://github.com/hugo-fixit/FixIt/pull/228))
|
||||
- :bug: Fix: image shortcode/plugin lose the support for svg type files ([#210](https://github.com/hugo-fixit/FixIt/issues/210))
|
||||
- :bug: Fix: can't keep the static table of the contents in front of the post
|
||||
- :bug: Fix: escape hashtag character `#` in tag and category ([#245](https://github.com/hugo-fixit/FixIt/issues/245))
|
||||
- :bug: Fix: pangu.js cdn error
|
||||
- :bug: Fix: sitemap.xml link in robots.txt doesn't point to main sitemap (@Mejituu[#276](https://github.com/hugo-fixit/FixIt/pull/276))
|
||||
- :recycle: Refactor(i18n): hierarchize translation fields for supported languages
|
||||
- :globe_with_meridians: Docs(i18n): add missing translations for French + enhancements (@Kapusch[#247](https://github.com/hugo-fixit/FixIt/pull/247))
|
||||
- :lipstick: Style: refactor css style
|
||||
- :lipstick: Style: update home page stylesheet
|
||||
- :arrow_up: Chore(libs):
|
||||
- Update Twikoo from 1.4.10 to 1.6.8 and add Katex support for it ([#215](https://github.com/hugo-fixit/FixIt/issues/215) [#243](https://github.com/hugo-fixit/FixIt/issues/243))
|
||||
- :wrench: Chore(deps-dev):
|
||||
- Bump @babel/cli from 7.18.10 to 7.20.7
|
||||
- Bump @babel/core from 7.19.1 to 7.20.12
|
||||
- Bump @babel/preset-env from 7.18.10 to 7.20.2
|
||||
- Bump core-js from 3.25.2 to 3.27.2
|
||||
|
||||
- **Full Changelog:** @Lruihao [`v0.2.16...v0.2.17`](https://github.com/hugo-fixit/FixIt/compare/v0.2.16...v0.2.17)
|
||||
|
||||
## v0.2.16 [2022.9.24]
|
||||
|
||||
> This version fixes several bugs, adds a few new features and SEO optimizations, and refactors part of the project structure and code.
|
||||
> Snapshot: <https://fixit-jir7e7kzt-x-cell.vercel.app>
|
||||
|
||||
- :tada: Feat: add reading progress bar support ([#191](https://github.com/hugo-fixit/FixIt/issues/191))
|
||||
- :tada: Feat: add b2t scroll percent support ([#192](https://github.com/hugo-fixit/FixIt/issues/192))
|
||||
- :sparkles: Feat: add auto bookmark support ([#55](https://github.com/hugo-fixit/FixIt/issues/55))
|
||||
- :sparkles: Feat: add `raw` shortcode
|
||||
- :sparkles: Feat(menu): add params: `icon`, `type` for menu items
|
||||
- :sparkles: Feat: add custom aside template in post page ([#172](https://github.com/hugo-fixit/FixIt/issues/172))
|
||||
- :sparkles: Feat(math): add more block delimiter support for math
|
||||
- :sparkles: Feat(highlight): add full support for Chroma highlighting languages in the [list](https://gohugo.io/content-management/syntax-highlighting/#list-of-chroma-highlighting-languages)
|
||||
- :sparkles: Feat: add optional parameter `noreferrer` for the shortcode `link`
|
||||
- :sparkles: Feat: update echarts theme config
|
||||
- :sparkles: Feat: add noscript warning banner ([#194](https://github.com/hugo-fixit/FixIt/issues/194))
|
||||
- :sparkles: Feat: add 12 newly supported social links ([#175](https://github.com/hugo-fixit/FixIt/issues/175) [#197](https://github.com/hugo-fixit/FixIt/issues/197))
|
||||
- :zap: Perf: remove extra spaces in plugin link
|
||||
- :wheelchair: Feat(accessibility): use `aria-hidden=true` on icons that AT should ignore
|
||||
- :recycle: Refactor: image rendering
|
||||
- :recycle: Refactor: back to top and scroll to comments
|
||||
- :recycle: Refactor: custom.js rendering and remove `params.customJS` ([#189](https://github.com/hugo-fixit/FixIt/pull/189))
|
||||
- :recycle: Refactor: scss directory ([#185](https://github.com/hugo-fixit/FixIt/issues/185))
|
||||
- :recycle: Refactor: plugin script
|
||||
- :recycle: Refactor: version.template.svg
|
||||
- :recycle: Refactor: config ([#187](https://github.com/hugo-fixit/FixIt/issues/187))
|
||||
- :bug: Fix: add function `dos2unix` to unify new lines symbol between Windows and Unix/Mac OS
|
||||
- :bug: Fix: author display error in post and markdown file
|
||||
- :bug: Fix: use data attributes or class replace for custom attributes
|
||||
- :bug: Fix: attribute `media` not allowed on element meta in `[name=theme-color]`
|
||||
- :bug: Fix: support smooth migration from LoveIt to FixIt ([#174](https://github.com/hugo-fixit/FixIt/discussions/174) [#182](https://github.com/hugo-fixit/FixIt/issues/182))
|
||||
- :bug: Fix: `center-quote` shortcode rendering error when config `unsafe = false` (@yureiita[#160](https://github.com/hugo-fixit/FixIt/pull/160))
|
||||
- :bug: Fix: menu item invalid params `draft` in submenu
|
||||
- :bug: Fix: missing height and weight of img element and lazyload object-fit style
|
||||
- :bug: Fix: image shortcode invalid params `height` and `weight` ([#200](https://github.com/hugo-fixit/FixIt/issues/200))
|
||||
- :bug: Fix: typeit shortcode invalid config `duration = -1` and fix style
|
||||
- :bug: Fix: typeit shortcode prints consecutive spaces and newline errors
|
||||
- :art: Style: change the default icons of some social links
|
||||
- :bug: Fix: component `paginator` style error ([#188](https://github.com/hugo-fixit/FixIt/issues/188))
|
||||
- :lipstick: Style: fix language and theme switch cursor style ([#193](https://github.com/hugo-fixit/FixIt/issues/193))
|
||||
- :lipstick: Style: change line-break style of code element from `anywhere` to `auto`
|
||||
- :globe_with_meridians: Docs(i18n): update pt-br, de in i18n
|
||||
- :mag: Perf(SEO): enhance SEO performance
|
||||
- :wrench: Chore: modify babel config and optimize theme.js compilation and loading (revert [`65371a1`](https://github.com/hugo-fixit/FixIt/commit/65371a19a40591c3f403f7fde2b7001c3390354d))
|
||||
- :wrench: Chore: creating new go.mod: module github.com/hugo-fixit/FixIt
|
||||
- :arrow_up: Chore(libs):
|
||||
- Update simple-icons from 6.3.0 to 7.12.0
|
||||
- Update emoji-data from 5.0.1 to 14.0.0
|
||||
- Update mermaid from 9.1.3 to 9.1.7
|
||||
- Update typeit from 7.0.4 to 8.7.0
|
||||
- Update lightgallery from 1.4.0 to 2.6.1
|
||||
- Update Valine from 1.5.0 to 1.5.1
|
||||
- Update @waline/client from 2.6.1 to 2.10.0
|
||||
- Update mapbox-gl from 2.8.2 to 2.10.0
|
||||
- Update fontawesome-free from 6.1.1 to 6.2.0
|
||||
- Update katex from 0.15.3 to 0.16.2
|
||||
- Update echarts from 5.2.2 to 5.3.3
|
||||
- Update algoliasearch from 4.13.0 to 4.14.2
|
||||
- :wrench: Chore(deps-dev):
|
||||
- Remove dependencies: minimist, babel-preset-minify
|
||||
- Bump core-js from 3.24.1 to 3.25.2 (@dependabot[#201](https://github.com/hugo-fixit/FixIt/pull/201))
|
||||
- Bump @babel/core from 7.18.10 to 7.19.1 (@dependabot[#202](https://github.com/hugo-fixit/FixIt/pull/202))
|
||||
- **Full Changelog:** @Lruihao [`v0.2.15...v0.2.16`](https://github.com/hugo-fixit/FixIt/compare/v0.2.15...v0.2.16)
|
||||
|
||||
## v0.2.15 [2022.8.4]
|
||||
|
||||
> Add content encryption feature(pages, partial), total word count, enhance auto toc, developer options and more.
|
||||
> Snapshot: <https://fixit-hvd1rg4ba-x-cell.vercel.app>
|
||||
|
||||
- :truck: Feat: ransfer repository from Lruihao to hugo-fixit
|
||||
- :tada: Feat: add content encryption of pages ([#123](https://github.com/hugo-fixit/FixIt/issues/123))
|
||||
- :tada: Feat: add `fixit-encryptor` shortcode ([#123](https://github.com/hugo-fixit/FixIt/issues/123))
|
||||
- :sparkles: Feat: add total word count feature in section and remove from footer ([#124](https://github.com/hugo-fixit/FixIt/issues/124))
|
||||
- :sparkles: Feat: enhance auto toc feature ([#104](https://github.com/hugo-fixit/FixIt/issues/104) [#136](https://github.com/hugo-fixit/FixIt/issues/136))
|
||||
- :sparkles: Feat: add repost feature ([#156](https://github.com/hugo-fixit/FixIt/issues/156))
|
||||
- :sparkles: Feat: add developer options
|
||||
- Check for updates option
|
||||
- Mobile Devtools config ([#163](https://github.com/hugo-fixit/FixIt/pull/163))
|
||||
- :bug: Fix: unable to show search bar of header at mobile mode ([#143](https://github.com/hugo-fixit/FixIt/issues/143))
|
||||
- :bug: Fix: Giscus comment invalid config `inputPosition`
|
||||
- :bug: Fix: Waline comment invalid config `imageUploader = false` & `highlighter = false` (@yureiita[#161](https://github.com/hugo-fixit/FixIt/pull/161))
|
||||
- :bug: Fix: busuanzi logic error
|
||||
- :bug: Fix: close comment system logic error when the article was expired
|
||||
- :bug: Style: fix typos for rel attribute value noreferrer (@yureiita[#157](https://github.com/hugo-fixit/FixIt/pull/157))
|
||||
- :recycle: Refactor: migrate theme js from src to assets by js.build
|
||||
- :recycle: Refactor: change the post edit url splicing rules
|
||||
- :mag: Feat(SEO): add options to make output `baidu_urls.txt` file ([#138](https://github.com/hugo-fixit/FixIt/issues/138))
|
||||
- :truck: Feat: migrate exampleSite to docs submodule
|
||||
- :art: Style: add theme colors variables and add common color styles
|
||||
- :art: Style: add scroll bar for auto toc ([#136](https://github.com/hugo-fixit/FixIt/issues/136))
|
||||
- :art: Style: change the version badge style form flat-square to flat
|
||||
- :memo: Docs: revise theme documentations
|
||||
- :heavy_plus_sign: Feat: add theme core configuration settings file
|
||||
- :wrench: Feat(cdn): add unpkg cdn support
|
||||
- :wrench: Chore: change the theme minimum supported Hugo versions above **0.84.0**
|
||||
- :arrow_up: Chore(libs): update some third-party libraries
|
||||
- Update Artalk from 2.2.12 to 2.3.4 ([#150](https://github.com/hugo-fixit/FixIt/issues/150))
|
||||
- Update Waline from 1.5.2 to 2.6.1
|
||||
- Update Valine from 1.4.18 to 1.5.0
|
||||
- Update mermaid from 8.13.3 to 9.1.3
|
||||
- :arrow_up: Chore(deps-dev):
|
||||
- Bump babel-preset-minify from 0.5.1 to 0.5.2 ([#145](https://github.com/hugo-fixit/FixIt/pull/145))
|
||||
- Bump core-js from 3.22.0 to 3.24.1 ([#168](https://github.com/hugo-fixit/FixIt/pull/168))
|
||||
- Bump @babel/preset-env from 7.16.11 to 7.18.10 ([#169](https://github.com/hugo-fixit/FixIt/pull/169))
|
||||
- Bump @babel/cli from 7.17.6 to 7.18.10 ([#170](https://github.com/hugo-fixit/FixIt/pull/170))
|
||||
- Bump @babel/core from 7.17.9 to 7.18.10 ([#171](https://github.com/hugo-fixit/FixIt/pull/171))
|
||||
- **Full Changelog:** @Lruihao [`v0.2.14...v0.2.15`](https://github.com/hugo-fixit/FixIt/compare/v0.2.14...v0.2.15)
|
||||
|
||||
## v0.2.14 [2022.5.15]
|
||||
|
||||
> Add hugo new features support.
|
||||
> Snapshot: <https://fixit-p1tg6tsml-lruihao.vercel.app>
|
||||
|
||||
- :recycle: Refactor: header layout
|
||||
- :tada: Feat: add sub menu (nested menu) support ([#31](https://github.com/hugo-fixit/FixIt/issues/31))
|
||||
- :sparkles: Feat: add user-defined content to menu items via the `params` field ([#99](https://github.com/hugo-fixit/FixIt/issues/99))
|
||||
- :sparkles: Feat: modified language selector to submenu (@pandaoh[`eced169`](https://github.com/hugo-fixit/FixIt/commit/eced169713ce4a0208ce70ab556824e47eb671d5), @Lruihao[#31](https://github.com/hugo-fixit/FixIt/issues/31))
|
||||
- :bug: Fix: add "no more translations" judgment logic ([#100](https://github.com/hugo-fixit/FixIt/issues/100))
|
||||
- :bug: Fix: fix some header css bug ([#31](https://github.com/hugo-fixit/FixIt/issues/31))
|
||||
- :sparkles: Feat: enhance link render ([#96](https://github.com/hugo-fixit/FixIt/issues/96))
|
||||
- Add external icon for external links automatically
|
||||
- Add download icon for downloadable links
|
||||
- :sparkles: Feat: add giscus comment system ([#130](https://github.com/hugo-fixit/FixIt/issues/130))
|
||||
- :sparkles: Feat: link shortcode add `external-icon` option ([#96](https://github.com/hugo-fixit/FixIt/issues/96))
|
||||
- :sparkles: Feat: add GitHub Corners support ([#106](https://github.com/hugo-fixit/FixIt/issues/106))
|
||||
- :sparkles: Feat: add local avatar and gravatar support for post author ([#125](https://github.com/hugo-fixit/FixIt/issues/125))
|
||||
- :sparkles: Feat: add ~~total word count support in footer~~ ([#124](https://github.com/hugo-fixit/FixIt/issues/124))
|
||||
- :sparkles: Feat: add "Edit this page" button support ([#103](https://github.com/hugo-fixit/FixIt/issues/103))
|
||||
- :sparkles: Feat: add count badge for taxonomy ([#122](https://github.com/hugo-fixit/FixIt/issues/122))
|
||||
- :zap: Perf: add Gravatar config support
|
||||
- :bug: Fix: invalid front matter `comment: true` ([#108](https://github.com/hugo-fixit/FixIt/issues/108))
|
||||
- :bug: Fix: ibruce and watermark option negative value error ([#114](https://github.com/hugo-fixit/FixIt/issues/114))
|
||||
- :truck: Feat: *migrate ~~`home.profile.gravatarSite`~~ to `gravatar.host`*
|
||||
- :truck: Feat: *migrate ~~`ibruce.siteTime`~~ to `footer.siteTime`*
|
||||
- :lipstick: Style: add some common CSS styles Class ([#101](https://github.com/hugo-fixit/FixIt/issues/101))
|
||||
- :lipstick: Style: add the gap between and icon and text at blending typesetting (@ctj12461, @Lruihao[#118](https://github.com/hugo-fixit/FixIt/pull/118))
|
||||
- :lipstick: Style: modify blockquote CSS
|
||||
- :memo: Docs: revise theme documentations
|
||||
- :zap: Perf: remove third-party library clipboard.js ([#84](https://github.com/hugo-fixit/FixIt/issues/84))
|
||||
- :pencil2: Docs: fix highlight url typo in `theme-documentation-built-in-shortcodes` (@d-baer[#85](https://github.com/hugo-fixit/FixIt/pull/85))
|
||||
- :wrench: Chore(i18n): improve translations for the supported languages ([#119](https://github.com/hugo-fixit/FixIt/issues/119))
|
||||
- :wrench: Chore(i18n): add i18n support for console messages
|
||||
- :wrench: Chore: add deprecated parameter detection in cli
|
||||
- :arrow_up: Chore: update some third-party libraries
|
||||
- :wrench: Chore(deps-dev):
|
||||
- Bump minimist from 1.2.5 to 1.2.6 ([#92](https://github.com/hugo-fixit/FixIt/pull/92))
|
||||
- Bump @babel/core from 7.17.5 to 7.17.10 ([#126](https://github.com/hugo-fixit/FixIt/pull/126))
|
||||
- Bump core-js from 3.21.1 to 3.22.5 ([#129](https://github.com/hugo-fixit/FixIt/pull/129))
|
||||
- Bump @babel/cli from 7.17.6 to 7.17.10 ([#127](https://github.com/hugo-fixit/FixIt/pull/127))
|
||||
- Bump @babel/preset-env from 7.16.11 to 7.17.10 ([`bc74d14`](https://github.com/hugo-fixit/FixIt/commit/bc74d149c16b36644fecdd5bef325bf8087f8593))
|
||||
- **Full Changelog:** @Lruihao [`v0.2.13...v0.2.14`](https://github.com/hugo-fixit/FixIt/compare/v0.2.13...v0.2.14)
|
||||
|
||||
## v0.2.13 [2022.3.14]
|
||||
|
||||
> Improve and add some new features.
|
||||
> Snapshot: <https://fixit-bbh5g5x90-lruihao.vercel.app>
|
||||
|
||||
- :recycle: Refactor: page layout ([#65](https://github.com/hugo-fixit/FixIt/issues/65))
|
||||
- :tada: Feat: add Artalk comment support ([#54](https://github.com/hugo-fixit/FixIt/issues/54), @hiifong[#57](https://github.com/hugo-fixit/FixIt/pull/57))
|
||||
- :tada: Feat: add Waline comment support ([#36](https://github.com/hugo-fixit/FixIt/issues/36))
|
||||
- :tada: Feat: add Twikoo comment support ([#64](https://github.com/hugo-fixit/FixIt/issues/64))
|
||||
- :sparkles: Feat: add recently updated section ([#50](https://github.com/hugo-fixit/FixIt/issues/50))
|
||||
- :sparkles: Feat: add article expiration reminder support ([#51](https://github.com/hugo-fixit/FixIt/issues/51))
|
||||
- :sparkles: Feat: add pageStyle option ([#62](https://github.com/hugo-fixit/FixIt/issues/62))
|
||||
- :sparkles: Style: add media style for print view ([#61](https://github.com/hugo-fixit/FixIt/issues/61))
|
||||
- :sparkles: Feat: add Gravatar mirror site support (@ctj12461[#66](https://github.com/hugo-fixit/FixIt/pull/66))
|
||||
- :sparkles: Feat: add archive count display ([#33](https://github.com/hugo-fixit/FixIt/issues/33))
|
||||
- :sparkles: Feat: add `details` shortcode ([#68](https://github.com/hugo-fixit/FixIt/issues/68))
|
||||
- :sparkles: Feat: add `center-quote` shortcode ([#69](https://github.com/hugo-fixit/FixIt/issues/69))
|
||||
- :sparkles: Feat: add markdown support for **title** parameter of the admonition shortcode
|
||||
- :sparkles: Feat: add 9 newly supported social links ([#17](https://github.com/hugo-fixit/FixIt/issues/17))
|
||||
- :zap: Perf: enhance highlight feature (GitHub syntax supported) and fix some css bugs ([#43](https://github.com/hugo-fixit/FixIt/issues/43))
|
||||
- Inline Code
|
||||
- Indented Code
|
||||
- Block Fenced Code
|
||||
- gist shortcode
|
||||
- :sparkles: Feat: add `params.page.code.edit` option support ([#76](https://github.com/hugo-fixit/FixIt/issues/76))
|
||||
- :mag: Feat: add 360 and sougou seo support
|
||||
- :bug: Fix: remove source map of local libraries to avoid 404 error ([#67](https://github.com/hugo-fixit/FixIt/issues/67))
|
||||
- :fire: Feat: remove shortcode cardlink ([#42](https://github.com/hugo-fixit/FixIt/issues/42))
|
||||
- :lipstick: Style: more refined theme style ([#40](https://github.com/hugo-fixit/FixIt/issues/40))
|
||||
- :pencil2: Style: fix typo *discription* should be **description** ([#60](https://github.com/hugo-fixit/FixIt/issues/60))
|
||||
- :wrench: Chore(update-libs):
|
||||
- Update cell-watermark 1.0.3 and CDN support (fontFamily supported)
|
||||
- Update animate.css 3.7.2 -> 4.1.1 ([#74](https://github.com/hugo-fixit/FixIt/issues/74))
|
||||
- :wrench: Chore: add atomic-algolia for exampleSite ([#70](https://github.com/hugo-fixit/FixIt/issues/70))
|
||||
- **Full Changelog:** @Lruihao [`v0.2.12...v0.2.13`](https://github.com/hugo-fixit/FixIt/compare/v0.2.12...v0.2.13)
|
||||
|
||||
## v0.2.12 [2022-1-27]
|
||||
|
||||
> Fix most known bugs and add some new features.
|
||||
> Snapshot: <https://fixit-e9lpwfkbp-lruihao.vercel.app>
|
||||
|
||||
- :tada: Feat: add PWA support
|
||||
- :tada: Feat: add Watermark support ([#16](https://github.com/hugo-fixit/FixIt/issues/16))
|
||||
- :tada: Feat: add "不蒜子" count and site run time ([#18](https://github.com/hugo-fixit/FixIt/issues/18))
|
||||
- :sparkles: Feat: add pangu.js support ([#20](https://github.com/hugo-fixit/FixIt/issues/20))
|
||||
- :sparkles: Feat: add public network security config (only in China) ([#15](https://github.com/hugo-fixit/FixIt/issues/15))
|
||||
- :sparkles: Feat: add CustomJS option ([#24](https://github.com/hugo-fixit/FixIt/issues/24))
|
||||
- :sparkles: Feat: add theme embedded archeTypes
|
||||
- :mag: Feat(SEO): optimize SEO meta ([#30](https://github.com/hugo-fixit/FixIt/issues/30))
|
||||
- :zap: Feat: remove lib smooth-scroll ([#1](https://github.com/hugo-fixit/FixIt/issues/1)) replaced by CSS native properties scroll-margin, scroll-behavior ([#39](https://github.com/hugo-fixit/FixIt/issues/39))
|
||||
- :zap: Perf: merge shortcode cardlink (deprecated v0.2.13) into shortcode link and add 'download' param ([#42](https://github.com/hugo-fixit/FixIt/issues/42))
|
||||
- :zap: Perf: optimize JS loading ([#25](https://github.com/hugo-fixit/FixIt/issues/25))
|
||||
- :recycle: Refactor: header title DOM and add subtitle option ([#26](https://github.com/hugo-fixit/FixIt/issues/26))
|
||||
- :bug: Fix: set mermaid theme as 'default' when initialization ([#38](https://github.com/hugo-fixit/FixIt/issues/38))
|
||||
- :bug: Fix: typeit print code error ([#19](https://github.com/hugo-fixit/FixIt/issues/19))
|
||||
- :bug: Fix: pre element overflow error ([#29](https://github.com/hugo-fixit/FixIt/issues/29))
|
||||
- :bug: Fix: toc display error without content header ([#21](https://github.com/hugo-fixit/FixIt/issues/21))
|
||||
- :lipstick: Style: style detail adjustments, change scroll-behavior to smooth, taxonomy, header, footer, shortcode style etc.
|
||||
- :pencil: Docs: improve demo site documentation ([#37](https://github.com/hugo-fixit/FixIt/issues/37))
|
||||
- :wrench: Chore: add commands `fixit_checker.sh`
|
||||
- :wrench: Chore(i18n): change some translations
|
||||
- :arrow_up: Chore: update all third-party libraries
|
||||
- **Full Changelog:** @Lruihao [`v0.2.11...v0.2.12`](https://github.com/hugo-fixit/FixIt/compare/v0.2.11...v0.2.12)
|
||||
|
||||
## v0.2.11 [2021-12-19]
|
||||
|
||||
> :tada: The beginning of FixIt to fix the theme LoveIt.
|
||||
|
||||
- :sparkles: Feat: add cardlink shortcode ([Lruihao/hugo-blog@`df9eca2`](https://github.com/Lruihao/hugo-blog/commit/df9eca26af43287748fd8d4654014357a8269b0b))
|
||||
- :tada: Feat: add friends layout template
|
||||
- :wrench: Chore(i18n): add translations for Traditional Chinese ([Lruihao/hugo-blog@`df9eca2`](https://github.com/Lruihao/hugo-blog/commit/b86157d8b84830bda415ab2488580afd843acac2))
|
||||
- :bug: Fix: mobile style ([Lruihao/hugo-blog#19](https://github.com/Lruihao/hugo-blog/issues/19))
|
||||
- :bug: Style: fix content h1 style ([Lruihao/hugo-blog#8](https://github.com/Lruihao/hugo-blog/issues/8))
|
||||
- :bug: Fix: `.params.author` should be `$params.author` ([Lruihao/hugo-blog#1](https://github.com/Lruihao/hugo-blog/issues/1))
|
||||
- **Full Changelog:** @Lruihao [`v0.2.10...v0.2.11`](https://github.com/hugo-fixit/FixIt/compare/v0.2.10...v0.2.11)
|
||||
|
||||
## v0.2.10 :arrow_down: [2020-5-29 before]
|
||||
|
||||
Thanks [dillonzq/LoveIt](https://github.com/dillonzq/LoveIt/releases)
|
||||
@@ -7,7 +7,7 @@ First, fork this repository by clicking the fork button.
|
||||
Next, clone your forked repo.
|
||||
|
||||
```bash
|
||||
git clone --recursive https://github.com/hugo-fixit/FixIt.git && cd FixIt
|
||||
git clone https://github.com/hugo-fixit/FixIt.git && cd FixIt
|
||||
```
|
||||
|
||||
Then, install the dev dependencies.
|
||||
@@ -21,19 +21,16 @@ And now you are ready to go!
|
||||
Here are some useful commands.
|
||||
|
||||
```bash
|
||||
# build theme.js with babel
|
||||
npm run babel
|
||||
# build theme.js and then build the static site
|
||||
npm run build
|
||||
# run a local debugging server with watch
|
||||
npm run server
|
||||
# run a local debugging server with watch in production environment
|
||||
npm run server:production
|
||||
# build theme.js and then run a local debugging server
|
||||
npm run start
|
||||
# build theme.js and then run a local debugging server in production environment
|
||||
npm run start:production
|
||||
```
|
||||
|
||||
If you want to do docs-related theme changes, the simplest way is to have both `FixIt` and `fixit-docs` cloned as sibling directories, and then run:
|
||||
|
||||
```bash
|
||||
npm run server:docs
|
||||
```
|
||||
|
||||
Finally, create a new pull request at <https://github.com/hugo-fixit/FixIt/pulls> to submit your contribution 🎉
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# FixIt Theme | Hugo
|
||||
|
||||
[](https://github.com/hugo-fixit/FixIt/releases)
|
||||
[](https://gohugo.io/)
|
||||
[](https://gohugo.io/)
|
||||
[](/LICENSE)
|
||||
|
||||
👉 English README | [简体中文说明](README.zh-cn.md)
|
||||
@@ -14,25 +14,26 @@ The FixIt theme inherits the excellent features of these themes, and adds new fe
|
||||
|
||||

|
||||
|
||||
## [Getting started](https://fixit.lruihao.cn/categories/documentation/)
|
||||
## Getting started
|
||||
|
||||
Head to this [documentation page](https://fixit.lruihao.cn/theme-documentation-basics/) for a complete guidence to get started with the FixIt theme.
|
||||
Head to the [getting started page](http://fixit.lruihao.cn/documentation/getting-started/) or start with a template:
|
||||
|
||||
Or run [Documentation Site](https://fixit.lruihao.cn) locally:
|
||||
- [hugo-fixit/hugo-fixit-blog-git](https://github.com/hugo-fixit/hugo-fixit-blog-git)
|
||||
- [hugo-fixit/hugo-fixit-blog-go](https://github.com/hugo-fixit/hugo-fixit-blog-go)
|
||||
|
||||
```bash
|
||||
git clone --recursive https://github.com/hugo-fixit/FixIt.git && cd FixIt
|
||||
## [Documentation](https://fixit.lruihao.cn/categories/documentation/)
|
||||
|
||||
hugo server --source=docs
|
||||
```
|
||||
Head to this [documentation page](https://fixit.lruihao.cn/documentation/basics/) for a complete guidence to get started with the FixIt theme.
|
||||
|
||||
Or run [Documentation Site](https://fixit.lruihao.cn) locally, see more details from [Contributing](#contributing).
|
||||
|
||||
In addition, there is the [FixIt wiki](https://github.com/hugo-fixit/FixIt/wiki).
|
||||
|
||||
## Install or Migrate
|
||||
## Migrate from LoveIt
|
||||
|
||||
If you are currently using the LoveIt theme (or some other themes), it is very easy to migrate to FixIt.
|
||||
|
||||
You can add this repo as a submodule of your site directory. Alternatively, you can [install the theme](https://fixit.lruihao.cn/theme-documentation-basics/#install-theme) in other ways.
|
||||
You can add this repo as a submodule of your site directory. Alternatively, you can install the theme in [other ways](https://fixit.lruihao.cn/documentation/basics/#install-theme).
|
||||
|
||||
```bash
|
||||
git submodule add https://github.com/hugo-fixit/FixIt.git themes/FixIt
|
||||
@@ -44,7 +45,7 @@ And later you can update the submodule in your site directory to the latest comm
|
||||
git submodule update --remote --merge
|
||||
```
|
||||
|
||||
Next, go to the `config.toml` and change the default theme to `FixIt`.
|
||||
Next, go to the `hugo.toml` and change the default theme to `FixIt`.
|
||||
|
||||
```diff
|
||||
- theme = "LoveIt"
|
||||
@@ -57,11 +58,11 @@ Now the migration is finished and everything is ready 🎉
|
||||
|
||||
The FixIt theme inherits the excellent features of themes such as LoveIt, and adds new features and optimizations on those basis, as detailed in [Features](#features). In addition, the FixIt theme has the following advantages:
|
||||
|
||||
* Complete Chinese and English official documentations
|
||||
* Community support: Theme official website, Discussions and official QQ group
|
||||
* Continuously and actively update
|
||||
* Constantly incorporate suggestions and ideas from all sides
|
||||
* Highly open theme customizable section
|
||||
- Complete Chinese and English official documentations
|
||||
- Community support: Theme official website, Discussions and official QQ group
|
||||
- Continuously and actively update
|
||||
- Constantly incorporate suggestions and ideas from all sides
|
||||
- Highly open theme customizable section
|
||||
|
||||
In short, if you prefer the design language and freedom of the FixIt theme, and if you like to personalize your own themes as I do, the FixIt theme may be more suitable for you.
|
||||
|
||||
@@ -69,102 +70,95 @@ In short, if you prefer the design language and freedom of the FixIt theme, and
|
||||
|
||||
To see this theme in action, here are some [live demo sites](https://fixit.lruihao.cn/friends/) which are rendered with **FixIt** theme.
|
||||
|
||||
| Site | Repo |
|
||||
| :----------------------------------------------------------- | :----------------------------------------------------------- |
|
||||
| [FixIt Theme Official Website](https://fixit.lruihao.cn), [FixIt Preview](https://pre.fixit.lruihao.cn) | [hugo-fixit/docs](https://github.com/hugo-fixit/docs) |
|
||||
| [FixIt Blog Template - Git](https://demo.fixit.lruihao.cn) | [hugo-fixit/hugo-fixit-blog-git](https://github.com/hugo-fixit/hugo-fixit-blog-git) |
|
||||
| [FixIt Blog Template - Go](https://demo.fixit.lruihao.cn) | [hugo-fixit/hugo-fixit-blog-go](https://github.com/hugo-fixit/hugo-fixit-blog-go) |
|
||||
| [Lruihao's note](https://lruihao.cn) | [Lruihao/hugo-blog](https://github.com/Lruihao/hugo-blog) |
|
||||
|
||||
## Features
|
||||
|
||||
### Performance and SEO
|
||||
|
||||
* Optimized for **performance**: 99/100 on mobile and 100/100 on desktop in [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights)
|
||||
* Optimized SEO performance with a correct **SEO SCHEMA** based on JSON-LD
|
||||
* **[Google Analytics](https://analytics.google.com/analytics)** supported
|
||||
* **[Fathom Analytics](https://usefathom.com/)** supported
|
||||
* Search engine **verification** supported (Google, Bing, Yandex, Pinterest, Baidu, 360 and Sogou)
|
||||
* **CDN** for third-party libraries supported
|
||||
* Automatically converted images with **Lazy Load** by [lazysizes](https://github.com/aFarkas/lazysizes)
|
||||
- Optimized for **performance**: 99/100 on mobile and 100/100 on desktop in [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights)
|
||||
- Optimized SEO performance with a correct **SEO SCHEMA** based on JSON-LD
|
||||
- **[Google Analytics](https://analytics.google.com/analytics)** supported
|
||||
- **[Fathom Analytics](https://usefathom.com/)** supported
|
||||
- Search engine **verification** supported (Google, Bing, Yandex, Pinterest, Baidu, 360 and Sogou)
|
||||
- **CDN** for third-party libraries supported
|
||||
|
||||
### Appearance and Layout
|
||||
|
||||
* **Responsive** layout
|
||||
* **Light/Dark** mode
|
||||
* Globally consistent **design language**
|
||||
* **Pagination** supported
|
||||
* Easy-to-use and self-expanding **table of contents**
|
||||
* **Multilanguage** supported and i18n ready
|
||||
* Beautiful **CSS animation**
|
||||
- **Responsive** layout
|
||||
- **Light/Dark** mode
|
||||
- Globally consistent **design language**
|
||||
- **Pagination** supported
|
||||
- Easy-to-use and self-expanding **table of contents**
|
||||
- **Multilanguage** supported and i18n ready
|
||||
- Beautiful **CSS animation**
|
||||
|
||||
### Social and Comment Systems
|
||||
|
||||
* **Gravatar** supported by [Gravatar](https://gravatar.com)
|
||||
* Local **Avatar** supported
|
||||
* Up to **87** social links supported
|
||||
* Up to **28** share sites supported
|
||||
* **Disqus** comment system supported by [Disqus](https://disqus.com)
|
||||
* **Gitalk** comment system supported by [Gitalk](https://github.com/gitalk/gitalk)
|
||||
* **Valine** comment system supported by [Valine](https://valine.js.org/)
|
||||
* **Waline** comment system supported by [Waline](https://waline.js.org/)
|
||||
* **Facebook comments** system supported by [Facebook](https://developers.facebook.com/docs/plugins/comments/)
|
||||
* **Telegram comments** system supported by [Telegram Comments](https://comments.app/)
|
||||
* **Commento** comment system supported by [Commento](https://commento.io/)
|
||||
* **Utterances** comment system supported by [Utterances](https://utteranc.es/)
|
||||
* **Artalk** comment system supported by [Artalk](https://artalk.js.org/)
|
||||
* **Twikoo** comment system supported by [Twikoo](https://twikoo.js.org/)
|
||||
* **giscus** comment system supported by [giscus](https://giscus.app/)
|
||||
- **Gravatar** supported by [Gravatar](https://gravatar.com)
|
||||
- Local **Avatar** supported
|
||||
- Up to **87** social links supported
|
||||
- Up to **28** share sites supported
|
||||
- **Disqus** comment system supported by [Disqus](https://disqus.com)
|
||||
- **Gitalk** comment system supported by [Gitalk](https://github.com/gitalk/gitalk)
|
||||
- **Valine** comment system supported by [Valine](https://valine.js.org/)
|
||||
- **Waline** comment system supported by [Waline](https://waline.js.org/)
|
||||
- **Facebook comments** system supported by [Facebook](https://developers.facebook.com/docs/plugins/comments/)
|
||||
- **Telegram comments** system supported by [Telegram Comments](https://comments.app/)
|
||||
- **Commento** comment system supported by [Commento](https://commento.io/)
|
||||
- **Utterances** comment system supported by [Utterances](https://utteranc.es/)
|
||||
- **Artalk** comment system supported by [Artalk](https://artalk.js.org/)
|
||||
- **Twikoo** comment system supported by [Twikoo](https://twikoo.js.org/)
|
||||
- **giscus** comment system supported by [giscus](https://giscus.app/)
|
||||
|
||||
### Extended Features
|
||||
|
||||
* **PWA (Progressive Web App)** supported
|
||||
* **Sub Menu** supported
|
||||
* **Content Encryption** supported (Pages, Partial)
|
||||
* **Friends** page embedded template
|
||||
* **Search** supported by [Lunr.js](https://lunrjs.com/) or [algolia](https://www.algolia.com/) or [Fuse.js](https://fusejs.io/)
|
||||
* **Twemoji** supported
|
||||
* Automatically **highlighting** code
|
||||
* **Copy code** to clipboard with one click
|
||||
* **Images gallery** supported by [lightgallery](https://github.com/sachinchoolur/lightgallery)
|
||||
* Extended Markdown syntax for **[Font Awesome](https://fontawesome.com/) icons**
|
||||
* Extended Markdown syntax for **ruby annotation**
|
||||
* Extended Markdown syntax for **fraction**
|
||||
* **Mathematical formula** supported by [KaTeX](https://katex.org/)
|
||||
* **Diagrams** shortcode supported by [mermaid](https://github.com/knsv/mermaid)
|
||||
* **Interactive data visualization** shortcode supported by [ECharts](https://echarts.apache.org/)
|
||||
* **Mapbox** shortcode supported by [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js)
|
||||
* **Music player** shortcode supported by [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS)
|
||||
* **Bilibili player** shortcode
|
||||
* Kinds of **admonitions** shortcode
|
||||
* **Custom style** shortcode
|
||||
* **Custom script** shortcode
|
||||
* **Animated typing** supported by [TypeIt](https://typeitjs.com/)
|
||||
* **Cookie consent banner** supported by [cookieconsent](https://github.com/osano/cookieconsent)
|
||||
* **Web Watermark** supported by [cell-watermark](https://github.com/Lruihao/watermark)
|
||||
* **Chinese typesetting** supported by [pangu.js](https://github.com/vinta/pangu.js)
|
||||
* ...
|
||||
- **PWA (Progressive Web App)** supported
|
||||
- **Sub Menu** supported
|
||||
- **Content Encryption** supported (Pages, Partial)
|
||||
- **Friends** page embedded template
|
||||
- **Search** supported by [algolia](https://www.algolia.com/) or [Fuse.js](https://fusejs.io/)
|
||||
- **Twemoji** supported
|
||||
- Automatically **highlighting** code
|
||||
- **Copy code** to clipboard with one click
|
||||
- **Images gallery** supported by [lightgallery](https://github.com/sachinchoolur/lightgallery)
|
||||
- Extended Markdown syntax for **[Font Awesome](https://fontawesome.com/) icons**
|
||||
- Extended Markdown syntax for **ruby annotation**
|
||||
- Extended Markdown syntax for **fraction**
|
||||
- **Mathematical formula** supported by [KaTeX](https://katex.org/)
|
||||
- **Diagrams** shortcode supported by [mermaid](https://github.com/knsv/mermaid)
|
||||
- **Interactive data visualization** shortcode supported by [ECharts](https://echarts.apache.org/)
|
||||
- **Mapbox** shortcode supported by [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js)
|
||||
- **Music player** shortcode supported by [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS)
|
||||
- **Bilibili player** shortcode
|
||||
- Kinds of **admonitions** shortcode
|
||||
- **Custom style** shortcode
|
||||
- **Custom script** shortcode
|
||||
- **Animated typing** supported by [TypeIt](https://typeitjs.com/)
|
||||
- **Cookie consent banner** supported by [cookieconsent](https://github.com/osano/cookieconsent)
|
||||
- **Web Watermark** supported by [cell-watermark](https://github.com/Lruihao/watermark)
|
||||
- **Chinese typesetting** supported by [pangu.js](https://github.com/vinta/pangu.js)
|
||||
- Options to **cache remote image** locally
|
||||
- ...
|
||||
|
||||
## Multilingual and i18n
|
||||
|
||||
FixIt supports the following languages:
|
||||
|
||||
* English
|
||||
* Simplified Chinese
|
||||
* Traditional Chinese
|
||||
* French
|
||||
* Polish
|
||||
* Brazilian Portuguese
|
||||
* Italian
|
||||
* Spanish
|
||||
* German
|
||||
* Serbian
|
||||
* Russian
|
||||
* Romanian
|
||||
* Vietnamese
|
||||
* [Contribute with a new language](https://github.com/hugo-fixit/FixIt/pulls)
|
||||
- English
|
||||
- Simplified Chinese
|
||||
- Traditional Chinese
|
||||
- French
|
||||
- Polish
|
||||
- Brazilian Portuguese
|
||||
- Italian
|
||||
- Spanish
|
||||
- German
|
||||
- Serbian
|
||||
- Russian
|
||||
- Romanian
|
||||
- Vietnamese
|
||||
- [Contribute with a new language](https://github.com/hugo-fixit/FixIt/pulls)
|
||||
|
||||
[Languages Compatibility](https://fixit.lruihao.cn/theme-documentation-basics/#language-compatibility)
|
||||
[Languages Compatibility](https://fixit.lruihao.cn/documentation/basics/#language-compatibility)
|
||||
|
||||
## [Roadmap](https://github.com/hugo-fixit/FixIt/projects/1)
|
||||
|
||||
@@ -189,50 +183,48 @@ Make sure that you follow [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) while contrib
|
||||
<details open>
|
||||
<summary>Thanks to the authors of following resources included in the theme:</summary>
|
||||
|
||||
* [normalize.css](https://github.com/necolas/normalize.css)
|
||||
* [Font Awesome](https://fontawesome.com/)
|
||||
* [Simple Icons](https://github.com/simple-icons/simple-icons)
|
||||
* [Animate.css](https://daneden.github.io/animate.css/)
|
||||
* [autocomplete-js](https://github.com/algolia/autocomplete)
|
||||
* [Lunr.js](https://lunrjs.com/)
|
||||
* [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
|
||||
* [Fuse.js](https://fusejs.io/)
|
||||
* [lazysizes](https://github.com/aFarkas/lazysizes)
|
||||
* [object-fit-images](https://github.com/fregante/object-fit-images)
|
||||
* [Twemoji](https://github.com/twitter/twemoji)
|
||||
* [emoji-data](https://github.com/iamcal/emoji-data)
|
||||
* [lightgallery](https://github.com/sachinchoolur/lightgallery)
|
||||
* [Sharer.js](https://github.com/ellisonleao/sharer.js)
|
||||
* [TypeIt](https://typeitjs.com/)
|
||||
* [KaTeX](https://katex.org/)
|
||||
* [mermaid](https://github.com/mermaid-js/mermaid)
|
||||
* [ECharts](https://echarts.apache.org/)
|
||||
* [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js)
|
||||
* [APlayer](https://github.com/MoePlayer/APlayer)
|
||||
* [MetingJS](https://github.com/metowolf/MetingJS)
|
||||
* [Gitalk](https://github.com/gitalk/gitalk)
|
||||
* [Valine](https://valine.js.org/)
|
||||
* [cookieconsent](https://github.com/osano/cookieconsent)
|
||||
* [cell-watermark](https://github.com/Lruihao/watermark)
|
||||
* [不蒜子](http://busuanzi.ibruce.info/)
|
||||
* [pangu.js](https://github.com/vinta/pangu.js)
|
||||
* [Artalk](https://artalk.js.org/)
|
||||
* [Waline](https://waline.js.org/)
|
||||
* [Twikoo](https://twikoo.js.org/)
|
||||
* [github-corners](https://github.com/tholman/github-corners)
|
||||
* [giscus](https://giscus.app/)
|
||||
* [crypto-js](https://github.com/brix/crypto-js)
|
||||
* [vConsole](https://github.com/Tencent/vConsole)
|
||||
* [eruda](https://github.com/liriliri/eruda)
|
||||
* [pace](https://github.com/CodeByZach/pace)
|
||||
- [normalize.css](https://github.com/necolas/normalize.css)
|
||||
- [Font Awesome](https://fontawesome.com/)
|
||||
- [Simple Icons](https://github.com/simple-icons/simple-icons)
|
||||
- [Animate.css](https://daneden.github.io/animate.css/)
|
||||
- [autocomplete-js](https://github.com/algolia/autocomplete)
|
||||
- [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
|
||||
- [Fuse.js](https://fusejs.io/)
|
||||
- [object-fit-images](https://github.com/fregante/object-fit-images)
|
||||
- [Twemoji](https://github.com/twitter/twemoji)
|
||||
- [emoji-data](https://github.com/iamcal/emoji-data)
|
||||
- [lightgallery](https://github.com/sachinchoolur/lightgallery)
|
||||
- [Sharer.js](https://github.com/ellisonleao/sharer.js)
|
||||
- [TypeIt](https://typeitjs.com/)
|
||||
- [KaTeX](https://katex.org/)
|
||||
- [mermaid](https://github.com/mermaid-js/mermaid)
|
||||
- [ECharts](https://echarts.apache.org/)
|
||||
- [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js)
|
||||
- [APlayer](https://github.com/MoePlayer/APlayer)
|
||||
- [MetingJS](https://github.com/metowolf/MetingJS)
|
||||
- [Gitalk](https://github.com/gitalk/gitalk)
|
||||
- [Valine](https://valine.js.org/)
|
||||
- [cookieconsent](https://github.com/osano/cookieconsent)
|
||||
- [cell-watermark](https://github.com/Lruihao/watermark)
|
||||
- [不蒜子](http://busuanzi.ibruce.info/)
|
||||
- [pangu.js](https://github.com/vinta/pangu.js)
|
||||
- [Artalk](https://artalk.js.org/)
|
||||
- [Waline](https://waline.js.org/)
|
||||
- [Twikoo](https://twikoo.js.org/)
|
||||
- [github-corners](https://github.com/tholman/github-corners)
|
||||
- [giscus](https://giscus.app/)
|
||||
- [crypto-js](https://github.com/brix/crypto-js)
|
||||
- [vConsole](https://github.com/Tencent/vConsole)
|
||||
- [eruda](https://github.com/liriliri/eruda)
|
||||
- [pace](https://github.com/CodeByZach/pace)
|
||||
|
||||
</details>
|
||||
|
||||
<details open>
|
||||
<summary>The FixIt also draws on some features of the following projects, and thanks to their authors as well:</summary>
|
||||
|
||||
* [DoIt](https://github.com/HEIGE-PCloud/DoIt)
|
||||
* [NexT](https://github.com/next-theme/hexo-theme-next)
|
||||
- [DoIt](https://github.com/HEIGE-PCloud/DoIt)
|
||||
- [NexT](https://github.com/next-theme/hexo-theme-next)
|
||||
|
||||
</details>
|
||||
|
||||
@@ -242,14 +234,15 @@ FixIt is licensed under the **MIT** license. Check the [LICENSE file](LICENSE) f
|
||||
|
||||
## Author
|
||||
|
||||
[Lruihao](https://lruihao.cn)
|
||||
[Lruihao](https://github.com/Lruihao "Follow me on GitHub")
|
||||
|
||||
## Sponsor
|
||||
|
||||
Giving me a Star 🌟 is already the greatest encouragement and support for me.\
|
||||
If you enjoy the theme, please consider buying me a coffee ☕️.
|
||||
|
||||
* [PayPal](https://paypal.me/Lruihao)
|
||||
* [Alipay](images/alipay.gif)
|
||||
* [Wechat](images/wechatpay.gif)
|
||||
- [PayPal](https://paypal.me/Lruihao)
|
||||
- [Alipay](images/alipay.jpg)
|
||||
- [Wechat](images/wechatpay.jpg)
|
||||
|
||||
Thanks! ❤️
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# FixIt 主题 | Hugo
|
||||
|
||||
[](https://github.com/hugo-fixit/FixIt/releases)
|
||||
[](https://gohugo.io/)
|
||||
[](https://gohugo.io/)
|
||||
[](/LICENSE)
|
||||
|
||||
👉 [English README](README.md) | 简体中文说明
|
||||
@@ -14,27 +14,26 @@ FixIt 主题继承了这些主题的优秀功能,并在此基础上添加了
|
||||
|
||||

|
||||
|
||||
## [立即开始](https://fixit.lruihao.cn/zh-cn/categories/documentation/)
|
||||
## 快速上手
|
||||
|
||||
前往这篇 [文档](https://fixit.lruihao.cn/zh-cn/theme-documentation-basics/),阅读关于安装与使用的详细指南。
|
||||
前往 [快速上手页面](https://fixit.lruihao.cn/zh-cn/documentation/getting-started/) 或从一个模板直接开始:
|
||||
|
||||
或者,在本地构建 [文档](https://fixit.lruihao.cn/zh-cn/):
|
||||
- [hugo-fixit/hugo-fixit-blog-git](https://github.com/hugo-fixit/hugo-fixit-blog-git)
|
||||
- [hugo-fixit/hugo-fixit-blog-go](https://github.com/hugo-fixit/hugo-fixit-blog-go)
|
||||
|
||||
> Gitee 镜像仓库:<https://gitee.com/lruihao/FixIt>
|
||||
## [完整文档](https://fixit.lruihao.cn/zh-cn/categories/documentation/)
|
||||
|
||||
```bash
|
||||
git clone --recursive https://github.com/hugo-fixit/FixIt.git && cd FixIt
|
||||
前往这篇 [文档](https://fixit.lruihao.cn/zh-cn/documentation/basics/),阅读关于安装与使用的详细指南。
|
||||
|
||||
hugo server --source=docs
|
||||
```
|
||||
或者在本地运行 [文档站点](https://fixit.lruihao.cn/zh-cn/),更多细节详见 [参与贡献](#参与贡献)。
|
||||
|
||||
除此之外,还有 [FixIt 主题维基](https://github.com/hugo-fixit/FixIt/wiki)。
|
||||
|
||||
## 安装或迁移
|
||||
## 从 LoveIt 迁移
|
||||
|
||||
如果你现在正在使用 LoveIt 主题(或者一些其他的主题),你可以很容易地迁移至 FixIt。
|
||||
|
||||
你可以将这个主题仓库添加为你的网站目录的子模块。或者,您可以通过其他方式 [安装主题](https://fixit.lruihao.cn/zh-cn/theme-documentation-basics/#install-theme)。
|
||||
你可以将这个主题仓库添加为你的网站目录的子模块。或者,你可以通过 [其他方式](https://fixit.lruihao.cn/zh-cn/documentation/basics/#install-theme) 安装主题。
|
||||
|
||||
```bash
|
||||
git submodule add https://github.com/hugo-fixit/FixIt.git themes/FixIt
|
||||
@@ -46,7 +45,7 @@ git submodule add https://github.com/hugo-fixit/FixIt.git themes/FixIt
|
||||
git submodule update --remote --merge
|
||||
```
|
||||
|
||||
接着,前往 `config.toml` 并将默认主题更改为 `FixIt`。
|
||||
接着,前往 `hugo.toml` 并将默认主题更改为 `FixIt`。
|
||||
|
||||
```diff
|
||||
- theme = "LoveIt"
|
||||
@@ -59,11 +58,11 @@ git submodule update --remote --merge
|
||||
|
||||
FixIt 主题继承了 LoveIt 等主题的优秀功能,并在它们的基础上添加了新的功能与优化,详见 [特性](#特性)。除此之外,FixIt 主题还有以下优点:
|
||||
|
||||
* 完善的中英文官方文档
|
||||
* 社区支持:主题官网、Discussions 和官方 QQ 群
|
||||
* 持续积极地更新
|
||||
* 不断收纳各方的建议和想法
|
||||
* 高度开放主题可自定义部分
|
||||
- 完善的中英文官方文档
|
||||
- 社区支持:主题官网、Discussions 和官方 QQ 群
|
||||
- 持续积极地更新
|
||||
- 不断收纳各方的建议和想法
|
||||
- 高度开放主题可自定义部分
|
||||
|
||||
总之,如果你更偏好 FixIt 主题的设计语言和自由度,如果你和我一样喜欢个性化自定义主题,那么,FixIt 主题可能是更适合你。
|
||||
|
||||
@@ -71,100 +70,93 @@ FixIt 主题继承了 LoveIt 等主题的优秀功能,并在它们的基础上
|
||||
|
||||
为了直观地浏览主题特性,这里有一些基于 **FixIt** 主题渲染的 [预览网站](https://fixit.lruihao.cn/zh-cn/friends/)。
|
||||
|
||||
| 站点 | 仓库 |
|
||||
| :----------------------------------------------------------- | :---------------------------------------------------------- |
|
||||
| [FixIt 主题官网](https://fixit.lruihao.cn), [FixIt 预览版](https://pre.fixit.lruihao.cn) | [hugo-fixit/docs](https://github.com/hugo-fixit/docs) |
|
||||
| [FixIt 博客模板 - Git](https://demo.fixit.lruihao.cn) | [hugo-fixit/hugo-fixit-blog-git](https://github.com/hugo-fixit/hugo-fixit-blog-git) |
|
||||
| [FixIt 博客模板 - Go](https://demo.fixit.lruihao.cn) | [hugo-fixit/hugo-fixit-blog-go](https://github.com/hugo-fixit/hugo-fixit-blog-go) |
|
||||
| [李瑞豪的博客](https://lruihao.cn) | [Lruihao/hugo-blog](https://github.com/Lruihao/hugo-blog) |
|
||||
|
||||
## 特性
|
||||
|
||||
### 性能和 SEO
|
||||
|
||||
* **性能**优化:在 [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights) 中, 99/100 的移动设备得分和 100/100 的桌面设备得分
|
||||
* 使用基于 JSON-LD 格式 的 **SEO SCHEMA** 文件进行 SEO 优化
|
||||
* 支持 **[Google Analytics](https://analytics.google.com/analytics)**
|
||||
* 支持 **[Fathom Analytics](https://usefathom.com/)**
|
||||
* 支持搜索引擎的**网站验证** (Google, Bing, Yandex, Pinterest, Baidu, 360 and Sogou)
|
||||
* 支持所有第三方库的 **CDN**
|
||||
* 基于 [lazysizes](https://github.com/aFarkas/lazysizes) 自动转换图片为**懒加载**
|
||||
- **性能**优化:在 [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights) 中,99/100 的移动设备得分和 100/100 的桌面设备得分
|
||||
- 使用基于 JSON-LD 格式 的 **SEO SCHEMA** 文件进行 SEO 优化
|
||||
- 支持 **[Google Analytics](https://analytics.google.com/analytics)**
|
||||
- 支持 **[Fathom Analytics](https://usefathom.com/)**
|
||||
- 支持搜索引擎的**网站验证** (Google, Bing, Yandex, Pinterest, Baidu, 360 and Sogou)
|
||||
- 支持所有第三方库的 **CDN**
|
||||
|
||||
### 外观和布局
|
||||
|
||||
* **响应式**布局
|
||||
* **浅色/深色** 主题模式
|
||||
* 全局一致的**设计语言**
|
||||
* 支持**分页**
|
||||
* 易用和自动展开的**文章目录**
|
||||
* 支持**多语言**和国际化
|
||||
* 美观的 **CSS 动画**
|
||||
- **响应式**布局
|
||||
- **浅色/深色** 主题模式
|
||||
- 全局一致的**设计语言**
|
||||
- 支持**分页**
|
||||
- 易用和自动展开的**文章目录**
|
||||
- 支持**多语言**和国际化
|
||||
- 美观的 **CSS 动画**
|
||||
|
||||
### 社交和评论系统
|
||||
|
||||
* 支持 **[Gravatar](https://gravatar.com)** 头像
|
||||
* 支持本地**头像**
|
||||
* 支持多达 **87** 种社交链接
|
||||
* 支持多达 **28** 种网站分享
|
||||
* 支持 **[Disqus](https://disqus.com)** 评论系统
|
||||
* 支持 **[Gitalk](https://github.com/gitalk/gitalk)** 评论系统
|
||||
* 支持 **[Valine](https://valine.js.org/)** 评论系统
|
||||
* 支持 **[Waline](https://waline.js.org/)** 评论系统
|
||||
* 支持 **[Facebook](https://developers.facebook.com/docs/plugins/comments/) 评论**系统
|
||||
* 支持 **[Telegram comments](https://comments.app/) 评论**系统
|
||||
* 支持 **[Commento](https://commento.io/)** 评论系统
|
||||
* 支持 **[Utterances](https://utteranc.es/)** 评论系统
|
||||
* 支持 **[Artalk](https://artalk.js.org/)** 评论系统
|
||||
* 支持 **[Twikoo](https://twikoo.js.org/)** 评论系统
|
||||
* 支持 **[giscus](https://giscus.app/zh-CN/)** 评论系统
|
||||
- 支持 **[Gravatar](https://gravatar.com)** 头像
|
||||
- 支持本地**头像**
|
||||
- 支持多达 **87** 种社交链接
|
||||
- 支持多达 **28** 种网站分享
|
||||
- 支持 **[Disqus](https://disqus.com)** 评论系统
|
||||
- 支持 **[Gitalk](https://github.com/gitalk/gitalk)** 评论系统
|
||||
- 支持 **[Valine](https://valine.js.org/)** 评论系统
|
||||
- 支持 **[Waline](https://waline.js.org/)** 评论系统
|
||||
- 支持 **[Facebook](https://developers.facebook.com/docs/plugins/comments/) 评论**系统
|
||||
- 支持 **[Telegram comments](https://comments.app/) 评论**系统
|
||||
- 支持 **[Commento](https://commento.io/)** 评论系统
|
||||
- 支持 **[Utterances](https://utteranc.es/)** 评论系统
|
||||
- 支持 **[Artalk](https://artalk.js.org/)** 评论系统
|
||||
- 支持 **[Twikoo](https://twikoo.js.org/)** 评论系统
|
||||
- 支持 **[giscus](https://giscus.app/zh-CN/)** 评论系统
|
||||
|
||||
### 扩展功能
|
||||
|
||||
* 支持**渐进式网页应用**
|
||||
* 支持**二级菜单**
|
||||
* 支持**内容加密**(页面、局部)
|
||||
* 支持**友情链接**的页面模板
|
||||
* 支持基于 [Lunr.js](https://lunrjs.com/) 或 [algolia](https://www.algolia.com/) 或 [Fuse.js](https://fusejs.io/) 的**搜索**
|
||||
* 支持 **Twemoji**
|
||||
* 支持**代码高亮**
|
||||
* 一键**复制代码**到剪贴板
|
||||
* 支持基于 [lightgallery](https://github.com/sachinchoolur/lightgallery) 的**图片画廊**
|
||||
* 支持 **[Font Awesome](https://fontawesome.com/) 图标**的扩展 Markdown 语法
|
||||
* 支持**上标注释**的扩展 Markdown 语法
|
||||
* 支持**分数**的扩展 Markdown 语法
|
||||
* 支持基于 [KaTeX](https://katex.org/) 的**数学公式**
|
||||
* 支持基于 [mermaid](https://github.com/knsv/mermaid) 的**图表** shortcode
|
||||
* 支持基于 [ECharts](https://echarts.apache.org/) 的**交互式数据可视化** shortcode
|
||||
* 支持基于 [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js) 的 **Mapbox** shortcode
|
||||
* 支持基于 [APlayer](https://github.com/MoePlayer/APlayer) 和 [MetingJS](https://github.com/metowolf/MetingJS) 的**音乐播放器** shortcode
|
||||
* 支持 **Bilibili 视频** shortcode
|
||||
* 支持多种**注释**的 shortcode
|
||||
* 支持**自定义样式**的 shortcode
|
||||
* 支持**自定义脚本**的 shortcode
|
||||
* 支持基于 [TypeIt](https://typeitjs.com/) 的**打字动画** shortcode
|
||||
* 支持基于 [cookieconsent](https://github.com/osano/cookieconsent) 的 **Cookie 许可横幅**
|
||||
* 支持基于 [cell-watermark](https://github.com/Lruihao/watermark) 的**网页水印**
|
||||
* 支持基于 [pangu.js](https://github.com/vinta/pangu.js) 的**中文排版**
|
||||
* ...
|
||||
- 支持**渐进式网页应用**
|
||||
- 支持**二级菜单**
|
||||
- 支持**内容加密**(页面、局部)
|
||||
- 支持**友情链接**的页面模板
|
||||
- 支持基于 [algolia](https://www.algolia.com/) 或 [Fuse.js](https://fusejs.io/) 的**搜索**
|
||||
- 支持 **Twemoji**
|
||||
- 支持**代码高亮**
|
||||
- 一键**复制代码**到剪贴板
|
||||
- 支持基于 [lightgallery](https://github.com/sachinchoolur/lightgallery) 的**图片画廊**
|
||||
- 支持 **[Font Awesome](https://fontawesome.com/) 图标**的扩展 Markdown 语法
|
||||
- 支持**上标注释**的扩展 Markdown 语法
|
||||
- 支持**分数**的扩展 Markdown 语法
|
||||
- 支持基于 [KaTeX](https://katex.org/) 的**数学公式**
|
||||
- 支持基于 [mermaid](https://github.com/knsv/mermaid) 的**图表** shortcode
|
||||
- 支持基于 [ECharts](https://echarts.apache.org/) 的**交互式数据可视化** shortcode
|
||||
- 支持基于 [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js) 的 **Mapbox** shortcode
|
||||
- 支持基于 [APlayer](https://github.com/MoePlayer/APlayer) 和 [MetingJS](https://github.com/metowolf/MetingJS) 的**音乐播放器** shortcode
|
||||
- 支持 **Bilibili 视频** shortcode
|
||||
- 支持多种**注释**的 shortcode
|
||||
- 支持**自定义样式**的 shortcode
|
||||
- 支持**自定义脚本**的 shortcode
|
||||
- 支持基于 [TypeIt](https://typeitjs.com/) 的**打字动画** shortcode
|
||||
- 支持基于 [cookieconsent](https://github.com/osano/cookieconsent) 的 **Cookie 许可横幅**
|
||||
- 支持基于 [cell-watermark](https://github.com/Lruihao/watermark) 的**网页水印**
|
||||
- 支持基于 [pangu.js](https://github.com/vinta/pangu.js) 的**中文排版**
|
||||
- 支持本地**缓存远程图床图片**
|
||||
- ……
|
||||
|
||||
## 多语言和国际化
|
||||
|
||||
FixIt 支持下列语言:
|
||||
|
||||
* 英语
|
||||
* 简体中文
|
||||
* 繁体中文
|
||||
* 法语
|
||||
* 波兰语
|
||||
* 巴西葡萄牙语
|
||||
* 意大利语
|
||||
* 西班牙语
|
||||
* 德语
|
||||
* 塞尔维亚语
|
||||
* 俄语
|
||||
* 罗马尼亚语
|
||||
* 越南语
|
||||
* [贡献一种新的语言](https://github.com/hugo-fixit/FixIt/pulls)
|
||||
- 英语
|
||||
- 简体中文
|
||||
- 繁体中文
|
||||
- 法语
|
||||
- 波兰语
|
||||
- 巴西葡萄牙语
|
||||
- 意大利语
|
||||
- 西班牙语
|
||||
- 德语
|
||||
- 塞尔维亚语
|
||||
- 俄语
|
||||
- 罗马尼亚语
|
||||
- 越南语
|
||||
- [贡献一种新的语言](https://github.com/hugo-fixit/FixIt/pulls)
|
||||
|
||||
[语言兼容性](https://fixit.lruihao.cn/zh-cn/theme-documentation-basics/#language-compatibility)
|
||||
|
||||
@@ -182,59 +174,61 @@ FixIt 支持下列语言:
|
||||
|
||||
确保在贡献和参与讨论时遵守 [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)。
|
||||
|
||||
**贡献时,请先通过此存储库上的问题讨论您希望进行的更改,然后再进行实际更改**。
|
||||
**贡献时,请先通过此存储库上的问题讨论你希望进行的更改,然后再进行实际更改**。
|
||||
|
||||
## [所有贡献者](contributors.md)
|
||||
|
||||
## 镜像
|
||||
|
||||
- Gitee 镜像仓库:<https://gitee.com/lruihao/FixIt>
|
||||
|
||||
## 致谢
|
||||
|
||||
<details open>
|
||||
<summary>FixIt 主题中用到了以下项目,感谢它们的作者:</summary>
|
||||
|
||||
* [normalize.css](https://github.com/necolas/normalize.css)
|
||||
* [Font Awesome](https://fontawesome.com/)
|
||||
* [Simple Icons](https://github.com/simple-icons/simple-icons)
|
||||
* [Animate.css](https://daneden.github.io/animate.css/)
|
||||
* [autocomplete-js](https://github.com/algolia/autocomplete)
|
||||
* [Lunr.js](https://lunrjs.com/)
|
||||
* [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
|
||||
* [Fuse.js](https://fusejs.io/)
|
||||
* [lazysizes](https://github.com/aFarkas/lazysizes)
|
||||
* [object-fit-images](https://github.com/fregante/object-fit-images)
|
||||
* [Twemoji](https://github.com/twitter/twemoji)
|
||||
* [emoji-data](https://github.com/iamcal/emoji-data)
|
||||
* [lightgallery](https://github.com/sachinchoolur/lightgallery)
|
||||
* [Sharer.js](https://github.com/ellisonleao/sharer.js)
|
||||
* [TypeIt](https://typeitjs.com/)
|
||||
* [KaTeX](https://katex.org/)
|
||||
* [mermaid](https://github.com/mermaid-js/mermaid)
|
||||
* [ECharts](https://echarts.apache.org/)
|
||||
* [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js)
|
||||
* [APlayer](https://github.com/MoePlayer/APlayer)
|
||||
* [MetingJS](https://github.com/metowolf/MetingJS)
|
||||
* [Gitalk](https://github.com/gitalk/gitalk)
|
||||
* [Valine](https://valine.js.org/)
|
||||
* [cookieconsent](https://github.com/osano/cookieconsent)
|
||||
* [cell-watermark](https://github.com/Lruihao/watermark)
|
||||
* [不蒜子](http://busuanzi.ibruce.info/)
|
||||
* [pangu.js](https://github.com/vinta/pangu.js)
|
||||
* [Artalk](https://artalk.js.org/)
|
||||
* [Waline](https://waline.js.org/)
|
||||
* [Twikoo](https://twikoo.js.org/)
|
||||
* [github-corners](https://github.com/tholman/github-corners)
|
||||
* [giscus](https://giscus.app/zh-CN)
|
||||
* [crypto-js](https://github.com/brix/crypto-js)
|
||||
* [vConsole](https://github.com/Tencent/vConsole)
|
||||
* [eruda](https://github.com/liriliri/eruda)
|
||||
* [pace](https://github.com/CodeByZach/pace)
|
||||
- [normalize.css](https://github.com/necolas/normalize.css)
|
||||
- [Font Awesome](https://fontawesome.com/)
|
||||
- [Simple Icons](https://github.com/simple-icons/simple-icons)
|
||||
- [Animate.css](https://daneden.github.io/animate.css/)
|
||||
- [autocomplete-js](https://github.com/algolia/autocomplete)
|
||||
- [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
|
||||
- [Fuse.js](https://fusejs.io/)
|
||||
- [object-fit-images](https://github.com/fregante/object-fit-images)
|
||||
- [Twemoji](https://github.com/twitter/twemoji)
|
||||
- [emoji-data](https://github.com/iamcal/emoji-data)
|
||||
- [lightgallery](https://github.com/sachinchoolur/lightgallery)
|
||||
- [Sharer.js](https://github.com/ellisonleao/sharer.js)
|
||||
- [TypeIt](https://typeitjs.com/)
|
||||
- [KaTeX](https://katex.org/)
|
||||
- [mermaid](https://github.com/mermaid-js/mermaid)
|
||||
- [ECharts](https://echarts.apache.org/)
|
||||
- [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js)
|
||||
- [APlayer](https://github.com/MoePlayer/APlayer)
|
||||
- [MetingJS](https://github.com/metowolf/MetingJS)
|
||||
- [Gitalk](https://github.com/gitalk/gitalk)
|
||||
- [Valine](https://valine.js.org/)
|
||||
- [cookieconsent](https://github.com/osano/cookieconsent)
|
||||
- [cell-watermark](https://github.com/Lruihao/watermark)
|
||||
- [不蒜子](http://busuanzi.ibruce.info/)
|
||||
- [pangu.js](https://github.com/vinta/pangu.js)
|
||||
- [Artalk](https://artalk.js.org/)
|
||||
- [Waline](https://waline.js.org/)
|
||||
- [Twikoo](https://twikoo.js.org/)
|
||||
- [github-corners](https://github.com/tholman/github-corners)
|
||||
- [giscus](https://giscus.app/zh-CN)
|
||||
- [crypto-js](https://github.com/brix/crypto-js)
|
||||
- [vConsole](https://github.com/Tencent/vConsole)
|
||||
- [eruda](https://github.com/liriliri/eruda)
|
||||
- [pace](https://github.com/CodeByZach/pace)
|
||||
|
||||
</details>
|
||||
|
||||
<details open>
|
||||
<summary>FixIt 主题还借鉴了以下项目的部分功能,同样感谢它们的作者:</summary>
|
||||
|
||||
* [DoIt](https://github.com/HEIGE-PCloud/DoIt)
|
||||
* [NexT](https://github.com/next-theme/hexo-theme-next)
|
||||
- [DoIt](https://github.com/HEIGE-PCloud/DoIt)
|
||||
- [NexT](https://github.com/next-theme/hexo-theme-next)
|
||||
|
||||
</details>
|
||||
|
||||
@@ -244,14 +238,15 @@ FixIt 根据 **MIT** 许可协议授权。 更多信息请查看 [LICENSE 文件
|
||||
|
||||
## 作者
|
||||
|
||||
[Lruihao](https://lruihao.cn)
|
||||
[Lruihao](https://github.com/Lruihao "在 GitHub 上关注我")
|
||||
|
||||
## 赞助支持
|
||||
|
||||
如果你喜爱这个主题,请考虑给我买杯咖啡 ☕️.
|
||||
给我一个 Star 🌟 已经是对我最大的鼓励和支持了。\
|
||||
如果你喜爱这个主题,请考虑给我买杯咖啡 ☕️。
|
||||
|
||||
* [PayPal](https://paypal.me/Lruihao)
|
||||
* [支付宝](images/alipay.gif)
|
||||
* [微信支付](images/wechatpay.gif)
|
||||
- [PayPal](https://paypal.me/Lruihao)
|
||||
- [支付宝](images/alipay.jpg)
|
||||
- [微信支付](images/wechatpay.jpg)
|
||||
|
||||
谢谢!❤️
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
| Version | Supported | LoveIt Compatibility |
|
||||
| :-----------: | :----------------: | :------------------: |
|
||||
| 0.1.x | :x: | :white_check_mark: |
|
||||
| 0.2.x ~ 0.5.x | :x: | :white_check_mark: |
|
||||
| 0.5.x ~ 1.0 | :white_check_mark: | :x: |
|
||||
| > 1.0 | :white_check_mark: | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you want to report a vulnerability, create a new issue at https://github.com/hugo-fixit/FixIt/issues. Any vulnerabilities will be fixed as soon as possible.
|
||||
@@ -1,8 +1,9 @@
|
||||
---
|
||||
title: "{{ replace .TranslationBaseName "-" " " | title }}"
|
||||
subtitle: ""
|
||||
title: {{ replace .TranslationBaseName "-" " " | title }}
|
||||
subtitle:
|
||||
date: {{ .Date }}
|
||||
description: ""
|
||||
keywords: ""
|
||||
comment: false
|
||||
slug: {{ substr .File.UniqueID 0 7 }}
|
||||
description:
|
||||
keywords:
|
||||
draft: true
|
||||
---
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
---
|
||||
title: "{{ replace .TranslationBaseName "-" " " | title }}"
|
||||
subtitle: ""
|
||||
type: "friends"
|
||||
title: {{ replace .TranslationBaseName "-" " " | title }}
|
||||
subtitle:
|
||||
layout: friends
|
||||
date: {{ .Date }}
|
||||
description: "{{ .Site.Author.name }}'s friends"
|
||||
keywords:
|
||||
- Hugo
|
||||
- friends template
|
||||
description: "{{ .Site.Params.author.name }}'s friends"
|
||||
keywords:
|
||||
- 'Hugo FixIt'
|
||||
- 'friends template'
|
||||
- 友情链接
|
||||
comment: false
|
||||
---
|
||||
|
||||
<!-- When you set data `friends.yml` in `yourProject/data/` directory, it will be automatically loaded here. -->
|
||||
|
||||
---
|
||||
|
||||
<!-- You can define additional content below for this page. -->
|
||||
|
||||
## Base info
|
||||
|
||||
```yaml
|
||||
@@ -25,7 +29,9 @@ comment: false
|
||||
## Friendly Reminder
|
||||
|
||||
{{< admonition info "Notice" true >}}
|
||||
|
||||
1. If you want to exchange link, please leave a comment in the above format. (personal non-commercial blogs / websites only)
|
||||
2. :(fa-solid fa-exclamation-triangle): Website failure, stop maintenance and improper content may be unlinked!
|
||||
3. Those websites that do not respect other people's labor achievements, reprint without source, or malicious acts, please do not come to exchange.
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
type: "offline"
|
||||
description: "{{ T "offlineTitle" }} - {{ .Site.Title }}"
|
||||
keywords:
|
||||
- PWA
|
||||
- offline
|
||||
- 离线
|
||||
---
|
||||
|
||||
<!-- You need do nothing for this page. -->
|
||||
@@ -1,45 +1,43 @@
|
||||
---
|
||||
title: "{{ replace .TranslationBaseName "-" " " | title }}"
|
||||
subtitle: ""
|
||||
title: {{ replace .TranslationBaseName "-" " " | title }}
|
||||
subtitle:
|
||||
date: {{ .Date }}
|
||||
slug: {{ substr .File.UniqueID 0 7 }}
|
||||
draft: true
|
||||
author: ""
|
||||
authorLink: ""
|
||||
authorEmail: ""
|
||||
description: ""
|
||||
keywords: ""
|
||||
license: ""
|
||||
author:
|
||||
name:
|
||||
link:
|
||||
email:
|
||||
avatar:
|
||||
description:
|
||||
keywords:
|
||||
license:
|
||||
comment: false
|
||||
weight: 0
|
||||
|
||||
tags:
|
||||
- draft
|
||||
- draft
|
||||
categories:
|
||||
- draft
|
||||
|
||||
- draft
|
||||
hiddenFromHomePage: false
|
||||
hiddenFromSearch: false
|
||||
|
||||
summary: ""
|
||||
hiddenFromRss: false
|
||||
hiddenFromRelated: false
|
||||
summary:
|
||||
resources:
|
||||
- name: featured-image
|
||||
src: featured-image.jpg
|
||||
- name: featured-image-preview
|
||||
src: featured-image-preview.jpg
|
||||
|
||||
toc:
|
||||
enable: true
|
||||
math:
|
||||
enable: false
|
||||
- name: featured-image
|
||||
src: featured-image.jpg
|
||||
- name: featured-image-preview
|
||||
src: featured-image-preview.jpg
|
||||
toc: true
|
||||
math: false
|
||||
lightgallery: false
|
||||
seo:
|
||||
images: []
|
||||
|
||||
password:
|
||||
message:
|
||||
repost:
|
||||
enable: true
|
||||
url: ""
|
||||
url:
|
||||
|
||||
# See details front matter: https://fixit.lruihao.cn/theme-documentation-content/#front-matter
|
||||
# See details front matter: https://fixit.lruihao.cn/documentation/content-management/introduction/#front-matter
|
||||
---
|
||||
|
||||
<!--more-->
|
||||
@@ -1,45 +1,43 @@
|
||||
---
|
||||
title: "{{ replace .TranslationBaseName "-" " " | title }}"
|
||||
subtitle: ""
|
||||
title: {{ replace .TranslationBaseName "-" " " | title }}
|
||||
subtitle:
|
||||
date: {{ .Date }}
|
||||
slug: {{ substr .File.UniqueID 0 7 }}
|
||||
draft: true
|
||||
author: ""
|
||||
authorLink: ""
|
||||
authorEmail: ""
|
||||
description: ""
|
||||
keywords: ""
|
||||
license: ""
|
||||
author:
|
||||
name:
|
||||
link:
|
||||
email:
|
||||
avatar:
|
||||
description:
|
||||
keywords:
|
||||
license:
|
||||
comment: false
|
||||
weight: 0
|
||||
|
||||
tags:
|
||||
- draft
|
||||
- draft
|
||||
categories:
|
||||
- draft
|
||||
|
||||
- draft
|
||||
hiddenFromHomePage: false
|
||||
hiddenFromSearch: false
|
||||
|
||||
summary: ""
|
||||
hiddenFromRss: false
|
||||
hiddenFromRelated: false
|
||||
summary:
|
||||
resources:
|
||||
- name: featured-image
|
||||
src: featured-image.jpg
|
||||
- name: featured-image-preview
|
||||
src: featured-image-preview.jpg
|
||||
|
||||
toc:
|
||||
enable: true
|
||||
math:
|
||||
enable: false
|
||||
- name: featured-image
|
||||
src: featured-image.jpg
|
||||
- name: featured-image-preview
|
||||
src: featured-image-preview.jpg
|
||||
toc: true
|
||||
math: false
|
||||
lightgallery: false
|
||||
seo:
|
||||
images: []
|
||||
|
||||
password:
|
||||
message:
|
||||
repost:
|
||||
enable: true
|
||||
url: ""
|
||||
url:
|
||||
|
||||
# See details front matter: https://fixit.lruihao.cn/theme-documentation-content/#front-matter
|
||||
# See details front matter: https://fixit.lruihao.cn/documentation/content-management/introduction/#front-matter
|
||||
---
|
||||
|
||||
<!--more-->
|
||||
|
||||
@@ -43,8 +43,25 @@ html {
|
||||
body {
|
||||
background-color: $global-background-color;
|
||||
color: $global-font-color;
|
||||
@include overflow-wrap(break-word);
|
||||
scrollbar-color: auto;
|
||||
@include overflow-wrap(break-word);
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 0.75rem;
|
||||
height: 0.75rem;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background-color: transparent;
|
||||
background-clip: content-box;
|
||||
border: 2px solid transparent;
|
||||
@include border-radius(0.5rem);
|
||||
}
|
||||
|
||||
&[data-scroll]::-webkit-scrollbar-thumb {
|
||||
background-color: $scrollbar-color;
|
||||
}
|
||||
|
||||
&[data-theme='dark'] {
|
||||
color: $global-font-color-dark;
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
.breadcrumb-container {
|
||||
padding-inline: 1rem;
|
||||
font-size: 0.75rem;
|
||||
background-color: $global-background-color;
|
||||
@include z-index(1);
|
||||
@extend .print-d-none;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: $global-background-color-dark;
|
||||
}
|
||||
|
||||
&.sticky {
|
||||
position: sticky;
|
||||
top: $header-height;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 0.5rem 0;
|
||||
margin: 0 auto;
|
||||
list-style: none;
|
||||
border-bottom: 1px inset $global-border-color;
|
||||
@extend %page-style;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
border-bottom-color: $global-border-color-dark;
|
||||
}
|
||||
|
||||
.breadcrumb-item {
|
||||
display: flex;
|
||||
|
||||
+.breadcrumb-item::before {
|
||||
content: "/";
|
||||
display: inline-block;
|
||||
padding-inline: 0.5rem;
|
||||
color: $global-font-secondary-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $global-font-secondary-color-dark;
|
||||
}
|
||||
}
|
||||
|
||||
&.active {
|
||||
@extend .text-secondary;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,19 +30,19 @@
|
||||
|
||||
.ms-1,
|
||||
.mx-1 {
|
||||
margin-left: 0.25rem !important;
|
||||
margin-left: 0.25em !important;
|
||||
}
|
||||
.me-1,
|
||||
.mx-1 {
|
||||
margin-right: 0.25rem !important;
|
||||
margin-right: 0.25em !important;
|
||||
}
|
||||
.ps-1,
|
||||
.px-1 {
|
||||
padding-left: 0.25rem !important;
|
||||
padding-left: 0.25em !important;
|
||||
}
|
||||
.pe-1,
|
||||
.px-1 {
|
||||
padding-right: 0.25rem !important;
|
||||
padding-right: 0.25em !important;
|
||||
}
|
||||
|
||||
@each $color, $value in $theme-colors {
|
||||
|
||||
@@ -4,6 +4,7 @@ footer {
|
||||
text-align: center;
|
||||
line-height: 1.25rem;
|
||||
padding: 1rem 0;
|
||||
@extend .print-d-none;
|
||||
|
||||
.footer-container {
|
||||
display: flex;
|
||||
@@ -19,10 +20,6 @@ footer {
|
||||
margin-right: 0.25rem;
|
||||
}
|
||||
|
||||
.fixit-icon {
|
||||
top: 0.25em;
|
||||
}
|
||||
|
||||
.animate-icon {
|
||||
color: #dc143c;
|
||||
animation: icon-animate 1.33s ease-in-out infinite;
|
||||
@@ -40,23 +37,23 @@ footer {
|
||||
@keyframes icon-animate {
|
||||
0%,
|
||||
100% {
|
||||
transform: scale(1);
|
||||
@include transform(scale(1));
|
||||
}
|
||||
|
||||
10%,
|
||||
30% {
|
||||
transform: scale(0.9);
|
||||
@include transform(scale(0.9));
|
||||
}
|
||||
|
||||
20%,
|
||||
40%,
|
||||
60%,
|
||||
80% {
|
||||
transform: scale(1.1);
|
||||
@include transform(scale(1.1));
|
||||
}
|
||||
|
||||
50%,
|
||||
70% {
|
||||
transform: scale(1.1);
|
||||
@include transform(scale(1.1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
header {
|
||||
width: 100%;
|
||||
z-index: 150;
|
||||
background-color: $header-background-color;
|
||||
@include z-index(2);
|
||||
@include transition(box-shadow 0.3s ease);
|
||||
@extend .print-d-none;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: $header-background-color-dark;
|
||||
@@ -10,6 +11,10 @@ header {
|
||||
|
||||
&:hover {
|
||||
@include box-shadow(0 0 1.5rem 0 rgba(0, 0, 0, 0.1));
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@include box-shadow(0 0 1.5rem 0 rgba(255, 255, 255, 0.1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +87,16 @@ header {
|
||||
}
|
||||
}
|
||||
|
||||
&.language,
|
||||
.menu-link i {
|
||||
@include transform(perspective(1rem));
|
||||
@include transition(transform 0.4s ease);
|
||||
}
|
||||
|
||||
.menu-link:hover i {
|
||||
@include transform(perspective(1rem) translateZ(0.2rem));
|
||||
}
|
||||
|
||||
&.language-switch,
|
||||
&.theme-switch {
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -216,10 +230,13 @@ header {
|
||||
flex-wrap: nowrap;
|
||||
float: right;
|
||||
|
||||
>.menu-item:hover {
|
||||
& .sub-menu {
|
||||
>.menu-item {
|
||||
&:hover .sub-menu {
|
||||
display: block;
|
||||
transform: translateX(-0.5rem);
|
||||
@include transform(translateX(-0.5rem));
|
||||
}
|
||||
&.language-switch:hover .sub-menu {
|
||||
@include transform(translateX(calc(1.75rem - 100%)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,20 +247,15 @@ header {
|
||||
width: 0;
|
||||
margin: 0.125rem 0.25rem;
|
||||
padding: 0;
|
||||
border-left: 1px dashed lighten($global-font-secondary-color, 20%);
|
||||
border-left: 1px dashed lighten($global-font-secondary-color, 15%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
border-left-color: darken($global-font-secondary-color-dark, 20%);
|
||||
border-left-color: darken($global-font-secondary-color-dark, 15%);
|
||||
}
|
||||
}
|
||||
|
||||
&.language {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.sub-menu {
|
||||
z-index: 160;
|
||||
position: absolute;
|
||||
margin: 0;
|
||||
padding: 0.25rem 0;
|
||||
@@ -253,14 +265,14 @@ header {
|
||||
border: 1px solid $global-border-color;
|
||||
background-color: $header-background-color;
|
||||
@include transition(box-shadow 0.3s ease);
|
||||
@include box-shadow(0 0 1.5rem 0 rgba(0, 0, 0, 0.1));
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: $header-background-color-dark;
|
||||
border-color: $global-border-color-dark;
|
||||
@include box-shadow(0 0 1.5rem 0 rgba(255, 255, 255, 0.1));
|
||||
}
|
||||
|
||||
@include box-shadow(0 0 1.5rem 0 rgba(0, 0, 0, 0.1));
|
||||
|
||||
.menu-item {
|
||||
height: $header-height*0.5;
|
||||
line-height: $header-height*0.5;
|
||||
@@ -351,9 +363,18 @@ header {
|
||||
background: $header-background-color;
|
||||
border-top: 2px solid $global-border-color;
|
||||
display: none;
|
||||
padding: 0.5rem 0 0;
|
||||
overflow-y: overlay;
|
||||
max-height: 70vh;
|
||||
@include box-shadow(0 0.125rem 0.25rem rgba(0, 0, 0, 0.1));
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@include box-shadow(0 0.125rem 0.25rem rgba(255, 255, 255, 0.1));
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.search-wrapper {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@@ -361,6 +382,14 @@ header {
|
||||
box-sizing: border-box;
|
||||
padding: ($header-height - 2.5rem) / 2 1rem;
|
||||
line-height: 2.5rem;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background-color: $header-background-color;
|
||||
@include z-index(0, 50);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: $header-background-color-dark;
|
||||
}
|
||||
}
|
||||
|
||||
.search {
|
||||
@@ -392,7 +421,7 @@ header {
|
||||
line-height: 2.5rem;
|
||||
padding: 0 1rem;
|
||||
|
||||
&:hover {
|
||||
&:not(.menu-system):hover {
|
||||
background-color: lighten($global-font-secondary-color, 24%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@@ -417,19 +446,37 @@ header {
|
||||
max-width: 80%;
|
||||
}
|
||||
}
|
||||
|
||||
&.theme-switch,
|
||||
&.language {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.menu-system {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 0.25rem;
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
line-height: 2.5rem;
|
||||
padding: 0 1rem;
|
||||
background-color: $header-background-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: $header-background-color-dark;
|
||||
}
|
||||
|
||||
.language-select {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.menu-system-item {
|
||||
padding-inline: 0.5rem;
|
||||
}
|
||||
|
||||
.language-switch {
|
||||
position: relative;
|
||||
|
||||
.language-select {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -483,10 +530,14 @@ header {
|
||||
|
||||
.search-dropdown {
|
||||
position: fixed;
|
||||
z-index: 200;
|
||||
top: $header-height;
|
||||
@include z-index(2);
|
||||
@include box-shadow(0 0.125rem 0.25rem rgba(0, 0, 0, 0.1));
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@include box-shadow(0 0.125rem 0.25rem rgba(255, 255, 255, 0.1));
|
||||
}
|
||||
|
||||
&.desktop {
|
||||
right: 2rem;
|
||||
width: 30rem;
|
||||
|
||||
@@ -8,28 +8,34 @@
|
||||
main {
|
||||
flex: 1 0 auto;
|
||||
|
||||
aside:first-child {
|
||||
order: 2;
|
||||
aside {
|
||||
flex: 1;
|
||||
padding: 0.5rem;
|
||||
|
||||
&:not(:has(~ aside)) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&.container {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
padding: 0 1rem;
|
||||
padding-inline: 1rem;
|
||||
gap: 0.5rem;
|
||||
|
||||
&.container-reverse {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
|
||||
&:has(.home:not(.posts)) {
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
&.container-reverse {
|
||||
@extend .container;
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@import "_core/header";
|
||||
@import "_core/footer";
|
||||
@import "_core/pagination";
|
||||
@import "_header";
|
||||
@import "_breadcrumb";
|
||||
@import "_footer";
|
||||
@import "_pagination";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@media only screen and (min-width: 1441px) {
|
||||
.page {
|
||||
%page-style {
|
||||
width: 60%;
|
||||
|
||||
[data-page-style='wide'] & {
|
||||
@@ -10,40 +10,20 @@
|
||||
max-width: 800px;
|
||||
}
|
||||
}
|
||||
|
||||
aside {
|
||||
width: 20%;
|
||||
|
||||
[data-page-style='wide'] & {
|
||||
width: 18%;
|
||||
}
|
||||
|
||||
[data-page-style='narrow'] & {
|
||||
width: calc(50% - 400px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1440px) {
|
||||
.page {
|
||||
%page-style {
|
||||
width: 56%;
|
||||
|
||||
[data-page-style='wide'] & {
|
||||
width: 60%;
|
||||
}
|
||||
}
|
||||
|
||||
aside {
|
||||
width: 22%;
|
||||
|
||||
[data-page-style='wide'] & {
|
||||
width: 20%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1200px) {
|
||||
.page {
|
||||
%page-style {
|
||||
width: 52%;
|
||||
|
||||
[data-page-style='wide'] & {
|
||||
@@ -51,14 +31,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
aside {
|
||||
width: 24%;
|
||||
|
||||
[data-page-style='wide'] & {
|
||||
width: 22%;
|
||||
}
|
||||
}
|
||||
|
||||
#header-desktop .header-wrapper {
|
||||
padding-right: 1rem;
|
||||
}
|
||||
@@ -69,6 +41,10 @@
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 960px) {
|
||||
%page-style {
|
||||
width: 80% !important;
|
||||
}
|
||||
|
||||
aside {
|
||||
display: none !important;
|
||||
}
|
||||
@@ -77,15 +53,28 @@
|
||||
display: block;
|
||||
}
|
||||
|
||||
.page {
|
||||
width: 80% !important;
|
||||
}
|
||||
|
||||
#header-desktop .header-wrapper {
|
||||
padding-left: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@media only screen and (min-width: 681px) {
|
||||
.breadcrumb-container.sticky {
|
||||
body:not([data-header-desktop='sticky']) & {
|
||||
top: 0;
|
||||
}
|
||||
// adjust the scroll margin top of the content anchors on the page
|
||||
body:not([data-header-desktop='auto']) &+.container .content [id] {
|
||||
scroll-margin-top: calc(var(--#{$prefix}scroll-mt) + var(--#{$prefix}breadcrumb-height));
|
||||
}
|
||||
}
|
||||
|
||||
[data-header-desktop='normal'] .page .content [id] {
|
||||
--#{$prefix}scroll-mt: #{$global-scroll-margin-top};
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 680px) {
|
||||
#header-desktop {
|
||||
display: none;
|
||||
@@ -100,18 +89,27 @@
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.page {
|
||||
width: 100% !important;
|
||||
|
||||
.content {
|
||||
[id] {
|
||||
[data-header-mobile='normal'] & {
|
||||
scroll-margin-top: 0;
|
||||
}
|
||||
}
|
||||
.breadcrumb-container.sticky {
|
||||
body:not([data-header-mobile='sticky']) & {
|
||||
top: 0;
|
||||
}
|
||||
// adjust the scroll margin top of the content anchors on the page
|
||||
body:not([data-header-mobile='auto']) &+.container .content [id] {
|
||||
scroll-margin-top: calc(var(--#{$prefix}scroll-mt) + var(--#{$prefix}breadcrumb-height));
|
||||
}
|
||||
}
|
||||
|
||||
.categories-card {
|
||||
[data-header-mobile='normal'] .page .content [id] {
|
||||
--#{$prefix}scroll-mt: #{$global-scroll-margin-top};
|
||||
}
|
||||
|
||||
%page-style {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.page {
|
||||
.categories-card,
|
||||
.collections-card {
|
||||
.card-item {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -123,7 +121,7 @@
|
||||
font-size: 0.618rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.pagination .page-item {
|
||||
margin: 0 5px;
|
||||
}
|
||||
@@ -139,10 +137,12 @@
|
||||
width: 100% !important;
|
||||
padding-top: 0 !important;
|
||||
|
||||
.single-title,
|
||||
.single-subtitle,
|
||||
.post-meta {
|
||||
text-align: center;
|
||||
&.single {
|
||||
.single-title,
|
||||
.single-subtitle,
|
||||
.post-meta {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
h1:not(.single-title),
|
||||
@@ -155,21 +155,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.print-d-none,
|
||||
header,
|
||||
footer .footer-line:not(.powered):not(.copyright),
|
||||
#toc-auto,
|
||||
.comment-visitors,
|
||||
.comment-count,
|
||||
.code-header>.ellipses,
|
||||
.code-header>.edit,
|
||||
.code-header>.copy,
|
||||
.post-info-share,
|
||||
.post-info-more section:last-child,
|
||||
.post-nav,
|
||||
.fixed-buttons,
|
||||
#comments,
|
||||
.github-corner {
|
||||
.print-d-none {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/* Resolve style conflicts between third-party plugins */
|
||||
|
||||
@keyframes #{$prefix}pulse {
|
||||
from {
|
||||
@include transform(scale3d(1, 1, 1));
|
||||
}
|
||||
|
||||
50% {
|
||||
@include transform(scale3d(1.05, 1.05, 1.05));
|
||||
}
|
||||
|
||||
to {
|
||||
@include transform(scale3d(1, 1, 1));
|
||||
}
|
||||
}
|
||||
|
||||
.animate__pulse {
|
||||
-webkit-animation-name: #{$prefix}pulse !important;
|
||||
animation-name: #{$prefix}pulse !important;
|
||||
}
|
||||
@@ -8,4 +8,10 @@
|
||||
@each $color, $value in $theme-colors {
|
||||
--#{$prefix}#{$color}-dark: #{darken($value, 5%)};
|
||||
}
|
||||
|
||||
// Scroll margin top and Stack sticky top related
|
||||
--#{$prefix}scroll-mt: calc(#{$header-height} + #{$global-scroll-margin-top});
|
||||
|
||||
// Set breadcrumb height to 0px if breadcrumb is disabled
|
||||
--#{$prefix}breadcrumb-height: 0px;
|
||||
}
|
||||
|
||||
@@ -99,3 +99,9 @@
|
||||
object-fit: $value;
|
||||
font-family: 'object-fit: #{$value};';
|
||||
}
|
||||
|
||||
@mixin user-select($value) {
|
||||
-webkit-user-select: $value !important;
|
||||
-moz-user-select: $value !important;
|
||||
user-select: $value !important;
|
||||
}
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
@import '_link';
|
||||
@import '_blur';
|
||||
@import '_details';
|
||||
@import '_z-index';
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
@mixin link($light, $dark) {
|
||||
/**
|
||||
* Link mixin
|
||||
* @param {Boolean} $light use global link color
|
||||
* @param {Boolean} $dark use global link color dark
|
||||
* @param {String} $decoration text-decoration, default none
|
||||
*/
|
||||
@mixin link($light, $dark, $decoration: none) {
|
||||
a,
|
||||
a::before,
|
||||
a::after {
|
||||
text-decoration: none;
|
||||
text-decoration: $decoration;
|
||||
|
||||
@if $light {
|
||||
color: $global-link-color;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
@mixin z-index($level, $diff: 0) {
|
||||
z-index: ($level * 100) + $diff;
|
||||
}
|
||||
@@ -34,7 +34,7 @@
|
||||
}
|
||||
.friend-link:hover {
|
||||
background: #fff;
|
||||
transform: scale(1.03);
|
||||
@include transform(scale(1.03));
|
||||
box-shadow: 0 0 3px #aaa;
|
||||
}
|
||||
.friend-avatar {
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
@include box-shadow(0 0 0 0.3618em rgba(0, 0, 0, 0.05));
|
||||
@include transition(all 0.4s ease);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@include box-shadow(0 0 0 0.3618em rgba(255, 255, 255, 0.05));
|
||||
}
|
||||
|
||||
&:hover {
|
||||
position: relative;
|
||||
@include transform(translateY(-0.75rem));
|
||||
@@ -25,7 +29,10 @@
|
||||
font-size: 1.25rem;
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
padding: 0.5rem;
|
||||
|
||||
&:not(:empty) {
|
||||
padding: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.home-subtitle {
|
||||
@@ -101,10 +108,7 @@
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
|
||||
&.lazyloaded {
|
||||
@include object-fit(cover);
|
||||
}
|
||||
@include object-fit(cover);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
.page {
|
||||
position: relative;
|
||||
@extend %page-style;
|
||||
|
||||
.content {
|
||||
[id] {
|
||||
scroll-margin-top: $header-height;
|
||||
|
||||
[data-header-desktop='normal'] & {
|
||||
scroll-margin-top: 0;
|
||||
}
|
||||
scroll-margin-top: var(--#{$prefix}scroll-mt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@import '../_partials/_single/toc';
|
||||
@import '../_partials/_single/fixit-decryptor';
|
||||
@import '../_partials/_single/collections';
|
||||
|
||||
.single {
|
||||
.single-title {
|
||||
@@ -8,16 +9,20 @@
|
||||
font-size: 1.6rem;
|
||||
font-weight: bold;
|
||||
line-height: 140%;
|
||||
|
||||
.icon-repost {
|
||||
color: var(--#{$prefix}success);
|
||||
|
||||
.icon-pin {
|
||||
display: inline-block;
|
||||
width: max-content;
|
||||
margin-right: 0.25rem;
|
||||
transform: rotate(30deg);
|
||||
margin-right: 0.25em;
|
||||
@extend .text-danger;
|
||||
}
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: var(--#{$prefix}success-dark);
|
||||
}
|
||||
.icon-repost {
|
||||
display: inline-block;
|
||||
width: max-content;
|
||||
margin-right: 0.25em;
|
||||
@extend .text-success;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +37,11 @@
|
||||
font-size: 0.875rem;
|
||||
color: $global-font-secondary-color;
|
||||
|
||||
.comment-visitors,
|
||||
.comment-count {
|
||||
@extend .print-d-none;
|
||||
}
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
}
|
||||
@@ -44,7 +54,7 @@
|
||||
|
||||
.author {
|
||||
font-size: 1.05rem;
|
||||
|
||||
|
||||
img.avatar {
|
||||
width: 1.3rem;
|
||||
height: 1.3rem;
|
||||
@@ -67,14 +77,11 @@
|
||||
|
||||
img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
|
||||
&.lazyloaded {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +146,7 @@
|
||||
> h4,
|
||||
> h5,
|
||||
> h6 {
|
||||
> .header-mark::before {
|
||||
> .heading-mark::before {
|
||||
content: '|';
|
||||
margin-right: 0.3125rem;
|
||||
color: $single-link-color;
|
||||
@@ -150,7 +157,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
> h2 > .header-mark::before {
|
||||
> h2 > .heading-mark::before {
|
||||
content: '#';
|
||||
}
|
||||
|
||||
@@ -185,15 +192,24 @@
|
||||
}
|
||||
|
||||
ul,
|
||||
ol {
|
||||
margin: 0.5rem 0;
|
||||
padding-left: 2.5rem;
|
||||
ol,
|
||||
dl {
|
||||
margin-block: 0.5em;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style-type: disc;
|
||||
}
|
||||
|
||||
dl {
|
||||
dt {
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
dd {
|
||||
margin-inline-start: 1.25em;
|
||||
}
|
||||
}
|
||||
|
||||
ruby {
|
||||
background: $code-background-color;
|
||||
|
||||
@@ -249,7 +265,7 @@
|
||||
background-color: lighten($table-background-color-dark, 2.75%);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
& tr:hover {
|
||||
background: darken($table-background-color, 4.5%);
|
||||
|
||||
@@ -275,9 +291,35 @@
|
||||
max-width: 100%;
|
||||
min-height: 1em;
|
||||
|
||||
&:not([data-h]) {
|
||||
&:not([height]) {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
&[loading='lazy'][srcset]:not([data-lazyloaded]) {
|
||||
&:not(.suffix-invalid__small) {
|
||||
width: var(--width-small, var(--width));
|
||||
aspect-ratio: var(--aspect-ratio-small, var(--aspect-ratio));
|
||||
}
|
||||
|
||||
&:not(.suffix-invalid) {
|
||||
@media (min-resolution: 1.01dppx) and (max-resolution: 1.5dppx) {
|
||||
width: calc(var(--width) / 1.5);
|
||||
aspect-ratio: var(--aspect-ratio);
|
||||
}
|
||||
}
|
||||
|
||||
&:not(.suffix-invalid__large) {
|
||||
@media (min-resolution: 1.51dppx) {
|
||||
width: calc(var(--width-large, var(--width)) / 2);
|
||||
aspect-ratio: var(--aspect-ratio-large, var(--aspect-ratio));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.version {
|
||||
height: 1.25em;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
}
|
||||
svg {
|
||||
max-width: 100%;
|
||||
@@ -301,10 +343,6 @@
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
|
||||
&.lazyloaded:not([data-w]) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,6 +358,10 @@
|
||||
padding-left: 1.5em;
|
||||
}
|
||||
|
||||
dl dd {
|
||||
margin-inline-start: 0.25em;
|
||||
}
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $blockquote-color-dark;
|
||||
border-left-color: $global-border-color-dark;
|
||||
@@ -328,11 +370,40 @@
|
||||
@include link(false, true);
|
||||
}
|
||||
|
||||
.footnotes {
|
||||
color: $global-font-secondary-color;
|
||||
sup[id^='fnref:']:has(.footnote-ref) {
|
||||
padding: 2px 4px;
|
||||
background-color: rgba(238, 238, 238, 0.7);
|
||||
color: #555555;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $global-font-secondary-color-dark;
|
||||
background-color: rgba(56, 139, 253, 0.1);
|
||||
color: #58a6ff;
|
||||
}
|
||||
|
||||
@include link(true, false);
|
||||
}
|
||||
|
||||
.footnotes {
|
||||
font-size: 0.75rem;
|
||||
white-space: normal;
|
||||
color: darken($global-font-secondary-color, 5%);
|
||||
|
||||
ol {
|
||||
margin-block: 1em;
|
||||
padding-left: 1rem;
|
||||
}
|
||||
|
||||
a:not(.footnote-backref) {
|
||||
color: inherit;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
@include link(false, true);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: lighten($global-font-secondary-color-dark, 5%);
|
||||
}
|
||||
|
||||
p {
|
||||
@@ -344,13 +415,13 @@
|
||||
@import '../_shortcodes';
|
||||
|
||||
hr {
|
||||
margin: 1rem 0;
|
||||
margin-block: 1em;
|
||||
position: relative;
|
||||
border-top: 1px dashed $global-border-color;
|
||||
border-top: 1px dashed darken($global-border-color, 5%);
|
||||
border-bottom: none;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
border-top: 1px dashed $global-border-color-dark;
|
||||
border-top: 1px dashed lighten($global-border-color-dark, 5%);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,26 +430,19 @@
|
||||
padding: 0 0.25rem;
|
||||
background-color: $global-background-color;
|
||||
border: 1px solid $global-border-color;
|
||||
border-bottom-color: $global-border-color;
|
||||
@include border-radius($global-border-radius);
|
||||
@include box-shadow(inset 0 -1px 0 $global-border-color);
|
||||
font-size: 0.8rem;
|
||||
font-family: $code-font-family;
|
||||
color: $code-color;
|
||||
@include border-radius($global-border-radius);
|
||||
@include box-shadow(inset 0 -1px 0 $global-border-color);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: $global-background-color-dark;
|
||||
border: 1px solid $global-border-color-dark;
|
||||
border-bottom-color: $global-border-color-dark;
|
||||
@include box-shadow(inset 0 -1px 0 $global-border-color-dark);
|
||||
color: $code-color-dark;
|
||||
@include box-shadow(inset 0 -1px 0 $global-border-color-dark);
|
||||
}
|
||||
}
|
||||
|
||||
.version {
|
||||
height: 1.25em;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
}
|
||||
|
||||
@import '../_partials/_single/reward';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
.categories-card {
|
||||
.categories-card,
|
||||
.collections-card {
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
|
||||
@@ -10,17 +10,19 @@ svg.icon {
|
||||
}
|
||||
|
||||
img.emoji {
|
||||
display: inline-block;
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
margin: 0 0.05em 0 0.1em;
|
||||
vertical-align: -0.1em;
|
||||
}
|
||||
|
||||
.hugo-icon,
|
||||
.fixit-icon {
|
||||
display: inline-block;
|
||||
height: 1.5em;
|
||||
width: 1.5em;
|
||||
line-height: 1.5em;
|
||||
height: 1.2em;
|
||||
width: 1.2em;
|
||||
line-height: 1.2em;
|
||||
position: relative;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
img {
|
||||
@include border-radius($global-border-radius/2);
|
||||
|
||||
&.lazyload,
|
||||
&.lazyloading {
|
||||
@include object-fit(scale-down);
|
||||
}
|
||||
|
||||
&.lazyloaded {
|
||||
@include object-fit(contain);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
@include z-index(0, -1);
|
||||
|
||||
.blur & {
|
||||
z-index: 100;
|
||||
@include z-index(1);
|
||||
background-color: rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,6 +100,12 @@ pre {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ellipses,
|
||||
.edit,
|
||||
.copy {
|
||||
@extend .print-d-none;
|
||||
}
|
||||
|
||||
.code-title {
|
||||
width: 100%;
|
||||
padding: 0.4rem;
|
||||
@@ -108,6 +114,12 @@ pre {
|
||||
padding: 0 0.2rem;
|
||||
@include transition(transform 0.2s ease);
|
||||
}
|
||||
|
||||
.title-inner {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
.code-title::after {
|
||||
@@ -181,9 +193,11 @@ pre {
|
||||
.lntd:first-child {
|
||||
min-width: 1.6rem;
|
||||
text-align: right;
|
||||
position: sticky;
|
||||
left: 0;
|
||||
|
||||
pre {
|
||||
padding-right: 0;
|
||||
@include user-select(none);
|
||||
}
|
||||
}
|
||||
// code content
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
// Collection Navigation
|
||||
.collection-card {
|
||||
font-size: 0.875rem;
|
||||
background-color: darken($global-background-color, 3%);
|
||||
margin-block: 2rem -1rem;
|
||||
padding: 1rem 1.25rem;
|
||||
position: relative;
|
||||
@include border-radius($global-border-radius * 1.5);
|
||||
@include user-select(none);
|
||||
@extend .print-d-none;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: lighten($global-background-color-dark, 3%);
|
||||
}
|
||||
|
||||
&:has(.collection-nav-item:nth-child(2))::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: 0.75rem;
|
||||
width: 1px;
|
||||
height: 2rem;
|
||||
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.05) 50%, rgba(0, 0, 0, 0.03) 100%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
rgba(255, 255, 255, 0.03),
|
||||
rgba(255, 255, 255, 0.05) 50%,
|
||||
rgba(255, 255, 255, 0.03) 100%
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
.collection-title {
|
||||
@include link(false, false);
|
||||
}
|
||||
|
||||
.collection-nav {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
|
||||
&:not(:empty) {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.collection-nav-item {
|
||||
flex-grow: 1;
|
||||
max-width: calc(50% - 0.5rem);
|
||||
font-weight: 500;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@include transition(all 0.3s ease-out);
|
||||
|
||||
&:only-child {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
i {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
span {
|
||||
flex-grow: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&[rel='next'] {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
&[rel='prev']:hover {
|
||||
@include transform(translateX(-4px));
|
||||
}
|
||||
|
||||
&[rel='next']:hover {
|
||||
@include transform(translateX(4px));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Collection aside container
|
||||
.aside-collection {
|
||||
position: sticky;
|
||||
top: calc(#{$header-height} + var(--#{$prefix}breadcrumb-height));
|
||||
box-sizing: border-box;
|
||||
@include overflow-wrap(break-word);
|
||||
@include blur;
|
||||
@extend .print-d-none;
|
||||
}
|
||||
|
||||
// Collection List
|
||||
.collection-details {
|
||||
&:not(:last-of-type) {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
&.open {
|
||||
.collection-summary {
|
||||
background-color: darken($global-background-color, 4%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: lighten($global-background-color-dark, 4%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.collection-summary {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 0.25em;
|
||||
padding: 0.2em 0.5em;
|
||||
background-color: darken($global-background-color, 3%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: lighten($global-background-color-dark, 3%);
|
||||
}
|
||||
|
||||
> i.fa-layer-group {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.collection-name {
|
||||
flex-grow: 1;
|
||||
font-weight: bold;
|
||||
|
||||
&::before {
|
||||
content: attr(data-collections) '・';
|
||||
}
|
||||
}
|
||||
|
||||
.collection-count {
|
||||
flex-shrink: 0;
|
||||
@extend .text-secondary;
|
||||
}
|
||||
|
||||
.details-icon {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@include user-select(none);
|
||||
}
|
||||
|
||||
.collection-content {
|
||||
font-size: $toc-content-font-size;
|
||||
background-color: darken($global-background-color, 2%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: lighten($global-background-color-dark, 2%);
|
||||
}
|
||||
|
||||
.collection-list {
|
||||
margin: 0;
|
||||
padding-inline: 1.6em 0.8em;
|
||||
padding-block: 0.4em;
|
||||
text-indent: -0.8em;
|
||||
list-style: none;
|
||||
overflow-y: scroll;
|
||||
max-height: 60vh;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.collection-item > a::before,
|
||||
.collection-item > span::before {
|
||||
content: '|';
|
||||
font-weight: 600;
|
||||
margin-right: 0.5em;
|
||||
position: relative;
|
||||
bottom: 2px;
|
||||
color: $single-link-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $single-link-color-dark;
|
||||
}
|
||||
}
|
||||
|
||||
.collection-item > .active {
|
||||
font-weight: bold;
|
||||
color: $single-link-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $single-link-color-dark;
|
||||
}
|
||||
|
||||
&::before {
|
||||
color: $single-link-hover-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $single-link-hover-color-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.collection-nav-simple {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5em;
|
||||
background-color: darken($global-background-color, 3%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: lighten($global-background-color-dark, 3%);
|
||||
}
|
||||
|
||||
a.collection-nav-item {
|
||||
padding-inline: 2px;
|
||||
border-radius: 50%;
|
||||
@include transition(background-color 0.3s ease-out);
|
||||
|
||||
&:hover {
|
||||
background-color: darken($global-background-color, 10%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: lighten($global-background-color-dark, 10%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> i.collection-nav-item {
|
||||
padding: 4px 2px;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
#comments {
|
||||
>#comments {
|
||||
padding: 2rem 0;
|
||||
@extend .print-d-none;
|
||||
}
|
||||
|
||||
@@ -65,3 +65,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.encrypted-hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
.post-footer {
|
||||
margin: 2rem 0;
|
||||
|
||||
&:has(~.post-reward) {
|
||||
margin-bottom: 0;
|
||||
&~.post-reward {
|
||||
margin-block: -2rem 0;
|
||||
}
|
||||
|
||||
.post-info {
|
||||
border-bottom: 1px solid $global-border-color;
|
||||
padding: 1rem 0 0.3rem;
|
||||
padding: 0.3rem 0;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
border-bottom: 1px solid $global-border-color-dark;
|
||||
@@ -53,6 +53,7 @@
|
||||
}
|
||||
|
||||
.post-info-share {
|
||||
@extend .print-d-none;
|
||||
a * {
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
@@ -61,10 +62,14 @@
|
||||
}
|
||||
|
||||
.post-info-more {
|
||||
padding: 0.3rem 0 1rem;
|
||||
padding: 0.3rem 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 0.9rem;
|
||||
|
||||
section:last-child {
|
||||
@extend .print-d-none;
|
||||
}
|
||||
}
|
||||
|
||||
.post-tags {
|
||||
@@ -86,6 +91,8 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 1.5rem;
|
||||
padding-block: 0.5rem;
|
||||
@extend .print-d-none;
|
||||
|
||||
.post-nav-item {
|
||||
flex: 1;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
.post-reward {
|
||||
padding: 1rem;
|
||||
text-align: center;
|
||||
|
||||
&~.post-footer {
|
||||
margin-top: 0;
|
||||
}
|
||||
margin-bottom: -1rem;
|
||||
@extend .print-d-none;
|
||||
|
||||
&:has(.reward-ways:empty) {
|
||||
display: none;
|
||||
@@ -15,8 +13,53 @@
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.reward-ways {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.reward-input:checked~.reward-ways {
|
||||
display: block;
|
||||
padding-top: 20px;
|
||||
|
||||
div {
|
||||
display: inline-block;
|
||||
@include user-select(none);
|
||||
|
||||
span {
|
||||
display: block;
|
||||
}
|
||||
|
||||
&:hover span[data-animation] {
|
||||
animation: var(--animation-reward, jackInTheBox) 0.8s infinite linear;
|
||||
// The animation may affect :hover of img in dark mode
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
img {
|
||||
display: inline-block;
|
||||
margin: 0.8em 2em 0;
|
||||
max-width: 100%;
|
||||
width: $reward-img-width;
|
||||
}
|
||||
}
|
||||
|
||||
// `fixed` mode only supports desktop
|
||||
&[data-mode='fixed'] {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
padding: 1rem;
|
||||
background-color: $global-background-color;
|
||||
@include z-index(2);
|
||||
@include border-radius($global-border-radius);
|
||||
@include box-shadow(0 0 1.5rem 0 rgba(0, 0, 0, 0.2));
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: $global-background-color-dark;
|
||||
@include box-shadow(0 0 1.5rem 0 rgba(255, 255, 255, 0.2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.reward-button {
|
||||
@@ -27,11 +70,11 @@
|
||||
color: lighten($reward-color, 5%);
|
||||
border: 2px solid lighten($reward-color, 10%);
|
||||
border-radius: $global-border-radius;
|
||||
@include transition(all 0.3s ease-out);
|
||||
padding: 0.6rem 1rem;
|
||||
background-color: $global-background-color;
|
||||
vertical-align: text-top;
|
||||
line-height: 1rem;
|
||||
@include transition(all 0.3s ease-out);
|
||||
|
||||
&:active,
|
||||
&:hover {
|
||||
@@ -53,29 +96,3 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.reward-ways {
|
||||
display: none;
|
||||
padding-top: 20px;
|
||||
|
||||
div {
|
||||
display: inline-block;
|
||||
|
||||
span {
|
||||
display: block;
|
||||
}
|
||||
|
||||
&:hover span[data-animation] {
|
||||
animation: var(--animation-reward, jackInTheBox) 0.8s infinite linear;
|
||||
// The animation may affect :hover of img in dark mode
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
display: inline-block;
|
||||
margin: .8em 2em 0;
|
||||
max-width: 100%;
|
||||
width: $reward-img-width;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,14 +9,16 @@
|
||||
font-size: $toc-content-font-size;
|
||||
|
||||
ul {
|
||||
text-indent: -0.8rem;
|
||||
padding-left: 0.8rem;
|
||||
text-indent: -0.8em;
|
||||
padding-left: 0.8em;
|
||||
list-style: none;
|
||||
|
||||
a:first-child::before {
|
||||
content: '|';
|
||||
font-weight: bolder;
|
||||
margin-right: 0.5rem;
|
||||
margin-right: 0.5em;
|
||||
position: relative;
|
||||
bottom: 2px;
|
||||
color: $single-link-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@@ -25,7 +27,24 @@
|
||||
}
|
||||
|
||||
ul {
|
||||
padding-left: 1.5rem;
|
||||
padding-left: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
ol {
|
||||
margin: 0;
|
||||
padding-left: 2.25em;
|
||||
|
||||
ol {
|
||||
padding-left: 1.25em;
|
||||
}
|
||||
|
||||
li:has(> a:hover)::marker {
|
||||
color: $single-link-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $single-link-color-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,23 +69,28 @@
|
||||
#toc-auto {
|
||||
display: block;
|
||||
position: sticky;
|
||||
top: $header-height + 0.5rem;
|
||||
padding-left: 1rem;
|
||||
padding-right: 1rem;
|
||||
@include overflow-wrap(break-word);
|
||||
top: calc(#{$header-height} + var(--#{$prefix}breadcrumb-height));
|
||||
box-sizing: border-box;
|
||||
visibility: hidden;
|
||||
|
||||
@include overflow-wrap(break-word);
|
||||
@include blur;
|
||||
@extend .print-d-none;
|
||||
|
||||
[data-header-desktop='normal'] & {
|
||||
--#{$prefix}scroll-mt: #{$global-scroll-margin-top};
|
||||
}
|
||||
|
||||
.toc-title {
|
||||
margin: 0.5rem 0;
|
||||
margin-block: 0 0.5em;
|
||||
cursor: pointer;
|
||||
@include user-select(none);
|
||||
|
||||
&::before {
|
||||
content: '|';
|
||||
font-weight: bolder;
|
||||
margin-right: 0.5rem;
|
||||
margin-right: 0.5em;
|
||||
position: relative;
|
||||
bottom: 2px;
|
||||
color: $global-border-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@@ -87,8 +111,13 @@
|
||||
.toc-content {
|
||||
overflow-y: scroll;
|
||||
max-height: calc(100vh - #{2*$header-height});
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 0;
|
||||
}
|
||||
|
||||
&.always-active ul {
|
||||
&.always-active ul,
|
||||
&.always-active ol {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@@ -96,6 +125,29 @@
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
li.has-active {
|
||||
&::marker {
|
||||
color: $single-link-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $single-link-color-dark;
|
||||
}
|
||||
}
|
||||
|
||||
&:has(> .active)::marker {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
> a {
|
||||
color: $single-link-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $single-link-color-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// for unordered list automatically collapsed
|
||||
ul {
|
||||
ul {
|
||||
display: none;
|
||||
@@ -104,17 +156,8 @@
|
||||
.has-active > ul {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
a.active {
|
||||
font-weight: bold;
|
||||
color: $single-link-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $single-link-color-dark;
|
||||
}
|
||||
|
||||
&::before {
|
||||
a.active::before {
|
||||
color: $single-link-hover-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@@ -122,12 +165,27 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// for ordered list automatically collapsed
|
||||
ol {
|
||||
ol {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.has-active > ol {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
a.active {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#toc-static {
|
||||
display: none;
|
||||
margin: 0.8rem 0;
|
||||
margin: 0.8em 0;
|
||||
|
||||
&[data-kept='true'] {
|
||||
display: block;
|
||||
@@ -137,7 +195,7 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
line-height: 2em;
|
||||
padding: 0 0.75rem;
|
||||
padding: 0 0.75em;
|
||||
background: darken($code-background-color, 3%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@@ -148,9 +206,33 @@
|
||||
.toc-content {
|
||||
background-color: $code-background-color;
|
||||
|
||||
> nav > ul {
|
||||
margin: 0;
|
||||
padding: 0.4rem 1rem 0.4rem 1.8rem;
|
||||
> nav {
|
||||
> ul {
|
||||
margin: 0;
|
||||
padding: 0.4em 1em 0.4em 1.8em;
|
||||
|
||||
a:hover {
|
||||
font-weight: bold;
|
||||
|
||||
&::before {
|
||||
color: $single-link-hover-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $single-link-hover-color-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> ol {
|
||||
margin: 0;
|
||||
padding: 0.4em 1em 0.4em 2.25em;
|
||||
|
||||
li:has(> a:hover)::marker,
|
||||
a:hover {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[data-theme='dark'] & {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
.fixed-button {
|
||||
z-index: 100;
|
||||
position: fixed;
|
||||
right: 1.5rem;
|
||||
font-size: 1rem;
|
||||
@@ -7,10 +6,11 @@
|
||||
padding: 0.5rem 0.625rem;
|
||||
color: $global-font-secondary-color;
|
||||
background-color: $header-background-color;
|
||||
@include z-index(1);
|
||||
@include border-radius(1.25rem);
|
||||
@include transition(color 0.4s ease);
|
||||
|
||||
@include blur;
|
||||
@extend .print-d-none;
|
||||
|
||||
&:hover,
|
||||
&:active {
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
@keyframes octocat-wave {
|
||||
0%,
|
||||
100% {
|
||||
transform: rotate(0);
|
||||
@include transform(rotate(0));
|
||||
}
|
||||
20%,
|
||||
60% {
|
||||
transform: rotate(-25deg);
|
||||
@include transform(rotate(-25deg));
|
||||
}
|
||||
40%,
|
||||
80% {
|
||||
transform: rotate(10deg);
|
||||
@include transform(rotate(10deg));
|
||||
}
|
||||
}
|
||||
|
||||
.github-corner {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
z-index: 150;
|
||||
@include z-index(2);
|
||||
@extend .print-d-none;
|
||||
|
||||
:hover .octo-arm {
|
||||
animation: octocat-wave 560ms ease-in-out;
|
||||
@@ -37,7 +38,7 @@
|
||||
left: 0;
|
||||
|
||||
svg {
|
||||
transform: scale(-1, 1);
|
||||
@include transform(scale(-1, 1));
|
||||
}
|
||||
}
|
||||
&.right {
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
z-index: 150;
|
||||
@include z-index(2);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: var(--#{$prefix}danger-dark);
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
height: var(--progress-h, 2px);
|
||||
width: var(--progress);
|
||||
background-color: var(--bg-progress, var(--#{$prefix}info));
|
||||
z-index: 150;
|
||||
position: fixed;
|
||||
@include z-index(2);
|
||||
@extend .print-d-none;
|
||||
|
||||
[data-theme="dark"] & {
|
||||
background-color: var(--bg-progress-dark, var(--#{$prefix}info-dark));
|
||||
|
||||
@@ -5,3 +5,4 @@
|
||||
@import '_echarts';
|
||||
@import '_instagram';
|
||||
@import '_mapbox';
|
||||
@import '_mermaid';
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
.mermaid {
|
||||
text-align: center;
|
||||
|
||||
svg {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,9 @@ $global-font-size: 16px !default;
|
||||
$global-font-weight: 400 !default;
|
||||
$global-line-height: 1.5rem !default;
|
||||
|
||||
// scroll-margin-top of content anchor
|
||||
$global-scroll-margin-top: 0.5rem;
|
||||
|
||||
// Radius of the border
|
||||
$global-border-radius: 5px !default;
|
||||
|
||||
@@ -94,7 +97,7 @@ $single-link-color-dark: #1781b5 !default; // 釉蓝
|
||||
|
||||
// Color of the hover single link
|
||||
$single-link-hover-color: #ea517f !default; // 莲瓣红
|
||||
$single-link-hover-color-dark: #619ac3 !default; // 羽扇豆蓝
|
||||
$single-link-hover-color-dark: #cc5595 !default; // 龙须红
|
||||
|
||||
// Color of the table background
|
||||
$table-background-color: #fff !default;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
@import "_core/base";
|
||||
@import "_core/layout";
|
||||
@import "_core/common";
|
||||
@import "_core/patch";
|
||||
@import "_page";
|
||||
@import "_core/media";
|
||||
@import "_custom";
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
|
||||
prefix:
|
||||
libFiles: https://cdn.jsdelivr.net/npm/
|
||||
# simple-icons@7.12.0 https://github.com/simple-icons/simple-icons
|
||||
simpleIcons: https://cdn.jsdelivr.net/npm/simple-icons@7.12.0/icons/
|
||||
# simple-icons@9.19.0 https://github.com/simple-icons/simple-icons
|
||||
simpleIcons: https://cdn.jsdelivr.net/npm/simple-icons@9.19.0/icons/
|
||||
libFiles:
|
||||
# algoliasearch@4.14.2 https://github.com/algolia/algoliasearch-client-javascript
|
||||
algoliasearchJS: algoliasearch@4.14.2/dist/algoliasearch-lite.umd.min.js
|
||||
# algoliasearch@4.20.0 https://github.com/algolia/algoliasearch-client-javascript
|
||||
algoliasearchJS: algoliasearch@4.20.0/dist/algoliasearch-lite.umd.min.js
|
||||
# animate.css@4.1.1 https://github.com/daneden/animate.css
|
||||
animateCSS: animate.css@4.1.1/animate.min.css
|
||||
# aplayer@1.10.1 https://github.com/MoePlayer/APlayer
|
||||
aplayerCSS: aplayer@1.10.1/dist/APlayer.min.css
|
||||
aplayerJS: aplayer@1.10.1/dist/APlayer.min.js
|
||||
# artalk@2.3.4 https://github.com/ArtalkJS/Artalk
|
||||
artalkCSS: artalk@2.3.4/dist/Artalk.min.css
|
||||
artalkJS: artalk@2.3.4/dist/Artalk.min.js
|
||||
# artalk@2.6.4 https://github.com/ArtalkJS/Artalk
|
||||
artalkCSS: artalk@2.6.4/dist/Artalk.css
|
||||
artalkJS: artalk@2.6.4/dist/Artalk.js
|
||||
# autocomplete-js@0.38.1 https://github.com/algolia/autocomplete
|
||||
# TODO update autocompleteJS: '@algolia/autocomplete-js@1.7.1/dist/umd/index.production.js'
|
||||
autocompleteJS: autocomplete.js@0.38.1/dist/autocomplete.min.js
|
||||
@@ -31,35 +31,35 @@ libFiles:
|
||||
cryptoSha256JS: crypto-js@4.1.1/sha256.js
|
||||
# echarts@5.3.3 https://github.com/apache/echarts
|
||||
echartsJS: echarts@5.3.3/dist/echarts.min.js
|
||||
# eruda@2.5.0 https://github.com/liriliri/eruda
|
||||
erudaJS: eruda@2.5.0/eruda.js
|
||||
# fontawesome-free@6.2.0 https://github.com/FortAwesome/Font-Awesome
|
||||
fontawesomeFreeCSS: '@fortawesome/fontawesome-free@6.2.0/css/all.min.css'
|
||||
# eruda@3.0.1 https://github.com/liriliri/eruda
|
||||
erudaJS: eruda@3.0.1/eruda.js
|
||||
# fontawesome-free@6.4.2 https://github.com/FortAwesome/Font-Awesome
|
||||
fontawesomeFreeCSS: '@fortawesome/fontawesome-free@6.4.2/css/all.min.css'
|
||||
# fusejs@6.6.2 https://github.com/krisk/fuse
|
||||
fuseJS: fuse.js@6.6.2/dist/fuse.min.js
|
||||
# gitalk@1.7.2 https://github.com/gitalk/gitalk
|
||||
gitalkCSS: gitalk@1.7.2/dist/gitalk.min.css
|
||||
gitalkJS: gitalk@1.7.2/dist/gitalk.min.js
|
||||
# katex@0.16.2 https://github.com/KaTeX/KaTeX
|
||||
katexAutoRenderJS: katex@0.16.2/dist/contrib/auto-render.min.js
|
||||
katexCopyTexJS: katex@0.16.2/dist/contrib/copy-tex.min.js
|
||||
katexCSS: katex@0.16.2/dist/katex.min.css
|
||||
katexJS: katex@0.16.2/dist/katex.min.js
|
||||
katexMhchemJS: katex@0.16.2/dist/contrib/mhchem.min.js
|
||||
# lazysizes@5.3.2 https://github.com/aFarkas/lazysizes
|
||||
lazysizesJS: lazysizes@5.3.2/lazysizes.min.js
|
||||
# lightgallery@2.6.1 https://github.com/sachinchoolur/lightgallery
|
||||
lightgalleryCSS: lightgallery@2.6.1/css/lightgallery-bundle.min.css
|
||||
lightgalleryJS: lightgallery@2.6.1/lightgallery.min.js
|
||||
lightgalleryThumbnailJS: lightgallery@2.6.1/plugins/thumbnail/lg-thumbnail.min.js
|
||||
lightgalleryZoomJS: lightgallery@2.6.1/plugins/zoom/lg-zoom.min.js
|
||||
# lunr.js@2.3.9 https://github.com/olivernn/lunr.js
|
||||
lunrJS: lunr@2.3.9/lunr.min.js
|
||||
# instant.page@5.2.0 https://github.com/instantpage/instant.page
|
||||
instantPage: instant.page@5.2.0/instantpage.min.js
|
||||
# katex@0.16.9 https://github.com/KaTeX/KaTeX
|
||||
katexAutoRenderJS: katex@0.16.9/dist/contrib/auto-render.min.js
|
||||
katexCopyTexJS: katex@0.16.9/dist/contrib/copy-tex.min.js
|
||||
katexCSS: katex@0.16.9/dist/katex.min.css
|
||||
katexJS: katex@0.16.9/dist/katex.min.js
|
||||
katexMhchemJS: katex@0.16.9/dist/contrib/mhchem.min.js
|
||||
# lightgallery@2.7.2 https://github.com/sachinchoolur/lightgallery
|
||||
lightgalleryCSS: lightgallery@2.7.2/css/lightgallery-bundle.min.css
|
||||
lightgalleryJS: lightgallery@2.7.2/lightgallery.min.js
|
||||
lightgalleryThumbnailJS: lightgallery@2.7.2/plugins/thumbnail/lg-thumbnail.min.js
|
||||
lightgalleryZoomJS: lightgallery@2.7.2/plugins/zoom/lg-zoom.min.js
|
||||
# mapbox-gl@2.10.0 https://docs.mapbox.com/mapbox-gl-js
|
||||
# TODO update to 3.x
|
||||
mapboxGLCSS: mapbox-gl@2.10.0/dist/mapbox-gl.css
|
||||
mapboxGLJS: mapbox-gl@2.10.0/dist/mapbox-gl.js
|
||||
# mermaid@9.1.7 https://github.com/mermaid-js/mermaid
|
||||
mermaidJS: mermaid@9.1.7/dist/mermaid.min.js
|
||||
# mermaid@9.4.3 https://github.com/mermaid-js/mermaid
|
||||
# TODO bump Mermaid from 9.x to 10.x
|
||||
mermaidJS: mermaid@9.4.3/dist/mermaid.min.js
|
||||
# meting@2.0.1 https://github.com/metowolf/MetingJS
|
||||
metingJS: meting@2.0.1/dist/Meting.min.js
|
||||
# object-fit-images@3.2.4 https://github.com/fregante/object-fit-images
|
||||
@@ -68,19 +68,19 @@ libFiles:
|
||||
panguJS: pangu@4.0.7/dist/browser/pangu.min.js
|
||||
# pace-js@1.2.4 https://github.com/CodeByZach/pace
|
||||
paceJS: pace-js@1.2.4
|
||||
# sharer.js@0.4.2 https://github.com/ellisonleao/sharer.js
|
||||
# sharer.js@0.5.1 https://github.com/ellisonleao/sharer.js
|
||||
sharerJS: sharer.js@0.5.1/sharer.min.js
|
||||
# twemoji@13.1.0 https://github.com/twitter/twemoji
|
||||
# twemoji@14.0.2 https://github.com/twitter/twemoji
|
||||
twemojiJS: twemoji@14.0.2/dist/twemoji.min.js
|
||||
# twikoo@1.6.8 https://github.com/imaegoo/twikoo
|
||||
twikooJS: twikoo@1.6.8/dist/twikoo.all.min.js
|
||||
# typeit@8.7.0 https://github.com/alexmacarthur/typeit
|
||||
typeitJS: typeit@8.7.0/dist/index.umd.js
|
||||
# twikoo@1.6.22 https://github.com/imaegoo/twikoo
|
||||
twikooJS: twikoo@1.6.22/dist/twikoo.all.min.js
|
||||
# typeit@8.7.1 https://github.com/alexmacarthur/typeit
|
||||
typeitJS: typeit@8.7.1/dist/index.umd.js
|
||||
# valine@1.5.1 https://github.com/xCss/Valine
|
||||
valineJS: valine@1.5.1/dist/Valine.min.js
|
||||
# vconsole@3.14.6 https://github.com/Tencent/vConsole
|
||||
vconsoleJS: vconsole@3.14.6/dist/vconsole.min.js
|
||||
# waline@2.10.0 https://github.com/walinejs/waline
|
||||
walineCSS: '@waline/client@2.10.0/dist/waline.css'
|
||||
walineJS: '@waline/client@2.10.0/dist/waline.js'
|
||||
# vconsole@3.15.1 https://github.com/Tencent/vConsole
|
||||
vconsoleJS: vconsole@3.15.1/dist/vconsole.min.js
|
||||
# waline@2.15.8 https://github.com/walinejs/waline
|
||||
walineCSS: '@waline/client@2.15.8/dist/waline.css'
|
||||
walineJS: '@waline/client@2.15.8/dist/waline.js'
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
|
||||
prefix:
|
||||
libFiles: https://unpkg.com/
|
||||
# simple-icons@7.12.0 https://github.com/simple-icons/simple-icons
|
||||
simpleIcons: https://unpkg.com/simple-icons@7.12.0/icons/
|
||||
# simple-icons@9.19.0 https://github.com/simple-icons/simple-icons
|
||||
simpleIcons: https://unpkg.com/simple-icons@9.19.0/icons/
|
||||
libFiles:
|
||||
# algoliasearch@4.14.2 https://github.com/algolia/algoliasearch-client-javascript
|
||||
algoliasearchJS: algoliasearch@4.14.2/dist/algoliasearch-lite.umd.min.js
|
||||
# algoliasearch@4.20.0 https://github.com/algolia/algoliasearch-client-javascript
|
||||
algoliasearchJS: algoliasearch@4.20.0/dist/algoliasearch-lite.umd.js
|
||||
# animate.css@4.1.1 https://github.com/daneden/animate.css
|
||||
animateCSS: animate.css@4.1.1/animate.min.css
|
||||
# aplayer@1.10.1 https://github.com/MoePlayer/APlayer
|
||||
aplayerCSS: aplayer@1.10.1/dist/APlayer.min.css
|
||||
aplayerJS: aplayer@1.10.1/dist/APlayer.min.js
|
||||
# artalk@2.3.4 https://github.com/ArtalkJS/Artalk
|
||||
artalkCSS: artalk@2.3.4/dist/Artalk.css
|
||||
artalkJS: artalk@2.3.4/dist/Artalk.js
|
||||
# artalk@2.6.4 https://github.com/ArtalkJS/Artalk
|
||||
artalkCSS: artalk@2.6.4/dist/Artalk.css
|
||||
artalkJS: artalk@2.6.4/dist/Artalk.js
|
||||
# autocomplete-js@0.38.1 https://github.com/algolia/autocomplete
|
||||
# TODO update autocompleteJS: '@algolia/autocomplete-js@1.7.1/dist/umd/index.production.js'
|
||||
autocompleteJS: autocomplete.js@0.38.1/dist/autocomplete.min.js
|
||||
@@ -31,35 +31,35 @@ libFiles:
|
||||
cryptoSha256JS: crypto-js@4.1.1/sha256.js
|
||||
# echarts@5.3.3 https://github.com/apache/echarts
|
||||
echartsJS: echarts@5.3.3/dist/echarts.min.js
|
||||
# eruda@2.5.0 https://github.com/liriliri/eruda
|
||||
erudaJS: eruda@2.5.0/eruda.js
|
||||
# fontawesome-free@6.2.0 https://github.com/FortAwesome/Font-Awesome
|
||||
fontawesomeFreeCSS: '@fortawesome/fontawesome-free@6.2.0/css/all.min.css'
|
||||
# eruda@3.0.1 https://github.com/liriliri/eruda
|
||||
erudaJS: eruda@3.0.1/eruda.js
|
||||
# fontawesome-free@6.4.2 https://github.com/FortAwesome/Font-Awesome
|
||||
fontawesomeFreeCSS: '@fortawesome/fontawesome-free@6.4.2/css/all.min.css'
|
||||
# fusejs@6.6.2 https://github.com/krisk/fuse
|
||||
fuseJS: fuse.js@6.6.2/dist/fuse.min.js
|
||||
# gitalk@1.7.2 https://github.com/gitalk/gitalk
|
||||
gitalkCSS: gitalk@1.7.2/dist/gitalk.min.css
|
||||
gitalkJS: gitalk@1.7.2/dist/gitalk.min.js
|
||||
# katex@0.16.2 https://github.com/KaTeX/KaTeX
|
||||
katexAutoRenderJS: katex@0.16.2/dist/contrib/auto-render.min.js
|
||||
katexCopyTexJS: katex@0.16.2/dist/contrib/copy-tex.min.js
|
||||
katexCSS: katex@0.16.2/dist/katex.min.css
|
||||
katexJS: katex@0.16.2/dist/katex.min.js
|
||||
katexMhchemJS: katex@0.16.2/dist/contrib/mhchem.min.js
|
||||
# lazysizes@5.3.2 https://github.com/aFarkas/lazysizes
|
||||
lazysizesJS: lazysizes@5.3.2/lazysizes.min.js
|
||||
# lightgallery@2.6.1 https://github.com/sachinchoolur/lightgallery
|
||||
lightgalleryCSS: lightgallery@2.6.1/css/lightgallery-bundle.min.css
|
||||
lightgalleryJS: lightgallery@2.6.1/lightgallery.min.js
|
||||
lightgalleryThumbnailJS: lightgallery@2.6.1/plugins/thumbnail/lg-thumbnail.min.js
|
||||
lightgalleryZoomJS: lightgallery@2.6.1/plugins/zoom/lg-zoom.min.js
|
||||
# lunr.js@2.3.9 https://github.com/olivernn/lunr.js
|
||||
lunrJS: lunr@2.3.9/lunr.min.js
|
||||
# instant.page@5.2.0 https://github.com/instantpage/instant.page
|
||||
instantPage: instant.page@5.2.0/instantpage.js
|
||||
# katex@0.16.9 https://github.com/KaTeX/KaTeX
|
||||
katexAutoRenderJS: katex@0.16.9/dist/contrib/auto-render.min.js
|
||||
katexCopyTexJS: katex@0.16.9/dist/contrib/copy-tex.min.js
|
||||
katexCSS: katex@0.16.9/dist/katex.min.css
|
||||
katexJS: katex@0.16.9/dist/katex.min.js
|
||||
katexMhchemJS: katex@0.16.9/dist/contrib/mhchem.min.js
|
||||
# lightgallery@2.7.2 https://github.com/sachinchoolur/lightgallery
|
||||
lightgalleryCSS: lightgallery@2.7.2/css/lightgallery-bundle.min.css
|
||||
lightgalleryJS: lightgallery@2.7.2/lightgallery.min.js
|
||||
lightgalleryThumbnailJS: lightgallery@2.7.2/plugins/thumbnail/lg-thumbnail.min.js
|
||||
lightgalleryZoomJS: lightgallery@2.7.2/plugins/zoom/lg-zoom.min.js
|
||||
# mapbox-gl@2.10.0 https://docs.mapbox.com/mapbox-gl-js
|
||||
# TODO update to 3.x
|
||||
mapboxGLCSS: mapbox-gl@2.10.0/dist/mapbox-gl.css
|
||||
mapboxGLJS: mapbox-gl@2.10.0/dist/mapbox-gl.js
|
||||
# mermaid@9.1.7 https://github.com/mermaid-js/mermaid
|
||||
mermaidJS: mermaid@9.1.7/dist/mermaid.min.js
|
||||
# mermaid@9.4.3 https://github.com/mermaid-js/mermaid
|
||||
# TODO bump Mermaid from 9.x to 10.x
|
||||
mermaidJS: mermaid@9.4.3/dist/mermaid.min.js
|
||||
# meting@2.0.1 https://github.com/metowolf/MetingJS
|
||||
metingJS: meting@2.0.1/dist/Meting.min.js
|
||||
# object-fit-images@3.2.4 https://github.com/fregante/object-fit-images
|
||||
@@ -68,19 +68,19 @@ libFiles:
|
||||
panguJS: pangu@4.0.7/dist/browser/pangu.min.js
|
||||
# pace-js@1.2.4 https://github.com/CodeByZach/pace
|
||||
paceJS: pace-js@1.2.4
|
||||
# sharer.js@0.4.2 https://github.com/ellisonleao/sharer.js
|
||||
# sharer.js@0.5.1 https://github.com/ellisonleao/sharer.js
|
||||
sharerJS: sharer.js@0.5.1/sharer.min.js
|
||||
# twemoji@13.1.0 https://github.com/twitter/twemoji
|
||||
# twemoji@14.0.2 https://github.com/twitter/twemoji
|
||||
twemojiJS: twemoji@14.0.2/dist/twemoji.min.js
|
||||
# twikoo@1.6.8 https://github.com/imaegoo/twikoo
|
||||
twikooJS: twikoo@1.6.8/dist/twikoo.all.min.js
|
||||
# typeit@8.7.0 https://github.com/alexmacarthur/typeit
|
||||
typeitJS: typeit@8.7.0/dist/index.umd.js
|
||||
# twikoo@1.6.22 https://github.com/imaegoo/twikoo
|
||||
twikooJS: twikoo@1.6.22/dist/twikoo.all.min.js
|
||||
# typeit@8.7.1 https://github.com/alexmacarthur/typeit
|
||||
typeitJS: typeit@8.7.1/dist/index.umd.js
|
||||
# valine@1.5.1 https://github.com/xCss/Valine
|
||||
valineJS: valine@1.5.1/dist/Valine.min.js
|
||||
# vconsole@3.14.6 https://github.com/Tencent/vConsole
|
||||
vconsoleJS: vconsole@3.14.6/dist/vconsole.min.js
|
||||
# waline@2.10.0 https://github.com/walinejs/waline
|
||||
walineCSS: '@waline/client@2.10.0/dist/waline.css'
|
||||
walineJS: '@waline/client@2.10.0/dist/waline.js'
|
||||
# vconsole@3.15.1 https://github.com/Tencent/vConsole
|
||||
vconsoleJS: vconsole@3.15.1/dist/vconsole.min.js
|
||||
# waline@2.15.8 https://github.com/walinejs/waline
|
||||
walineCSS: '@waline/client@2.15.8/dist/waline.css'
|
||||
walineJS: '@waline/client@2.15.8/dist/waline.js'
|
||||
|
||||
@@ -547,7 +547,7 @@ qqgroup:
|
||||
Template: https://qm.qq.com/cgi-bin/qm/qr?k=%v&jump_from=webapi
|
||||
Title: QQ Group
|
||||
Icon:
|
||||
Class: fa-solid fa-users
|
||||
Simpleicons: tencentqq
|
||||
|
||||
# 070: Diaspora
|
||||
diaspora:
|
||||
@@ -562,7 +562,7 @@ csdn:
|
||||
Prefix: https://blog.csdn.net/
|
||||
Title: CSDN
|
||||
Icon:
|
||||
Src: svg/icons/csdn.svg
|
||||
Src: images/icons/csdn.svg
|
||||
|
||||
# 072: Discord User Profile
|
||||
discord:
|
||||
@@ -573,7 +573,7 @@ discord:
|
||||
Class: fa-brands fa-discord fa-fw
|
||||
|
||||
# 073: Discord Server Invite Link
|
||||
discordInvite:
|
||||
discordinvite:
|
||||
Weight: 73
|
||||
Prefix: https://discord.gg/
|
||||
Title: Discord
|
||||
@@ -615,13 +615,13 @@ plume:
|
||||
Weight: 78
|
||||
Title: Plume
|
||||
Icon:
|
||||
Src: svg/icons/plume.svg
|
||||
Src: images/icons/plume.svg
|
||||
|
||||
# 079: Hack The Box
|
||||
hackthebox:
|
||||
Weight: 79
|
||||
Title: Hack The Box
|
||||
Prefix: https://app.hackthebox.com/profile/
|
||||
Prefix: https://app.hackthebox.com/users/
|
||||
Icon:
|
||||
Simpleicons: hackthebox
|
||||
|
||||
@@ -631,7 +631,7 @@ rootme:
|
||||
Title: Root-Me
|
||||
Prefix: https://www.root-me.org/
|
||||
Icon:
|
||||
Src: svg/icons/rootme.svg
|
||||
Src: images/icons/rootme.svg
|
||||
|
||||
# 081: Feishu
|
||||
feishu:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" version="1.1"><defs><style>.fixit-ban{opacity:.9;}</style></defs><path d="M159.12 338.69l24.8-16.54a78.87 78.87 0 0 1-6.77-22.72l-30.88 4.41a16 16 0 0 1-4.54-31.68l34.27-4.9v-.76l98.94 98.95a76.89 76.89 0 0 1-71.68-17.73l-26.39 17.59c-.15.11-.31.21-.47.31a16 16 0 0 1-17.28-26.93zm224.72-48.42a16 16 0 0 0-13.57-18.11l-34.27-4.9V244.9l34.27-4.9a16 16 0 1 0-4.54-31.68l-30.54 4.36a79.31 79.31 0 0 0-6.85-22.85l24.54-16.36a16 16 0 1 0-17.29-26.93l-.46.31-26 17.34a79.9 79.9 0 0 0-102.64-3l139.83 139.88 19.41 2.77a16 16 0 0 0 18.11-13.57z" fill="#358C3C" class="fixit-bug"/><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 432c-101.46 0-184-82.54-184-184a182.84 182.84 0 0 1 33.38-105.37l256 256A182.86 182.86 0 0 1 256 440zm150.62-78.63l-256-256A182.84 182.84 0 0 1 256 72c101.46 0 184 82.54 184 184a182.84 182.84 0 0 1-33.38 105.37z" fill="#FF6347" class="fixit-ban"/></svg>
|
||||
|
Before Width: | Height: | Size: 968 B |
@@ -0,0 +1,11 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" version="1.1">
|
||||
<defs>
|
||||
<style>.fixit-ban{opacity:.9;}</style>
|
||||
</defs>
|
||||
<path
|
||||
d="M159.12 338.69l24.8-16.54a78.87 78.87 0 0 1-6.77-22.72l-30.88 4.41a16 16 0 0 1-4.54-31.68l34.27-4.9v-.76l98.94 98.95a76.89 76.89 0 0 1-71.68-17.73l-26.39 17.59c-.15.11-.31.21-.47.31a16 16 0 0 1-17.28-26.93zm224.72-48.42a16 16 0 0 0-13.57-18.11l-34.27-4.9V244.9l34.27-4.9a16 16 0 1 0-4.54-31.68l-30.54 4.36a79.31 79.31 0 0 0-6.85-22.85l24.54-16.36a16 16 0 1 0-17.29-26.93l-.46.31-26 17.34a79.9 79.9 0 0 0-102.64-3l139.83 139.88 19.41 2.77a16 16 0 0 0 18.11-13.57z"
|
||||
fill="#358C3C" class="fixit-bug" />
|
||||
<path
|
||||
d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 432c-101.46 0-184-82.54-184-184a182.84 182.84 0 0 1 33.38-105.37l256 256A182.86 182.86 0 0 1 256 440zm150.62-78.63l-256-256A182.84 182.84 0 0 1 256 72c101.46 0 184 82.54 184 184a182.84 182.84 0 0 1-33.38 105.37z"
|
||||
fill="#FF6347" class="fixit-ban" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1004 B |
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 370 391" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#FF4088;stroke:#C9177E;stroke-width:27;}
|
||||
.st1{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
|
||||
</style>
|
||||
<path class="st0" d="M207.5,22.4L321.9,89c13.5,7.9,21.9,22.4,21.9,38v136.4c0,17.3-9.3,33.3-24.5,41.8l-113.5,63.9
|
||||
c-15.1,8.5-33.5,8.4-48.5-0.2L52.8,308.8c-16.4-9.5-26.6-27-26.6-45.9V133.4c0-19.1,9.9-36.8,26.1-46.8l102.8-63.5
|
||||
C171.1,13.2,191.3,13,207.5,22.4z"/>
|
||||
<polygon class="st1" points="105.6,298.2 105.6,91 149,91 149,166.5 220.9,166.5 220.9,91 264.4,91 264.4,298.2 220.9,298.2
|
||||
220.9,207.6 149,207.6 149,298.2 "/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 787 B |
|
Before Width: | Height: | Size: 547 B After Width: | Height: | Size: 547 B |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 503 B After Width: | Height: | Size: 503 B |
@@ -8,14 +8,12 @@ const BASE_CACHE_FILES = [
|
||||
'/css/style.min.css',
|
||||
'/js/theme.min.js',
|
||||
'/site.webmanifest',
|
||||
'/fixit.min.svg'
|
||||
];
|
||||
|
||||
const OFFLINE_CACHE_FILES = [
|
||||
'/css/style.min.css',
|
||||
'/js/theme.min.js',
|
||||
'/site.webmanifest',
|
||||
'/fixit.min.svg',
|
||||
'/offline/'
|
||||
];
|
||||
|
||||
@@ -23,7 +21,6 @@ const NOT_FOUND_CACHE_FILES = [
|
||||
'/css/style.min.css',
|
||||
'/js/theme.min.js',
|
||||
'/site.webmanifest',
|
||||
'/fixit.min.svg',
|
||||
'/404.html'
|
||||
];
|
||||
|
||||
|
||||
@@ -1,66 +1,9 @@
|
||||
class Util {
|
||||
forEach(elements, handler) {
|
||||
elements = elements || [];
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
handler(elements[i]);
|
||||
}
|
||||
}
|
||||
|
||||
getScrollTop() {
|
||||
return (document.documentElement ?? document.body).scrollTop;
|
||||
}
|
||||
|
||||
isMobile() {
|
||||
return window.matchMedia('only screen and (max-width: 680px)').matches;
|
||||
}
|
||||
|
||||
isTocStatic() {
|
||||
return window.matchMedia('only screen and (max-width: 960px)').matches;
|
||||
}
|
||||
|
||||
/**
|
||||
* add animate to element
|
||||
* @param {Element} element animate element
|
||||
* @param {String|Array<String>} animation animation name
|
||||
* @param {Boolean} reserved reserved animation
|
||||
* @param {Function} callback remove callback
|
||||
*/
|
||||
animateCSS(element, animation, reserved, callback) {
|
||||
!Array.isArray(animation) && (animation = [animation]);
|
||||
element.classList.add('animate__animated', ...animation);
|
||||
element.addEventListener('animationend', () => {
|
||||
!reserved && element.classList.remove('animate__animated', ...animation);
|
||||
typeof callback === 'function' && callback();
|
||||
}, { once: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* date validator
|
||||
* @param {*} date may be date or not
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isValidDate(date) {
|
||||
return date instanceof Date && !isNaN(date.getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* scroll some element into view
|
||||
* @param {String} selector element to scroll
|
||||
*/
|
||||
scrollIntoView(selector) {
|
||||
const element = selector.startsWith('#')
|
||||
? document.getElementById(selector.slice(1))
|
||||
: document.querySelector(selector);
|
||||
element?.scrollIntoView({
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
}
|
||||
import Util from './util';
|
||||
|
||||
class FixIt {
|
||||
constructor() {
|
||||
this.config = window.config;
|
||||
this.data = this.config.data;
|
||||
this.data = this.config.data || [];
|
||||
this.isDark = document.body.dataset.theme === 'dark';
|
||||
this.util = new Util();
|
||||
this.newScrollTop = this.util.getScrollTop();
|
||||
@@ -69,6 +12,7 @@ class FixIt {
|
||||
this.resizeEventSet = new Set();
|
||||
this.switchThemeEventSet = new Set();
|
||||
this.clickMaskEventSet = new Set();
|
||||
this.beforeprintEventSet = new Set();
|
||||
this.disableScrollEvent = false;
|
||||
window.objectFitImages && objectFitImages();
|
||||
}
|
||||
@@ -87,13 +31,13 @@ class FixIt {
|
||||
|
||||
initSVGIcon() {
|
||||
this.util.forEach(document.querySelectorAll('[data-svg-src]'), ($icon) => {
|
||||
fetch($icon.getAttribute('data-svg-src'))
|
||||
fetch($icon.dataset.svgSrc)
|
||||
.then((response) => response.text())
|
||||
.then((svg) => {
|
||||
const $temp = document.createElement('div');
|
||||
$temp.insertAdjacentHTML('afterbegin', svg);
|
||||
const $svg = $temp.firstChild;
|
||||
$svg.setAttribute('data-svg-src', $icon.getAttribute('data-svg-src'));
|
||||
$svg.dataset.svgSrc = $icon.dataset.svgSrc
|
||||
$svg.classList.add('icon');
|
||||
const $titleElements = $svg.getElementsByTagName('title');
|
||||
$titleElements.length && $svg.removeChild($titleElements[0]);
|
||||
@@ -115,7 +59,7 @@ class FixIt {
|
||||
}
|
||||
|
||||
initMenuDesktop() {
|
||||
this.util.forEach(document.querySelectorAll('.has-children, #header-desktop .language'), ($item) => {
|
||||
this.util.forEach(document.querySelectorAll('.has-children'), ($item) => {
|
||||
$item.querySelector('.sub-menu').style.minWidth = `${$item.offsetWidth - 8}px`;
|
||||
});
|
||||
}
|
||||
@@ -254,74 +198,7 @@ class FixIt {
|
||||
$searchClear.style.display = 'inline';
|
||||
callback(results);
|
||||
};
|
||||
if (searchConfig.type === 'lunr') {
|
||||
const search = () => {
|
||||
if (lunr.queryHandler) {
|
||||
query = lunr.queryHandler(query);
|
||||
}
|
||||
const results = {};
|
||||
this._index.search(query).forEach(({ ref, matchData: { metadata } }) => {
|
||||
const matchData = this._indexData[ref];
|
||||
let { uri, title, content: context } = matchData;
|
||||
if (results[uri]) {
|
||||
return;
|
||||
}
|
||||
let position = 0;
|
||||
Object.values(metadata).forEach(({ content }) => {
|
||||
if (content) {
|
||||
const matchPosition = content.position[0][0];
|
||||
if (matchPosition < position || position === 0) {
|
||||
position = matchPosition;
|
||||
}
|
||||
}
|
||||
});
|
||||
position -= snippetLength / 5;
|
||||
if (position > 0) {
|
||||
position += context.substr(position, 20).lastIndexOf(' ') + 1;
|
||||
context = '...' + context.substr(position, snippetLength);
|
||||
} else {
|
||||
context = context.substr(0, snippetLength);
|
||||
}
|
||||
Object.keys(metadata).forEach((key) => {
|
||||
title = title.replace(new RegExp(`(${key})`, 'gi'), `<${highlightTag}>$1</${highlightTag}>`);
|
||||
context = context.replace(new RegExp(`(${key})`, 'gi'), `<${highlightTag}>$1</${highlightTag}>`);
|
||||
});
|
||||
results[uri] = {
|
||||
uri: uri,
|
||||
title: title,
|
||||
date: matchData.date,
|
||||
context: context
|
||||
};
|
||||
});
|
||||
return Object.values(results).slice(0, maxResultLength);
|
||||
};
|
||||
if (!this._index) {
|
||||
fetch(searchConfig.lunrIndexURL)
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
const indexData = {};
|
||||
this._index = lunr(function () {
|
||||
if (searchConfig.lunrLanguageCode) this.use(lunr[searchConfig.lunrLanguageCode]);
|
||||
this.ref('objectID');
|
||||
this.field('title', { boost: 50 });
|
||||
this.field('tags', { boost: 20 });
|
||||
this.field('categories', { boost: 20 });
|
||||
this.field('content', { boost: 10 });
|
||||
this.metadataWhitelist = ['position'];
|
||||
data.forEach((record) => {
|
||||
indexData[record.objectID] = record;
|
||||
this.add(record);
|
||||
});
|
||||
});
|
||||
this._indexData = indexData;
|
||||
finish(search());
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
finish([]);
|
||||
});
|
||||
} else finish(search());
|
||||
} else if (searchConfig.type === 'algolia') {
|
||||
if (searchConfig.type === 'algolia') {
|
||||
this._algoliaIndex =
|
||||
this._algoliaIndex || algoliasearch(searchConfig.algoliaAppID, searchConfig.algoliaSearchKey).initIndex(searchConfig.algoliaIndex);
|
||||
this._algoliaIndex
|
||||
@@ -427,17 +304,11 @@ class FixIt {
|
||||
icon: '<i class="fa-brands fa-algolia fa-fw" aria-hidden="true"></i>',
|
||||
href: 'https://www.algolia.com/'
|
||||
}
|
||||
: (searchConfig.type === 'lunr'
|
||||
? {
|
||||
searchType: 'Lunr.js',
|
||||
icon: '',
|
||||
href: 'https://lunrjs.com/'
|
||||
}
|
||||
: {
|
||||
searchType: 'Fuse.js',
|
||||
icon: '',
|
||||
href: 'https://fusejs.io/'
|
||||
})
|
||||
: {
|
||||
searchType: 'Fuse.js',
|
||||
icon: '',
|
||||
href: 'https://fusejs.io/'
|
||||
}
|
||||
return `<div class="search-footer">Search by <a href="${href}" rel="noopener noreferrer" target="_blank">${icon} ${searchType}</a></div>`;
|
||||
}
|
||||
}
|
||||
@@ -452,26 +323,14 @@ class FixIt {
|
||||
this._searchDesktop = autosearch;
|
||||
}
|
||||
};
|
||||
if (searchConfig.lunrSegmentitURL && !document.getElementById('lunr-segmentit')) {
|
||||
const script = document.createElement('script');
|
||||
script.id = 'lunr-segmentit';
|
||||
script.src = searchConfig.lunrSegmentitURL;
|
||||
script.async = true;
|
||||
if (script.readyState) {
|
||||
script.onreadystatechange = () => {
|
||||
if (script.readyState == 'loaded' || script.readyState == 'complete') {
|
||||
script.onreadystatechange = null;
|
||||
initAutosearch();
|
||||
}
|
||||
};
|
||||
} else {
|
||||
script.onload = () => {
|
||||
initAutosearch();
|
||||
};
|
||||
}
|
||||
document.body.appendChild(script);
|
||||
} else {
|
||||
initAutosearch();
|
||||
initAutosearch();
|
||||
}
|
||||
|
||||
initBreadcrumb() {
|
||||
const $breadcrumbContainer = document.querySelector('.breadcrumb-container.sticky')
|
||||
this.breadcrumbHeight = $breadcrumbContainer?.clientHeight ?? 0;
|
||||
if (this.breadcrumbHeight) {
|
||||
document.querySelector('main.container')?.style.setProperty('--fi-breadcrumb-height', `${this.breadcrumbHeight}px`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,7 +386,8 @@ class FixIt {
|
||||
// code title
|
||||
const $title = document.createElement('span');
|
||||
$title.classList.add('code-title');
|
||||
$title.insertAdjacentHTML('afterbegin', '<i class="arrow fa-solid fa-chevron-right fa-fw" aria-hidden="true"></i>');
|
||||
const hlAttrs = this.data[$chroma.parentNode.id];
|
||||
$title.insertAdjacentHTML('afterbegin', `<i class="arrow fa-solid fa-chevron-right fa-fw" aria-hidden="true"></i><span class="title-inner">${hlAttrs?.title ?? ''}</span>`);
|
||||
$title.addEventListener('click', () => {
|
||||
$chroma.classList.toggle('open');
|
||||
}, false);
|
||||
@@ -600,23 +460,21 @@ class FixIt {
|
||||
});
|
||||
}
|
||||
|
||||
initHeaderLink() {
|
||||
for (let num = 1; num <= 6; num++) {
|
||||
this.util.forEach(document.querySelectorAll('.single .content > h' + num), ($header) => {
|
||||
$header.classList.add('header-link');
|
||||
$header.insertAdjacentHTML('afterbegin', `<a href="#${$header.id}" class="header-mark"></a>`);
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* init table of contents
|
||||
*/
|
||||
initToc() {
|
||||
const $tocCore = document.getElementById('TableOfContents');
|
||||
let $tocCore = document.getElementById('TableOfContents');
|
||||
if ($tocCore === null) {
|
||||
return;
|
||||
}
|
||||
if (document.getElementById('toc-static').getAttribute('data-kept') === 'true' || this.util.isTocStatic()) {
|
||||
// It's a dirty hack to fix the bug of APlayer, see https://github.com/hugo-fixit/FixIt/issues/292
|
||||
if (typeof APlayer === 'function') {
|
||||
const $newTocCore = $tocCore.cloneNode(true);
|
||||
$tocCore.parentElement.replaceChild($newTocCore, $tocCore);
|
||||
$tocCore = $newTocCore;
|
||||
}
|
||||
if (document.getElementById('toc-static').dataset.kept === 'true' || this.util.isTocStatic()) {
|
||||
const $tocContentStatic = document.getElementById('toc-content-static');
|
||||
if ($tocCore.parentElement !== $tocContentStatic) {
|
||||
$tocCore.parentElement.removeChild($tocCore);
|
||||
@@ -636,8 +494,7 @@ class FixIt {
|
||||
$toc.style.marginTop = `${$postMeta.offsetTop + $postMeta.clientHeight}px`;
|
||||
const $tocLinkElements = $tocCore.querySelectorAll('a:first-child');
|
||||
const $tocLiElements = $tocCore.getElementsByTagName('li');
|
||||
const $headerLinkElements = document.getElementsByClassName('header-link');
|
||||
const headerIsFixed = document.body.getAttribute('data-header-desktop') !== 'normal';
|
||||
const $headingElements = document.getElementsByClassName('heading-element');
|
||||
const headerHeight = document.getElementById('header-desktop').offsetHeight;
|
||||
document.querySelector('.container').addEventListener('resize', () => {
|
||||
$toc.style.marginBottom = `${document.querySelector('.container').clientHeight - document.querySelector('.post-footer').offsetTop}px`;
|
||||
@@ -650,17 +507,17 @@ class FixIt {
|
||||
this.util.forEach($tocLiElements, ($tocLi) => {
|
||||
$tocLi.classList.remove('has-active');
|
||||
});
|
||||
const INDEX_SPACING = 20 + (headerIsFixed ? headerHeight : 0);
|
||||
let activeTocIndex = $headerLinkElements.length - 1;
|
||||
for (let i = 0; i < $headerLinkElements.length - 1; i++) {
|
||||
const thisTop = $headerLinkElements[i].getBoundingClientRect().top;
|
||||
const nextTop = $headerLinkElements[i + 1].getBoundingClientRect().top;
|
||||
const INDEX_SPACING = 20 + (document.body.dataset.headerDesktop !== 'normal' ? headerHeight : 0) + this.breadcrumbHeight;
|
||||
let activeTocIndex = $headingElements.length - 1;
|
||||
for (let i = 0; i < $headingElements.length - 1; i++) {
|
||||
const thisTop = $headingElements[i].getBoundingClientRect().top;
|
||||
const nextTop = $headingElements[i + 1].getBoundingClientRect().top;
|
||||
if ((i == 0 && thisTop > INDEX_SPACING) || (thisTop <= INDEX_SPACING && nextTop > INDEX_SPACING)) {
|
||||
activeTocIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (activeTocIndex !== -1) {
|
||||
if (activeTocIndex !== -1 && $tocLinkElements[activeTocIndex]) {
|
||||
$tocLinkElements[activeTocIndex].classList.add('active');
|
||||
let $parent = $tocLinkElements[activeTocIndex].parentElement;
|
||||
while ($parent !== $tocCore) {
|
||||
@@ -693,21 +550,24 @@ class FixIt {
|
||||
}
|
||||
}
|
||||
|
||||
switchMermaidTheme(theme) {
|
||||
const $mermaidElements = document.getElementsByClassName('mermaid');
|
||||
if ($mermaidElements.length) {
|
||||
// TODO perf
|
||||
const themes = this.config.mermaid.themes ?? ['default', 'dark', 'neutral'];
|
||||
mermaid.initialize({ startOnLoad: false, theme: theme ?? (this.isDark ? themes[1] : themes[0]), securityLevel: 'loose' });
|
||||
this.util.forEach($mermaidElements, $mermaid => {
|
||||
mermaid.render('svg-' + $mermaid.id, this.data[$mermaid.id], svgCode => {
|
||||
$mermaid.innerHTML = svgCode;
|
||||
}, $mermaid);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
initMermaid() {
|
||||
this._mermaidOnSwitchTheme = this._mermaidOnSwitchTheme || (() => {
|
||||
const $mermaidElements = document.getElementsByClassName('mermaid');
|
||||
if ($mermaidElements.length) {
|
||||
const themes = this.config.mermaid.themes ?? ['neutral', 'dark'];
|
||||
mermaid.initialize({startOnLoad: false, theme: this.isDark ? themes[1] : themes[0], securityLevel: 'loose'});
|
||||
this.util.forEach($mermaidElements, $mermaid => {
|
||||
mermaid.render('svg-' + $mermaid.id, this.data[$mermaid.id], svgCode => {
|
||||
$mermaid.innerHTML = svgCode;
|
||||
}, $mermaid);
|
||||
});
|
||||
}
|
||||
});
|
||||
this.switchThemeEventSet.add(this._mermaidOnSwitchTheme);
|
||||
this._mermaidOnSwitchTheme();
|
||||
this.switchMermaidTheme();
|
||||
this.switchThemeEventSet.add(() => { this.switchMermaidTheme(); });
|
||||
this.beforeprintEventSet.add(() => { this.switchMermaidTheme('neutral'); });
|
||||
}
|
||||
|
||||
initEcharts() {
|
||||
@@ -798,9 +658,11 @@ class FixIt {
|
||||
const speed = typeitConfig.speed || 100;
|
||||
const cursorSpeed = typeitConfig.cursorSpeed || 1000;
|
||||
const cursorChar = typeitConfig.cursorChar || '|';
|
||||
const loop = typeitConfig.loop ?? false;
|
||||
Object.values(typeitConfig.data).forEach((group) => {
|
||||
const typeone = (i) => {
|
||||
const id = group[i];
|
||||
const shortcodeLoop = document.querySelector(`#${id}`).parentElement.dataset.loop;
|
||||
const instance = new TypeIt(`#${id}`, {
|
||||
strings: this.data[id],
|
||||
speed: speed,
|
||||
@@ -808,6 +670,7 @@ class FixIt {
|
||||
cursorSpeed: cursorSpeed,
|
||||
cursorChar: cursorChar,
|
||||
waitUntilVisible: true,
|
||||
loop: shortcodeLoop ? JSON.parse(shortcodeLoop) : loop,
|
||||
afterComplete: () => {
|
||||
if (i === group.length - 1) {
|
||||
if (typeitConfig.duration >= 0) {
|
||||
@@ -872,7 +735,7 @@ class FixIt {
|
||||
countEl: this.config.comment.artalk.countEl
|
||||
})
|
||||
}
|
||||
const artalk = new Artalk(this.config.comment.artalk);
|
||||
const artalk = Artalk.init(this.config.comment.artalk);
|
||||
artalk.setDarkMode(this.isDark);
|
||||
this.switchThemeEventSet.add(() => {
|
||||
artalk.setDarkMode(this.isDark);
|
||||
@@ -953,15 +816,13 @@ class FixIt {
|
||||
document.querySelector('.giscus-frame')?.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');
|
||||
});
|
||||
this.switchThemeEventSet.add(this._giscusOnSwitchTheme);
|
||||
const _this = this;
|
||||
_this.giscus2parentMsg = window.addEventListener('message', (event) => {
|
||||
this.giscus2parentMsg = window.addEventListener('message', (event) => {
|
||||
const $script = document.querySelector('#giscus>script');
|
||||
if ($script){
|
||||
_this._giscusOnSwitchTheme();
|
||||
this._giscusOnSwitchTheme();
|
||||
$script.parentElement.removeChild($script);
|
||||
}
|
||||
window.removeEventListener('message', _this.giscus2parentMsg);
|
||||
});
|
||||
}, { once: true });
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1022,7 +883,7 @@ class FixIt {
|
||||
this.config.watermark?.enable &&
|
||||
new Watermark({
|
||||
content: this.config.watermark.content || `${document.querySelector('footer .fixit-icon')?.outerHTML ?? ''} FixIt Theme`,
|
||||
appendTo: this.config.watermark.appendto || '.wrapper>main',
|
||||
appendTo: '.widgets',
|
||||
opacity: this.config.watermark.opacity,
|
||||
width: this.config.watermark.width,
|
||||
height: this.config.watermark.height,
|
||||
@@ -1053,7 +914,6 @@ class FixIt {
|
||||
}
|
||||
|
||||
initFixItDecryptor() {
|
||||
const $tocNodes = document.querySelectorAll('#toc-auto>.d-none, #toc-static.d-none');
|
||||
this.decryptor = new FixItDecryptor({
|
||||
decrypted: () => {
|
||||
this.initTwemoji();
|
||||
@@ -1061,22 +921,21 @@ class FixIt {
|
||||
this.initLightGallery();
|
||||
this.initHighlight();
|
||||
this.initTable();
|
||||
this.initHeaderLink();
|
||||
this.initMath();
|
||||
this.initMermaid();
|
||||
this.initEcharts();
|
||||
this.initTypeit();
|
||||
this.initMapbox();
|
||||
this.util.forEach($tocNodes, ($element) => {
|
||||
$element.classList.remove('d-none');
|
||||
this.util.forEach(document.querySelectorAll('.encrypted-hidden'), ($element) => {
|
||||
$element.classList.replace('encrypted-hidden', 'decrypted-shown');
|
||||
});
|
||||
this.initToc();
|
||||
this.initTocListener();
|
||||
this.initPangu();
|
||||
},
|
||||
reset: () => {
|
||||
this.util.forEach($tocNodes, ($element) => {
|
||||
$element.classList.add('d-none');
|
||||
this.util.forEach(document.querySelectorAll('.decrypted-shown'), ($element) => {
|
||||
$element.classList.replace('decrypted-shown', 'encrypted-hidden');
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -1132,12 +991,43 @@ class FixIt {
|
||||
}
|
||||
}
|
||||
|
||||
initReward() {
|
||||
const $rewards = document.querySelectorAll('.post-reward [data-mode="fixed"]');
|
||||
if (!$rewards.length) {
|
||||
return;
|
||||
}
|
||||
// `fixed` mode only supports desktop
|
||||
if (this.util.isMobile()) {
|
||||
this.util.forEach($rewards, ($reward) => {
|
||||
$reward.removeAttribute('data-mode');
|
||||
});
|
||||
return;
|
||||
}
|
||||
// Close post reward images exclude special id
|
||||
const _closeRewardExclude = (id) => {
|
||||
this.util.forEach($rewards, ($reward) => {
|
||||
const $rewardInput = $reward.parentElement.querySelector('.reward-input');
|
||||
if ($rewardInput.id !== id) {
|
||||
$rewardInput.checked = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
// Add additional click event to reward buttons
|
||||
this.util.forEach($rewards, ($reward) => {
|
||||
$reward.previousElementSibling.addEventListener('click', function () {
|
||||
_closeRewardExclude(this.getAttribute('for'));
|
||||
}, false)
|
||||
});
|
||||
this.scrollEventSet.add(_closeRewardExclude);
|
||||
}
|
||||
|
||||
onScroll() {
|
||||
const $headers = [];
|
||||
const ACCURACY = 20;
|
||||
const $fixedButtons = document.querySelector('.fixed-buttons');
|
||||
const $backToTop = document.querySelector('.back-to-top');
|
||||
const $readingProgressBar = document.querySelector('.reading-progress-bar');
|
||||
let scrollTimer = void 0;
|
||||
if (document.body.dataset.headerDesktop === 'auto') {
|
||||
$headers.push(document.getElementById('header-desktop'));
|
||||
}
|
||||
@@ -1156,6 +1046,12 @@ class FixIt {
|
||||
const $mask = document.getElementById('mask');
|
||||
this.newScrollTop = this.util.getScrollTop();
|
||||
const scroll = this.newScrollTop - this.oldScrollTop;
|
||||
// body scrollbar style
|
||||
document.body.toggleAttribute('data-scroll', true);
|
||||
scrollTimer && window.clearTimeout(scrollTimer);
|
||||
scrollTimer = window.setTimeout(() => {
|
||||
document.body.toggleAttribute('data-scroll');
|
||||
}, 500);
|
||||
// header animation
|
||||
this.util.forEach($headers, ($header) => {
|
||||
if (scroll > ACCURACY) {
|
||||
@@ -1205,7 +1101,7 @@ class FixIt {
|
||||
event();
|
||||
}
|
||||
this.initToc();
|
||||
this.initMermaid();
|
||||
this.switchMermaidTheme();
|
||||
this.initSearch();
|
||||
|
||||
const isMobile = this.util.isMobile()
|
||||
@@ -1231,6 +1127,17 @@ class FixIt {
|
||||
}, false);
|
||||
}
|
||||
|
||||
beforeprint() {
|
||||
window.addEventListener('beforeprint', () => {
|
||||
this.util.forEach(document.querySelectorAll('.chroma'), ($el) => {
|
||||
$el.classList.toggle('open', true)
|
||||
});
|
||||
for (let event of this.beforeprintEventSet) {
|
||||
event();
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
init() {
|
||||
try {
|
||||
if (this.config.encryption) {
|
||||
@@ -1241,7 +1148,6 @@ class FixIt {
|
||||
this.initLightGallery();
|
||||
this.initHighlight();
|
||||
this.initTable();
|
||||
this.initHeaderLink();
|
||||
this.initMath();
|
||||
this.initMermaid();
|
||||
this.initEcharts();
|
||||
@@ -1254,12 +1160,14 @@ class FixIt {
|
||||
this.initMenu();
|
||||
this.initSwitchTheme();
|
||||
this.initSearch();
|
||||
this.initBreadcrumb();
|
||||
this.initCookieconsent();
|
||||
this.initSiteTime();
|
||||
this.initServiceWorker();
|
||||
this.initWatermark();
|
||||
this.initMDevtools();
|
||||
this.initAutoMark();
|
||||
this.initReward();
|
||||
|
||||
window.setTimeout(() => {
|
||||
this.initComment();
|
||||
@@ -1270,6 +1178,7 @@ class FixIt {
|
||||
this.onScroll();
|
||||
this.onResize();
|
||||
this.onClickMask();
|
||||
this.beforeprint();
|
||||
}, 100);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
@@ -0,0 +1,58 @@
|
||||
export default class Util {
|
||||
forEach(elements, handler) {
|
||||
elements = elements || [];
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
handler(elements[i]);
|
||||
}
|
||||
}
|
||||
|
||||
getScrollTop() {
|
||||
return (document.documentElement ?? document.body).scrollTop;
|
||||
}
|
||||
|
||||
isMobile() {
|
||||
return window.matchMedia('only screen and (max-width: 680px)').matches;
|
||||
}
|
||||
|
||||
isTocStatic() {
|
||||
return window.matchMedia('only screen and (max-width: 960px)').matches;
|
||||
}
|
||||
|
||||
/**
|
||||
* add animate to element
|
||||
* @param {Element} element animate element
|
||||
* @param {String|Array<String>} animation animation name
|
||||
* @param {Boolean} reserved reserved animation
|
||||
* @param {Function} callback remove callback
|
||||
*/
|
||||
animateCSS(element, animation, reserved, callback) {
|
||||
!Array.isArray(animation) && (animation = [animation]);
|
||||
element.classList.add('animate__animated', ...animation);
|
||||
element.addEventListener('animationend', () => {
|
||||
!reserved && element.classList.remove('animate__animated', ...animation);
|
||||
typeof callback === 'function' && callback();
|
||||
}, { once: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* date validator
|
||||
* @param {*} date may be date or not
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isValidDate(date) {
|
||||
return date instanceof Date && !isNaN(date.getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* scroll some element into view
|
||||
* @param {String} selector element to scroll
|
||||
*/
|
||||
scrollIntoView(selector) {
|
||||
const element = selector.startsWith('#')
|
||||
? document.getElementById(selector.slice(1))
|
||||
: document.querySelector(selector);
|
||||
element?.scrollIntoView({
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,32 +1,32 @@
|
||||
algoliasearch@4.14.2 https://github.com/algolia/algoliasearch-client-javascript
|
||||
algoliasearch@4.20.0 https://github.com/algolia/algoliasearch-client-javascript
|
||||
animate.css@4.1.1 https://github.com/daneden/animate.css
|
||||
aplayer@1.10.1 https://github.com/MoePlayer/APlayer
|
||||
artalk@2.3.4 https://github.com/ArtalkJS/Artalk
|
||||
artalk@2.6.4 https://github.com/ArtalkJS/Artalk
|
||||
autocomplete-js@0.38.1 https://github.com/algolia/autocomplete
|
||||
cell-watermark@1.0.3 https://github.com/Lruihao/watermark
|
||||
cookieconsent@3.1.1 https://github.com/osano/cookieconsent
|
||||
crypto-js@4.1.1 https://github.com/brix/crypto-js
|
||||
echarts@5.3.3 https://github.com/apache/echarts
|
||||
TODO update emoji-data to 15.x
|
||||
emoji-data@14.0.0 https://github.com/iamcal/emoji-data
|
||||
eruda@2.5.0 https://github.com/liriliri/eruda
|
||||
fontawesome-free@6.2.0 https://github.com/FortAwesome/Font-Awesome
|
||||
eruda@3.0.1 https://github.com/liriliri/eruda
|
||||
fontawesome-free@6.4.2 https://github.com/FortAwesome/Font-Awesome
|
||||
fusejs@6.6.2 https://github.com/krisk/fuse
|
||||
gitalk@1.7.2 https://github.com/gitalk/gitalk
|
||||
katex@0.16.2 https://github.com/KaTeX/KaTeX
|
||||
lazysizes@5.3.2 https://github.com/aFarkas/lazysizes
|
||||
lightgallery@2.6.1 https://github.com/sachinchoolur/lightgallery
|
||||
lunr.js@2.3.9 https://github.com/olivernn/lunr.js
|
||||
instant.page@5.2.0 https://github.com/instantpage/instant.page
|
||||
katex@0.16.9 https://github.com/KaTeX/KaTeX
|
||||
lightgallery@2.7.2 https://github.com/sachinchoolur/lightgallery
|
||||
mapbox-gl@2.10.0 https://github.com/mapbox/mapbox-gl-js
|
||||
mermaid@9.1.7 https://github.com/mermaid-js/mermaid
|
||||
mermaid@9.4.3 https://github.com/mermaid-js/mermaid
|
||||
meting@2.0.1 https://github.com/metowolf/MetingJS
|
||||
normalize.css@8.0.1 https://github.com/necolas/normalize.css
|
||||
object-fit-images@3.2.4 https://github.com/fregante/object-fit-images [archived]
|
||||
pangu.js@4.0.7 https://github.com/vinta/pangu.js
|
||||
sharer.js@0.5.1 https://github.com/ellisonleao/sharer.js
|
||||
simple-icons@7.12.0 https://github.com/simple-icons/simple-icons
|
||||
simple-icons@9.19.0 https://github.com/simple-icons/simple-icons
|
||||
twemoji@14.0.2 https://github.com/twitter/twemoji
|
||||
twikoo@1.6.8 https://github.com/imaegoo/twikoo
|
||||
typeit@8.7.0 https://github.com/alexmacarthur/typeit
|
||||
twikoo@1.6.22 https://github.com/imaegoo/twikoo
|
||||
typeit@8.7.1 https://github.com/alexmacarthur/typeit
|
||||
valine@1.5.1 https://github.com/xCss/Valine
|
||||
vconsole@3.14.6 https://github.com/Tencent/vConsole
|
||||
waline@2.10.0 https://github.com/walinejs/waline
|
||||
vconsole@3.15.1 https://github.com/Tencent/vConsole
|
||||
waline@2.15.8 https://github.com/walinejs/waline
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Minified by jsDelivr using Terser v5.15.1.
|
||||
* Original file: /npm/instant.page@5.2.0/instantpage.js
|
||||
*
|
||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||
*/
|
||||
/*! instant.page v5.2.0 - (C) 2019-2023 Alexandre Dieulot - https://instant.page/license */
|
||||
let _allowQueryString,_allowExternalLinks,_useWhitelist,_lastTouchTimestamp,_mouseoverTimer,_chromiumMajorVersionInUserAgent=null,_delayOnHover=65,_preloadedList=new Set;const DELAY_TO_NOT_BE_CONSIDERED_A_TOUCH_INITIATED_ACTION=1111;function init(){if(!document.createElement("link").relList.supports("prefetch"))return;const e="instantVaryAccept"in document.body.dataset||"Shopify"in window,t=navigator.userAgent.indexOf("Chrome/");if(t>-1&&(_chromiumMajorVersionInUserAgent=parseInt(navigator.userAgent.substring(t+"Chrome/".length))),e&&_chromiumMajorVersionInUserAgent&&_chromiumMajorVersionInUserAgent<110)return;const n="instantMousedownShortcut"in document.body.dataset;_allowQueryString="instantAllowQueryString"in document.body.dataset,_allowExternalLinks="instantAllowExternalLinks"in document.body.dataset,_useWhitelist="instantWhitelist"in document.body.dataset;const o={capture:!0,passive:!0};let i=!1,r=!1,s=!1;if("instantIntensity"in document.body.dataset){const e=document.body.dataset.instantIntensity;if(e.startsWith("mousedown"))i=!0,"mousedown-only"==e&&(r=!0);else if(e.startsWith("viewport")){const t=navigator.connection&&navigator.connection.saveData,n=navigator.connection&&navigator.connection.effectiveType&&navigator.connection.effectiveType.includes("2g");t||n||("viewport"==e?document.documentElement.clientWidth*document.documentElement.clientHeight<45e4&&(s=!0):"viewport-all"==e&&(s=!0))}else{const t=parseInt(e);isNaN(t)||(_delayOnHover=t)}}if(r||document.addEventListener("touchstart",touchstartListener,o),i?n||document.addEventListener("mousedown",mousedownListener,o):document.addEventListener("mouseover",mouseoverListener,o),n&&document.addEventListener("mousedown",mousedownShortcutListener,o),s){let e=window.requestIdleCallback;e||(e=e=>{e()}),e((function(){const e=new IntersectionObserver((t=>{t.forEach((t=>{if(t.isIntersecting){const n=t.target;e.unobserve(n),preload(n.href)}}))}));document.querySelectorAll("a").forEach((t=>{isPreloadable(t)&&e.observe(t)}))}),{timeout:1500})}}function touchstartListener(e){_lastTouchTimestamp=performance.now();const t=e.target.closest("a");isPreloadable(t)&&preload(t.href,"high")}function mouseoverListener(e){if(performance.now()-_lastTouchTimestamp<1111)return;if(!("closest"in e.target))return;const t=e.target.closest("a");isPreloadable(t)&&(t.addEventListener("mouseout",mouseoutListener,{passive:!0}),_mouseoverTimer=setTimeout((()=>{preload(t.href,"high"),_mouseoverTimer=void 0}),_delayOnHover))}function mousedownListener(e){const t=e.target.closest("a");isPreloadable(t)&&preload(t.href,"high")}function mouseoutListener(e){e.relatedTarget&&e.target.closest("a")==e.relatedTarget.closest("a")||_mouseoverTimer&&(clearTimeout(_mouseoverTimer),_mouseoverTimer=void 0)}function mousedownShortcutListener(e){if(performance.now()-_lastTouchTimestamp<1111)return;const t=e.target.closest("a");if(e.which>1||e.metaKey||e.ctrlKey)return;if(!t)return;t.addEventListener("click",(function(e){1337!=e.detail&&e.preventDefault()}),{capture:!0,passive:!1,once:!0});const n=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1,detail:1337});t.dispatchEvent(n)}function isPreloadable(e){if(e&&e.href&&(!_useWhitelist||"instant"in e.dataset)){if(e.origin!=location.origin){if(!(_allowExternalLinks||"instant"in e.dataset)||!_chromiumMajorVersionInUserAgent)return}if(["http:","https:"].includes(e.protocol)&&("http:"!=e.protocol||"https:"!=location.protocol)&&(_allowQueryString||!e.search||"instant"in e.dataset)&&!(e.hash&&e.pathname+e.search==location.pathname+location.search||"noInstant"in e.dataset))return!0}}function preload(e,t="auto"){if(_preloadedList.has(e))return;const n=document.createElement("link");n.rel="prefetch",n.href=e,n.fetchPriority=t,n.as="document",document.head.appendChild(n),_preloadedList.add(e)}init();
|
||||
//# sourceMappingURL=/sm/60fb95dda2409979534f889b11a4279c9602c20254de5a856d5c95159338bab2.map
|
||||
@@ -1,206 +0,0 @@
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function () {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
|
||||
return function(lunr) {
|
||||
// TinySegmenter 0.1 -- Super compact Japanese tokenizer in Javascript
|
||||
// (c) 2008 Taku Kudo <taku@chasen.org>
|
||||
// TinySegmenter is freely distributable under the terms of a new BSD licence.
|
||||
// For details, see http://chasen.org/~taku/software/TinySegmenter/LICENCE.txt
|
||||
|
||||
function TinySegmenter() {
|
||||
var patterns = {
|
||||
"[一二三四五六七八九十百千万億兆]":"M",
|
||||
"[一-龠々〆ヵヶ]":"H",
|
||||
"[ぁ-ん]":"I",
|
||||
"[ァ-ヴーア-ン゙ー]":"K",
|
||||
"[a-zA-Za-zA-Z]":"A",
|
||||
"[0-90-9]":"N"
|
||||
}
|
||||
this.chartype_ = [];
|
||||
for (var i in patterns) {
|
||||
var regexp = new RegExp(i);
|
||||
this.chartype_.push([regexp, patterns[i]]);
|
||||
}
|
||||
|
||||
this.BIAS__ = -332
|
||||
this.BC1__ = {"HH":6,"II":2461,"KH":406,"OH":-1378};
|
||||
this.BC2__ = {"AA":-3267,"AI":2744,"AN":-878,"HH":-4070,"HM":-1711,"HN":4012,"HO":3761,"IA":1327,"IH":-1184,"II":-1332,"IK":1721,"IO":5492,"KI":3831,"KK":-8741,"MH":-3132,"MK":3334,"OO":-2920};
|
||||
this.BC3__ = {"HH":996,"HI":626,"HK":-721,"HN":-1307,"HO":-836,"IH":-301,"KK":2762,"MK":1079,"MM":4034,"OA":-1652,"OH":266};
|
||||
this.BP1__ = {"BB":295,"OB":304,"OO":-125,"UB":352};
|
||||
this.BP2__ = {"BO":60,"OO":-1762};
|
||||
this.BQ1__ = {"BHH":1150,"BHM":1521,"BII":-1158,"BIM":886,"BMH":1208,"BNH":449,"BOH":-91,"BOO":-2597,"OHI":451,"OIH":-296,"OKA":1851,"OKH":-1020,"OKK":904,"OOO":2965};
|
||||
this.BQ2__ = {"BHH":118,"BHI":-1159,"BHM":466,"BIH":-919,"BKK":-1720,"BKO":864,"OHH":-1139,"OHM":-181,"OIH":153,"UHI":-1146};
|
||||
this.BQ3__ = {"BHH":-792,"BHI":2664,"BII":-299,"BKI":419,"BMH":937,"BMM":8335,"BNN":998,"BOH":775,"OHH":2174,"OHM":439,"OII":280,"OKH":1798,"OKI":-793,"OKO":-2242,"OMH":-2402,"OOO":11699};
|
||||
this.BQ4__ = {"BHH":-3895,"BIH":3761,"BII":-4654,"BIK":1348,"BKK":-1806,"BMI":-3385,"BOO":-12396,"OAH":926,"OHH":266,"OHK":-2036,"ONN":-973};
|
||||
this.BW1__ = {",と":660,",同":727,"B1あ":1404,"B1同":542,"、と":660,"、同":727,"」と":1682,"あっ":1505,"いう":1743,"いっ":-2055,"いる":672,"うし":-4817,"うん":665,"から":3472,"がら":600,"こう":-790,"こと":2083,"こん":-1262,"さら":-4143,"さん":4573,"した":2641,"して":1104,"すで":-3399,"そこ":1977,"それ":-871,"たち":1122,"ため":601,"った":3463,"つい":-802,"てい":805,"てき":1249,"でき":1127,"です":3445,"では":844,"とい":-4915,"とみ":1922,"どこ":3887,"ない":5713,"なっ":3015,"など":7379,"なん":-1113,"にし":2468,"には":1498,"にも":1671,"に対":-912,"の一":-501,"の中":741,"ませ":2448,"まで":1711,"まま":2600,"まる":-2155,"やむ":-1947,"よっ":-2565,"れた":2369,"れで":-913,"をし":1860,"を見":731,"亡く":-1886,"京都":2558,"取り":-2784,"大き":-2604,"大阪":1497,"平方":-2314,"引き":-1336,"日本":-195,"本当":-2423,"毎日":-2113,"目指":-724,"B1あ":1404,"B1同":542,"」と":1682};
|
||||
this.BW2__ = {"..":-11822,"11":-669,"――":-5730,"−−":-13175,"いう":-1609,"うか":2490,"かし":-1350,"かも":-602,"から":-7194,"かれ":4612,"がい":853,"がら":-3198,"きた":1941,"くな":-1597,"こと":-8392,"この":-4193,"させ":4533,"され":13168,"さん":-3977,"しい":-1819,"しか":-545,"した":5078,"して":972,"しな":939,"その":-3744,"たい":-1253,"たた":-662,"ただ":-3857,"たち":-786,"たと":1224,"たは":-939,"った":4589,"って":1647,"っと":-2094,"てい":6144,"てき":3640,"てく":2551,"ては":-3110,"ても":-3065,"でい":2666,"でき":-1528,"でし":-3828,"です":-4761,"でも":-4203,"とい":1890,"とこ":-1746,"とと":-2279,"との":720,"とみ":5168,"とも":-3941,"ない":-2488,"なが":-1313,"など":-6509,"なの":2614,"なん":3099,"にお":-1615,"にし":2748,"にな":2454,"によ":-7236,"に対":-14943,"に従":-4688,"に関":-11388,"のか":2093,"ので":-7059,"のに":-6041,"のの":-6125,"はい":1073,"はが":-1033,"はず":-2532,"ばれ":1813,"まし":-1316,"まで":-6621,"まれ":5409,"めて":-3153,"もい":2230,"もの":-10713,"らか":-944,"らし":-1611,"らに":-1897,"りし":651,"りま":1620,"れた":4270,"れて":849,"れば":4114,"ろう":6067,"われ":7901,"を通":-11877,"んだ":728,"んな":-4115,"一人":602,"一方":-1375,"一日":970,"一部":-1051,"上が":-4479,"会社":-1116,"出て":2163,"分の":-7758,"同党":970,"同日":-913,"大阪":-2471,"委員":-1250,"少な":-1050,"年度":-8669,"年間":-1626,"府県":-2363,"手権":-1982,"新聞":-4066,"日新":-722,"日本":-7068,"日米":3372,"曜日":-601,"朝鮮":-2355,"本人":-2697,"東京":-1543,"然と":-1384,"社会":-1276,"立て":-990,"第に":-1612,"米国":-4268,"11":-669};
|
||||
this.BW3__ = {"あた":-2194,"あり":719,"ある":3846,"い.":-1185,"い。":-1185,"いい":5308,"いえ":2079,"いく":3029,"いた":2056,"いっ":1883,"いる":5600,"いわ":1527,"うち":1117,"うと":4798,"えと":1454,"か.":2857,"か。":2857,"かけ":-743,"かっ":-4098,"かに":-669,"から":6520,"かり":-2670,"が,":1816,"が、":1816,"がき":-4855,"がけ":-1127,"がっ":-913,"がら":-4977,"がり":-2064,"きた":1645,"けど":1374,"こと":7397,"この":1542,"ころ":-2757,"さい":-714,"さを":976,"し,":1557,"し、":1557,"しい":-3714,"した":3562,"して":1449,"しな":2608,"しま":1200,"す.":-1310,"す。":-1310,"する":6521,"ず,":3426,"ず、":3426,"ずに":841,"そう":428,"た.":8875,"た。":8875,"たい":-594,"たの":812,"たり":-1183,"たる":-853,"だ.":4098,"だ。":4098,"だっ":1004,"った":-4748,"って":300,"てい":6240,"てお":855,"ても":302,"です":1437,"でに":-1482,"では":2295,"とう":-1387,"とし":2266,"との":541,"とも":-3543,"どう":4664,"ない":1796,"なく":-903,"など":2135,"に,":-1021,"に、":-1021,"にし":1771,"にな":1906,"には":2644,"の,":-724,"の、":-724,"の子":-1000,"は,":1337,"は、":1337,"べき":2181,"まし":1113,"ます":6943,"まっ":-1549,"まで":6154,"まれ":-793,"らし":1479,"られ":6820,"るる":3818,"れ,":854,"れ、":854,"れた":1850,"れて":1375,"れば":-3246,"れる":1091,"われ":-605,"んだ":606,"んで":798,"カ月":990,"会議":860,"入り":1232,"大会":2217,"始め":1681,"市":965,"新聞":-5055,"日,":974,"日、":974,"社会":2024,"カ月":990};
|
||||
this.TC1__ = {"AAA":1093,"HHH":1029,"HHM":580,"HII":998,"HOH":-390,"HOM":-331,"IHI":1169,"IOH":-142,"IOI":-1015,"IOM":467,"MMH":187,"OOI":-1832};
|
||||
this.TC2__ = {"HHO":2088,"HII":-1023,"HMM":-1154,"IHI":-1965,"KKH":703,"OII":-2649};
|
||||
this.TC3__ = {"AAA":-294,"HHH":346,"HHI":-341,"HII":-1088,"HIK":731,"HOH":-1486,"IHH":128,"IHI":-3041,"IHO":-1935,"IIH":-825,"IIM":-1035,"IOI":-542,"KHH":-1216,"KKA":491,"KKH":-1217,"KOK":-1009,"MHH":-2694,"MHM":-457,"MHO":123,"MMH":-471,"NNH":-1689,"NNO":662,"OHO":-3393};
|
||||
this.TC4__ = {"HHH":-203,"HHI":1344,"HHK":365,"HHM":-122,"HHN":182,"HHO":669,"HIH":804,"HII":679,"HOH":446,"IHH":695,"IHO":-2324,"IIH":321,"III":1497,"IIO":656,"IOO":54,"KAK":4845,"KKA":3386,"KKK":3065,"MHH":-405,"MHI":201,"MMH":-241,"MMM":661,"MOM":841};
|
||||
this.TQ1__ = {"BHHH":-227,"BHHI":316,"BHIH":-132,"BIHH":60,"BIII":1595,"BNHH":-744,"BOHH":225,"BOOO":-908,"OAKK":482,"OHHH":281,"OHIH":249,"OIHI":200,"OIIH":-68};
|
||||
this.TQ2__ = {"BIHH":-1401,"BIII":-1033,"BKAK":-543,"BOOO":-5591};
|
||||
this.TQ3__ = {"BHHH":478,"BHHM":-1073,"BHIH":222,"BHII":-504,"BIIH":-116,"BIII":-105,"BMHI":-863,"BMHM":-464,"BOMH":620,"OHHH":346,"OHHI":1729,"OHII":997,"OHMH":481,"OIHH":623,"OIIH":1344,"OKAK":2792,"OKHH":587,"OKKA":679,"OOHH":110,"OOII":-685};
|
||||
this.TQ4__ = {"BHHH":-721,"BHHM":-3604,"BHII":-966,"BIIH":-607,"BIII":-2181,"OAAA":-2763,"OAKK":180,"OHHH":-294,"OHHI":2446,"OHHO":480,"OHIH":-1573,"OIHH":1935,"OIHI":-493,"OIIH":626,"OIII":-4007,"OKAK":-8156};
|
||||
this.TW1__ = {"につい":-4681,"東京都":2026};
|
||||
this.TW2__ = {"ある程":-2049,"いった":-1256,"ころが":-2434,"しょう":3873,"その後":-4430,"だって":-1049,"ていた":1833,"として":-4657,"ともに":-4517,"もので":1882,"一気に":-792,"初めて":-1512,"同時に":-8097,"大きな":-1255,"対して":-2721,"社会党":-3216};
|
||||
this.TW3__ = {"いただ":-1734,"してい":1314,"として":-4314,"につい":-5483,"にとっ":-5989,"に当た":-6247,"ので,":-727,"ので、":-727,"のもの":-600,"れから":-3752,"十二月":-2287};
|
||||
this.TW4__ = {"いう.":8576,"いう。":8576,"からな":-2348,"してい":2958,"たが,":1516,"たが、":1516,"ている":1538,"という":1349,"ました":5543,"ません":1097,"ようと":-4258,"よると":5865};
|
||||
this.UC1__ = {"A":484,"K":93,"M":645,"O":-505};
|
||||
this.UC2__ = {"A":819,"H":1059,"I":409,"M":3987,"N":5775,"O":646};
|
||||
this.UC3__ = {"A":-1370,"I":2311};
|
||||
this.UC4__ = {"A":-2643,"H":1809,"I":-1032,"K":-3450,"M":3565,"N":3876,"O":6646};
|
||||
this.UC5__ = {"H":313,"I":-1238,"K":-799,"M":539,"O":-831};
|
||||
this.UC6__ = {"H":-506,"I":-253,"K":87,"M":247,"O":-387};
|
||||
this.UP1__ = {"O":-214};
|
||||
this.UP2__ = {"B":69,"O":935};
|
||||
this.UP3__ = {"B":189};
|
||||
this.UQ1__ = {"BH":21,"BI":-12,"BK":-99,"BN":142,"BO":-56,"OH":-95,"OI":477,"OK":410,"OO":-2422};
|
||||
this.UQ2__ = {"BH":216,"BI":113,"OK":1759};
|
||||
this.UQ3__ = {"BA":-479,"BH":42,"BI":1913,"BK":-7198,"BM":3160,"BN":6427,"BO":14761,"OI":-827,"ON":-3212};
|
||||
this.UW1__ = {",":156,"、":156,"「":-463,"あ":-941,"う":-127,"が":-553,"き":121,"こ":505,"で":-201,"と":-547,"ど":-123,"に":-789,"の":-185,"は":-847,"も":-466,"や":-470,"よ":182,"ら":-292,"り":208,"れ":169,"を":-446,"ん":-137,"・":-135,"主":-402,"京":-268,"区":-912,"午":871,"国":-460,"大":561,"委":729,"市":-411,"日":-141,"理":361,"生":-408,"県":-386,"都":-718,"「":-463,"・":-135};
|
||||
this.UW2__ = {",":-829,"、":-829,"〇":892,"「":-645,"」":3145,"あ":-538,"い":505,"う":134,"お":-502,"か":1454,"が":-856,"く":-412,"こ":1141,"さ":878,"ざ":540,"し":1529,"す":-675,"せ":300,"そ":-1011,"た":188,"だ":1837,"つ":-949,"て":-291,"で":-268,"と":-981,"ど":1273,"な":1063,"に":-1764,"の":130,"は":-409,"ひ":-1273,"べ":1261,"ま":600,"も":-1263,"や":-402,"よ":1639,"り":-579,"る":-694,"れ":571,"を":-2516,"ん":2095,"ア":-587,"カ":306,"キ":568,"ッ":831,"三":-758,"不":-2150,"世":-302,"中":-968,"主":-861,"事":492,"人":-123,"会":978,"保":362,"入":548,"初":-3025,"副":-1566,"北":-3414,"区":-422,"大":-1769,"天":-865,"太":-483,"子":-1519,"学":760,"実":1023,"小":-2009,"市":-813,"年":-1060,"強":1067,"手":-1519,"揺":-1033,"政":1522,"文":-1355,"新":-1682,"日":-1815,"明":-1462,"最":-630,"朝":-1843,"本":-1650,"東":-931,"果":-665,"次":-2378,"民":-180,"気":-1740,"理":752,"発":529,"目":-1584,"相":-242,"県":-1165,"立":-763,"第":810,"米":509,"自":-1353,"行":838,"西":-744,"見":-3874,"調":1010,"議":1198,"込":3041,"開":1758,"間":-1257,"「":-645,"」":3145,"ッ":831,"ア":-587,"カ":306,"キ":568};
|
||||
this.UW3__ = {",":4889,"1":-800,"−":-1723,"、":4889,"々":-2311,"〇":5827,"」":2670,"〓":-3573,"あ":-2696,"い":1006,"う":2342,"え":1983,"お":-4864,"か":-1163,"が":3271,"く":1004,"け":388,"げ":401,"こ":-3552,"ご":-3116,"さ":-1058,"し":-395,"す":584,"せ":3685,"そ":-5228,"た":842,"ち":-521,"っ":-1444,"つ":-1081,"て":6167,"で":2318,"と":1691,"ど":-899,"な":-2788,"に":2745,"の":4056,"は":4555,"ひ":-2171,"ふ":-1798,"へ":1199,"ほ":-5516,"ま":-4384,"み":-120,"め":1205,"も":2323,"や":-788,"よ":-202,"ら":727,"り":649,"る":5905,"れ":2773,"わ":-1207,"を":6620,"ん":-518,"ア":551,"グ":1319,"ス":874,"ッ":-1350,"ト":521,"ム":1109,"ル":1591,"ロ":2201,"ン":278,"・":-3794,"一":-1619,"下":-1759,"世":-2087,"両":3815,"中":653,"主":-758,"予":-1193,"二":974,"人":2742,"今":792,"他":1889,"以":-1368,"低":811,"何":4265,"作":-361,"保":-2439,"元":4858,"党":3593,"全":1574,"公":-3030,"六":755,"共":-1880,"円":5807,"再":3095,"分":457,"初":2475,"別":1129,"前":2286,"副":4437,"力":365,"動":-949,"務":-1872,"化":1327,"北":-1038,"区":4646,"千":-2309,"午":-783,"協":-1006,"口":483,"右":1233,"各":3588,"合":-241,"同":3906,"和":-837,"員":4513,"国":642,"型":1389,"場":1219,"外":-241,"妻":2016,"学":-1356,"安":-423,"実":-1008,"家":1078,"小":-513,"少":-3102,"州":1155,"市":3197,"平":-1804,"年":2416,"広":-1030,"府":1605,"度":1452,"建":-2352,"当":-3885,"得":1905,"思":-1291,"性":1822,"戸":-488,"指":-3973,"政":-2013,"教":-1479,"数":3222,"文":-1489,"新":1764,"日":2099,"旧":5792,"昨":-661,"時":-1248,"曜":-951,"最":-937,"月":4125,"期":360,"李":3094,"村":364,"東":-805,"核":5156,"森":2438,"業":484,"氏":2613,"民":-1694,"決":-1073,"法":1868,"海":-495,"無":979,"物":461,"特":-3850,"生":-273,"用":914,"町":1215,"的":7313,"直":-1835,"省":792,"県":6293,"知":-1528,"私":4231,"税":401,"立":-960,"第":1201,"米":7767,"系":3066,"約":3663,"級":1384,"統":-4229,"総":1163,"線":1255,"者":6457,"能":725,"自":-2869,"英":785,"見":1044,"調":-562,"財":-733,"費":1777,"車":1835,"軍":1375,"込":-1504,"通":-1136,"選":-681,"郎":1026,"郡":4404,"部":1200,"金":2163,"長":421,"開":-1432,"間":1302,"関":-1282,"雨":2009,"電":-1045,"非":2066,"駅":1620,"1":-800,"」":2670,"・":-3794,"ッ":-1350,"ア":551,"グ":1319,"ス":874,"ト":521,"ム":1109,"ル":1591,"ロ":2201,"ン":278};
|
||||
this.UW4__ = {",":3930,".":3508,"―":-4841,"、":3930,"。":3508,"〇":4999,"「":1895,"」":3798,"〓":-5156,"あ":4752,"い":-3435,"う":-640,"え":-2514,"お":2405,"か":530,"が":6006,"き":-4482,"ぎ":-3821,"く":-3788,"け":-4376,"げ":-4734,"こ":2255,"ご":1979,"さ":2864,"し":-843,"じ":-2506,"す":-731,"ず":1251,"せ":181,"そ":4091,"た":5034,"だ":5408,"ち":-3654,"っ":-5882,"つ":-1659,"て":3994,"で":7410,"と":4547,"な":5433,"に":6499,"ぬ":1853,"ね":1413,"の":7396,"は":8578,"ば":1940,"ひ":4249,"び":-4134,"ふ":1345,"へ":6665,"べ":-744,"ほ":1464,"ま":1051,"み":-2082,"む":-882,"め":-5046,"も":4169,"ゃ":-2666,"や":2795,"ょ":-1544,"よ":3351,"ら":-2922,"り":-9726,"る":-14896,"れ":-2613,"ろ":-4570,"わ":-1783,"を":13150,"ん":-2352,"カ":2145,"コ":1789,"セ":1287,"ッ":-724,"ト":-403,"メ":-1635,"ラ":-881,"リ":-541,"ル":-856,"ン":-3637,"・":-4371,"ー":-11870,"一":-2069,"中":2210,"予":782,"事":-190,"井":-1768,"人":1036,"以":544,"会":950,"体":-1286,"作":530,"側":4292,"先":601,"党":-2006,"共":-1212,"内":584,"円":788,"初":1347,"前":1623,"副":3879,"力":-302,"動":-740,"務":-2715,"化":776,"区":4517,"協":1013,"参":1555,"合":-1834,"和":-681,"員":-910,"器":-851,"回":1500,"国":-619,"園":-1200,"地":866,"場":-1410,"塁":-2094,"士":-1413,"多":1067,"大":571,"子":-4802,"学":-1397,"定":-1057,"寺":-809,"小":1910,"屋":-1328,"山":-1500,"島":-2056,"川":-2667,"市":2771,"年":374,"庁":-4556,"後":456,"性":553,"感":916,"所":-1566,"支":856,"改":787,"政":2182,"教":704,"文":522,"方":-856,"日":1798,"時":1829,"最":845,"月":-9066,"木":-485,"来":-442,"校":-360,"業":-1043,"氏":5388,"民":-2716,"気":-910,"沢":-939,"済":-543,"物":-735,"率":672,"球":-1267,"生":-1286,"産":-1101,"田":-2900,"町":1826,"的":2586,"目":922,"省":-3485,"県":2997,"空":-867,"立":-2112,"第":788,"米":2937,"系":786,"約":2171,"経":1146,"統":-1169,"総":940,"線":-994,"署":749,"者":2145,"能":-730,"般":-852,"行":-792,"規":792,"警":-1184,"議":-244,"谷":-1000,"賞":730,"車":-1481,"軍":1158,"輪":-1433,"込":-3370,"近":929,"道":-1291,"選":2596,"郎":-4866,"都":1192,"野":-1100,"銀":-2213,"長":357,"間":-2344,"院":-2297,"際":-2604,"電":-878,"領":-1659,"題":-792,"館":-1984,"首":1749,"高":2120,"「":1895,"」":3798,"・":-4371,"ッ":-724,"ー":-11870,"カ":2145,"コ":1789,"セ":1287,"ト":-403,"メ":-1635,"ラ":-881,"リ":-541,"ル":-856,"ン":-3637};
|
||||
this.UW5__ = {",":465,".":-299,"1":-514,"E2":-32768,"]":-2762,"、":465,"。":-299,"「":363,"あ":1655,"い":331,"う":-503,"え":1199,"お":527,"か":647,"が":-421,"き":1624,"ぎ":1971,"く":312,"げ":-983,"さ":-1537,"し":-1371,"す":-852,"だ":-1186,"ち":1093,"っ":52,"つ":921,"て":-18,"で":-850,"と":-127,"ど":1682,"な":-787,"に":-1224,"の":-635,"は":-578,"べ":1001,"み":502,"め":865,"ゃ":3350,"ょ":854,"り":-208,"る":429,"れ":504,"わ":419,"を":-1264,"ん":327,"イ":241,"ル":451,"ン":-343,"中":-871,"京":722,"会":-1153,"党":-654,"務":3519,"区":-901,"告":848,"員":2104,"大":-1296,"学":-548,"定":1785,"嵐":-1304,"市":-2991,"席":921,"年":1763,"思":872,"所":-814,"挙":1618,"新":-1682,"日":218,"月":-4353,"査":932,"格":1356,"機":-1508,"氏":-1347,"田":240,"町":-3912,"的":-3149,"相":1319,"省":-1052,"県":-4003,"研":-997,"社":-278,"空":-813,"統":1955,"者":-2233,"表":663,"語":-1073,"議":1219,"選":-1018,"郎":-368,"長":786,"間":1191,"題":2368,"館":-689,"1":-514,"E2":-32768,"「":363,"イ":241,"ル":451,"ン":-343};
|
||||
this.UW6__ = {",":227,".":808,"1":-270,"E1":306,"、":227,"。":808,"あ":-307,"う":189,"か":241,"が":-73,"く":-121,"こ":-200,"じ":1782,"す":383,"た":-428,"っ":573,"て":-1014,"で":101,"と":-105,"な":-253,"に":-149,"の":-417,"は":-236,"も":-206,"り":187,"る":-135,"を":195,"ル":-673,"ン":-496,"一":-277,"中":201,"件":-800,"会":624,"前":302,"区":1792,"員":-1212,"委":798,"学":-960,"市":887,"広":-695,"後":535,"業":-697,"相":753,"社":-507,"福":974,"空":-822,"者":1811,"連":463,"郎":1082,"1":-270,"E1":306,"ル":-673,"ン":-496};
|
||||
|
||||
return this;
|
||||
}
|
||||
TinySegmenter.prototype.ctype_ = function(str) {
|
||||
for (var i in this.chartype_) {
|
||||
if (str.match(this.chartype_[i][0])) {
|
||||
return this.chartype_[i][1];
|
||||
}
|
||||
}
|
||||
return "O";
|
||||
}
|
||||
|
||||
TinySegmenter.prototype.ts_ = function(v) {
|
||||
if (v) { return v; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
TinySegmenter.prototype.segment = function(input) {
|
||||
if (input == null || input == undefined || input == "") {
|
||||
return [];
|
||||
}
|
||||
var result = [];
|
||||
var seg = ["B3","B2","B1"];
|
||||
var ctype = ["O","O","O"];
|
||||
var o = input.split("");
|
||||
for (i = 0; i < o.length; ++i) {
|
||||
seg.push(o[i]);
|
||||
ctype.push(this.ctype_(o[i]))
|
||||
}
|
||||
seg.push("E1");
|
||||
seg.push("E2");
|
||||
seg.push("E3");
|
||||
ctype.push("O");
|
||||
ctype.push("O");
|
||||
ctype.push("O");
|
||||
var word = seg[3];
|
||||
var p1 = "U";
|
||||
var p2 = "U";
|
||||
var p3 = "U";
|
||||
for (var i = 4; i < seg.length - 3; ++i) {
|
||||
var score = this.BIAS__;
|
||||
var w1 = seg[i-3];
|
||||
var w2 = seg[i-2];
|
||||
var w3 = seg[i-1];
|
||||
var w4 = seg[i];
|
||||
var w5 = seg[i+1];
|
||||
var w6 = seg[i+2];
|
||||
var c1 = ctype[i-3];
|
||||
var c2 = ctype[i-2];
|
||||
var c3 = ctype[i-1];
|
||||
var c4 = ctype[i];
|
||||
var c5 = ctype[i+1];
|
||||
var c6 = ctype[i+2];
|
||||
score += this.ts_(this.UP1__[p1]);
|
||||
score += this.ts_(this.UP2__[p2]);
|
||||
score += this.ts_(this.UP3__[p3]);
|
||||
score += this.ts_(this.BP1__[p1 + p2]);
|
||||
score += this.ts_(this.BP2__[p2 + p3]);
|
||||
score += this.ts_(this.UW1__[w1]);
|
||||
score += this.ts_(this.UW2__[w2]);
|
||||
score += this.ts_(this.UW3__[w3]);
|
||||
score += this.ts_(this.UW4__[w4]);
|
||||
score += this.ts_(this.UW5__[w5]);
|
||||
score += this.ts_(this.UW6__[w6]);
|
||||
score += this.ts_(this.BW1__[w2 + w3]);
|
||||
score += this.ts_(this.BW2__[w3 + w4]);
|
||||
score += this.ts_(this.BW3__[w4 + w5]);
|
||||
score += this.ts_(this.TW1__[w1 + w2 + w3]);
|
||||
score += this.ts_(this.TW2__[w2 + w3 + w4]);
|
||||
score += this.ts_(this.TW3__[w3 + w4 + w5]);
|
||||
score += this.ts_(this.TW4__[w4 + w5 + w6]);
|
||||
score += this.ts_(this.UC1__[c1]);
|
||||
score += this.ts_(this.UC2__[c2]);
|
||||
score += this.ts_(this.UC3__[c3]);
|
||||
score += this.ts_(this.UC4__[c4]);
|
||||
score += this.ts_(this.UC5__[c5]);
|
||||
score += this.ts_(this.UC6__[c6]);
|
||||
score += this.ts_(this.BC1__[c2 + c3]);
|
||||
score += this.ts_(this.BC2__[c3 + c4]);
|
||||
score += this.ts_(this.BC3__[c4 + c5]);
|
||||
score += this.ts_(this.TC1__[c1 + c2 + c3]);
|
||||
score += this.ts_(this.TC2__[c2 + c3 + c4]);
|
||||
score += this.ts_(this.TC3__[c3 + c4 + c5]);
|
||||
score += this.ts_(this.TC4__[c4 + c5 + c6]);
|
||||
// score += this.ts_(this.TC5__[c4 + c5 + c6]);
|
||||
score += this.ts_(this.UQ1__[p1 + c1]);
|
||||
score += this.ts_(this.UQ2__[p2 + c2]);
|
||||
score += this.ts_(this.UQ3__[p3 + c3]);
|
||||
score += this.ts_(this.BQ1__[p2 + c2 + c3]);
|
||||
score += this.ts_(this.BQ2__[p2 + c3 + c4]);
|
||||
score += this.ts_(this.BQ3__[p3 + c2 + c3]);
|
||||
score += this.ts_(this.BQ4__[p3 + c3 + c4]);
|
||||
score += this.ts_(this.TQ1__[p2 + c1 + c2 + c3]);
|
||||
score += this.ts_(this.TQ2__[p2 + c2 + c3 + c4]);
|
||||
score += this.ts_(this.TQ3__[p3 + c1 + c2 + c3]);
|
||||
score += this.ts_(this.TQ4__[p3 + c2 + c3 + c4]);
|
||||
var p = "O";
|
||||
if (score > 0) {
|
||||
result.push(word);
|
||||
word = "";
|
||||
p = "B";
|
||||
}
|
||||
p1 = p2;
|
||||
p2 = p3;
|
||||
p3 = p;
|
||||
word += seg[i];
|
||||
}
|
||||
result.push(word);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
lunr.TinySegmenter = TinySegmenter;
|
||||
};
|
||||
|
||||
}));
|
||||
@@ -1,381 +0,0 @@
|
||||
/*!
|
||||
* Lunr languages, `Arabic` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2018, Dalia Al-Shahrabi
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Kazem Taghva, Rania Elkhoury, and Jeffrey Coombs (2005)
|
||||
* Meryeme Hadni, Abdelmonaime Lachkar, and S. Alaoui Ouatik (2012)
|
||||
*
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.ar = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.ar.trimmer,
|
||||
lunr.ar.stopWordFilter,
|
||||
lunr.ar.stemmer
|
||||
);
|
||||
|
||||
// for lunr version 2
|
||||
// this is necessary so that every searched word is also stemmed before
|
||||
// in lunr <= 1 this is not needed, as it is done using the normal pipeline
|
||||
if (this.searchPipeline) {
|
||||
this.searchPipeline.reset();
|
||||
this.searchPipeline.add(lunr.ar.stemmer)
|
||||
}
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.ar.wordCharacters = "\u0621-\u065b\u0671\u0640";
|
||||
lunr.ar.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.ar.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.ar.trimmer, 'trimmer-ar');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.ar.stemmer = (function() {
|
||||
var self = this;
|
||||
var word = '';
|
||||
self.result = false;
|
||||
self.preRemoved = false;
|
||||
self.sufRemoved = false;
|
||||
|
||||
//prefix data
|
||||
self.pre = {
|
||||
pre1: 'ف ك ب و س ل ن ا ي ت',
|
||||
pre2: 'ال لل',
|
||||
pre3: 'بال وال فال تال كال ولل',
|
||||
pre4: 'فبال كبال وبال وكال'
|
||||
};
|
||||
|
||||
//suffix data
|
||||
self.suf = {
|
||||
suf1: 'ه ك ت ن ا ي',
|
||||
suf2: 'نك نه ها وك يا اه ون ين تن تم نا وا ان كم كن ني نن ما هم هن تك ته ات يه',
|
||||
suf3: 'تين كهم نيه نهم ونه وها يهم ونا ونك وني وهم تكم تنا تها تني تهم كما كها ناه نكم هنا تان يها',
|
||||
suf4: 'كموه ناها ونني ونهم تكما تموه تكاه كماه ناكم ناهم نيها وننا'
|
||||
}
|
||||
|
||||
//arabic language patterns and alternative mapping for patterns
|
||||
self.patterns = JSON.parse('{"pt43":[{"pt":[{"c":"ا","l":1}]},{"pt":[{"c":"ا,ت,ن,ي","l":0}],"mPt":[{"c":"ف","l":0,"m":1},{"c":"ع","l":1,"m":2},{"c":"ل","l":2,"m":3}]},{"pt":[{"c":"و","l":2}],"mPt":[{"c":"ف","l":0,"m":0},{"c":"ع","l":1,"m":1},{"c":"ل","l":2,"m":3}]},{"pt":[{"c":"ا","l":2}]},{"pt":[{"c":"ي","l":2}],"mPt":[{"c":"ف","l":0,"m":0},{"c":"ع","l":1,"m":1},{"c":"ا","l":2},{"c":"ل","l":3,"m":3}]},{"pt":[{"c":"م","l":0}]}],"pt53":[{"pt":[{"c":"ت","l":0},{"c":"ا","l":2}]},{"pt":[{"c":"ا,ن,ت,ي","l":0},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ت","l":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":0},{"c":"ا","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ع","l":2,"m":3},{"c":"ل","l":3,"m":4},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":0},{"c":"ا","l":3}],"mPt":[{"c":"ف","l":0,"m":1},{"c":"ع","l":1,"m":2},{"c":"ل","l":2,"m":4}]},{"pt":[{"c":"ا","l":3},{"c":"ن","l":4}]},{"pt":[{"c":"ت","l":0},{"c":"ي","l":3}]},{"pt":[{"c":"م","l":0},{"c":"و","l":3}]},{"pt":[{"c":"ا","l":1},{"c":"و","l":3}]},{"pt":[{"c":"و","l":1},{"c":"ا","l":2}]},{"pt":[{"c":"م","l":0},{"c":"ا","l":3}]},{"pt":[{"c":"م","l":0},{"c":"ي","l":3}]},{"pt":[{"c":"ا","l":2},{"c":"ن","l":3}]},{"pt":[{"c":"م","l":0},{"c":"ن","l":1}],"mPt":[{"c":"ا","l":0},{"c":"ن","l":1},{"c":"ف","l":2,"m":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"م","l":0},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ت","l":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"م","l":0},{"c":"ا","l":2}]},{"pt":[{"c":"م","l":1},{"c":"ا","l":3}]},{"pt":[{"c":"ي,ت,ا,ن","l":0},{"c":"ت","l":1}],"mPt":[{"c":"ف","l":0,"m":2},{"c":"ع","l":1,"m":3},{"c":"ا","l":2},{"c":"ل","l":3,"m":4}]},{"pt":[{"c":"ت,ي,ا,ن","l":0},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ت","l":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":2},{"c":"ي","l":3}]},{"pt":[{"c":"ا,ي,ت,ن","l":0},{"c":"ن","l":1}],"mPt":[{"c":"ا","l":0},{"c":"ن","l":1},{"c":"ف","l":2,"m":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":3},{"c":"ء","l":4}]}],"pt63":[{"pt":[{"c":"ا","l":0},{"c":"ت","l":2},{"c":"ا","l":4}]},{"pt":[{"c":"ا,ت,ن,ي","l":0},{"c":"س","l":1},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"س","l":1},{"c":"ت","l":2},{"c":"ف","l":3,"m":3},{"c":"ع","l":4,"m":4},{"c":"ا","l":5},{"c":"ل","l":6,"m":5}]},{"pt":[{"c":"ا,ن,ت,ي","l":0},{"c":"و","l":3}]},{"pt":[{"c":"م","l":0},{"c":"س","l":1},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"س","l":1},{"c":"ت","l":2},{"c":"ف","l":3,"m":3},{"c":"ع","l":4,"m":4},{"c":"ا","l":5},{"c":"ل","l":6,"m":5}]},{"pt":[{"c":"ي","l":1},{"c":"ي","l":3},{"c":"ا","l":4},{"c":"ء","l":5}]},{"pt":[{"c":"ا","l":0},{"c":"ن","l":1},{"c":"ا","l":4}]}],"pt54":[{"pt":[{"c":"ت","l":0}]},{"pt":[{"c":"ا,ي,ت,ن","l":0}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ع","l":2,"m":2},{"c":"ل","l":3,"m":3},{"c":"ر","l":4,"m":4},{"c":"ا","l":5},{"c":"ر","l":6,"m":4}]},{"pt":[{"c":"م","l":0}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ع","l":2,"m":2},{"c":"ل","l":3,"m":3},{"c":"ر","l":4,"m":4},{"c":"ا","l":5},{"c":"ر","l":6,"m":4}]},{"pt":[{"c":"ا","l":2}]},{"pt":[{"c":"ا","l":0},{"c":"ن","l":2}]}],"pt64":[{"pt":[{"c":"ا","l":0},{"c":"ا","l":4}]},{"pt":[{"c":"م","l":0},{"c":"ت","l":1}]}],"pt73":[{"pt":[{"c":"ا","l":0},{"c":"س","l":1},{"c":"ت","l":2},{"c":"ا","l":5}]}],"pt75":[{"pt":[{"c":"ا","l":0},{"c":"ا","l":5}]}]}');
|
||||
|
||||
self.execArray = [
|
||||
'cleanWord',
|
||||
'removeDiacritics',
|
||||
'cleanAlef',
|
||||
'removeStopWords',
|
||||
'normalizeHamzaAndAlef',
|
||||
'removeStartWaw',
|
||||
'removePre432',
|
||||
'removeEndTaa',
|
||||
'wordCheck'
|
||||
];
|
||||
|
||||
self.stem = function() {
|
||||
var counter = 0;
|
||||
self.result = false;
|
||||
self.preRemoved = false;
|
||||
self.sufRemoved = false;
|
||||
while (counter < self.execArray.length && self.result != true) {
|
||||
self.result = self[self.execArray[counter]]();
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
|
||||
self.setCurrent = function(word) {
|
||||
self.word = word;
|
||||
}
|
||||
|
||||
self.getCurrent = function() {
|
||||
return self.word
|
||||
}
|
||||
|
||||
/*remove elongating character and test that the word does not contain non-arabic characters.
|
||||
If the word contains special characters, don't stem. */
|
||||
self.cleanWord = function() {
|
||||
var wordCharacters = "\u0621-\u065b\u0671\u0640";
|
||||
var testRegex = new RegExp("[^" + wordCharacters + "]");
|
||||
self.word = self.word
|
||||
.replace('\u0640', '');
|
||||
if (testRegex.test(word)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
self.removeDiacritics = function() {
|
||||
var diacriticsRegex = new RegExp("[\u064b-\u065b]");
|
||||
self.word = self.word.replace(/[\u064b-\u065b]/gi, '');
|
||||
return false;
|
||||
}
|
||||
|
||||
/*Replace all variations of alef (آأإٱى) to a plain alef (ا)*/
|
||||
self.cleanAlef = function() {
|
||||
var alefRegex = new RegExp("[\u0622\u0623\u0625\u0671\u0649]");
|
||||
self.word = self.word.replace(alefRegex, "\u0627");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* if the word is a stop word, don't stem*/
|
||||
self.removeStopWords = function() {
|
||||
var stopWords = '، اض امين اه اها اي ا اب اجل اجمع اخ اخذ اصبح اضحى اقبل اقل اكثر الا ام اما امامك امامك امسى اما ان انا انت انتم انتما انتن انت انشا انى او اوشك اولئك اولئكم اولاء اولالك اوه اي ايا اين اينما اي ان اي اف اذ اذا اذا اذما اذن الى اليكم اليكما اليكن اليك اليك الا اما ان انما اي اياك اياكم اياكما اياكن ايانا اياه اياها اياهم اياهما اياهن اياي ايه ان ا ابتدا اثر اجل احد اخرى اخلولق اذا اربعة ارتد استحال اطار اعادة اعلنت اف اكثر اكد الالاء الالى الا الاخيرة الان الاول الاولى التى التي الثاني الثانية الذاتي الذى الذي الذين السابق الف اللائي اللاتي اللتان اللتيا اللتين اللذان اللذين اللواتي الماضي المقبل الوقت الى اليوم اما امام امس ان انبرى انقلب انه انها او اول اي ايار ايام ايضا ب بات باسم بان بخ برس بسبب بس بشكل بضع بطان بعد بعض بك بكم بكما بكن بل بلى بما بماذا بمن بن بنا به بها بي بيد بين بس بله بئس تان تانك تبدل تجاه تحول تلقاء تلك تلكم تلكما تم تينك تين ته تي ثلاثة ثم ثم ثمة ثم جعل جلل جميع جير حار حاشا حاليا حاي حتى حرى حسب حم حوالى حول حيث حيثما حين حي حبذا حتى حذار خلا خلال دون دونك ذا ذات ذاك ذانك ذان ذلك ذلكم ذلكما ذلكن ذو ذوا ذواتا ذواتي ذيت ذينك ذين ذه ذي راح رجع رويدك ريث رب زيارة سبحان سرعان سنة سنوات سوف سوى ساء ساءما شبه شخصا شرع شتان صار صباح صفر صه صه ضد ضمن طاق طالما طفق طق ظل عاد عام عاما عامة عدا عدة عدد عدم عسى عشر عشرة علق على عليك عليه عليها عل عن عند عندما عوض عين عدس عما غدا غير ف فان فلان فو فى في فيم فيما فيه فيها قال قام قبل قد قط قلما قوة كانما كاين كاي كاين كاد كان كانت كذا كذلك كرب كل كلا كلاهما كلتا كلم كليكما كليهما كلما كلا كم كما كي كيت كيف كيفما كان كخ لئن لا لات لاسيما لدن لدى لعمر لقاء لك لكم لكما لكن لكنما لكي لكيلا للامم لم لما لما لن لنا له لها لو لوكالة لولا لوما لي لست لست لستم لستما لستن لست لسن لعل لكن ليت ليس ليسا ليستا ليست ليسوا لسنا ما ماانفك مابرح مادام ماذا مازال مافتئ مايو متى مثل مذ مساء مع معاذ مقابل مكانكم مكانكما مكانكن مكانك مليار مليون مما ممن من منذ منها مه مهما من من نحن نحو نعم نفس نفسه نهاية نخ نعما نعم ها هاؤم هاك هاهنا هب هذا هذه هكذا هل هلم هلا هم هما هن هنا هناك هنالك هو هي هيا هيت هيا هؤلاء هاتان هاتين هاته هاتي هج هذا هذان هذين هذه هذي هيهات و وا واحد واضاف واضافت واكد وان واها واوضح وراءك وفي وقال وقالت وقد وقف وكان وكانت ولا ولم ومن وهو وهي ويكان وي وشكان يكون يمكن يوم ايان'.split(' ');
|
||||
if (stopWords.indexOf(self.word) >= 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* changes ؤ ئ to ء and removes alef if at the end of the word*/
|
||||
self.normalizeHamzaAndAlef = function() {
|
||||
self.word = self.word.replace('\u0624', '\u0621');
|
||||
self.word = self.word.replace('\u0626', '\u0621');
|
||||
self.word = self.word.replace(/([\u0627])\1+/gi, '\u0627');
|
||||
return false;
|
||||
}
|
||||
|
||||
/*remove end taa marboota ة*/
|
||||
self.removeEndTaa = function() {
|
||||
if (self.word.length > 2) {
|
||||
self.word = self.word.replace(/[\u0627]$/, '');
|
||||
self.word = self.word.replace('\u0629', '');
|
||||
return false;
|
||||
} else return true;
|
||||
}
|
||||
|
||||
/* if the word starts with double waw وو keep only one of them */
|
||||
self.removeStartWaw = function() {
|
||||
if (self.word.length > 3 && self.word[0] == '\u0648' && self.word[1] == '\u0648') {
|
||||
self.word = self.word.slice(1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* remove prefixes of size 4, 3 and 2 characters */
|
||||
self.removePre432 = function() {
|
||||
var word = self.word;
|
||||
if (self.word.length >= 7) {
|
||||
var pre4Regex = new RegExp('^(' + self.pre.pre4.split(' ').join('|') + ')')
|
||||
self.word = self.word.replace(pre4Regex, '');
|
||||
}
|
||||
if (self.word == word && self.word.length >= 6) {
|
||||
var pre3Regex = new RegExp('^(' + self.pre.pre3.split(' ').join('|') + ')')
|
||||
self.word = self.word.replace(pre3Regex, '');
|
||||
}
|
||||
if (self.word == word && self.word.length >= 5) {
|
||||
var pre2Regex = new RegExp('^(' + self.pre.pre2.split(' ').join('|') + ')')
|
||||
self.word = self.word.replace(pre2Regex, '');
|
||||
}
|
||||
if (word != self.word) self.preRemoved = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* check the word against word patterns. If the word matches a pattern, map it to the
|
||||
alternative pattern if available then stop stemming. */
|
||||
self.patternCheck = function(pattern) {
|
||||
var patternMatch = false;
|
||||
for (var i = 0; i < pattern.length; i++) {
|
||||
var currentPatternCheck = true;
|
||||
for (var j = 0; j < pattern[i].pt.length; j++) {
|
||||
var chars = pattern[i].pt[j].c.split(',');
|
||||
var charMatch = false;
|
||||
chars.forEach(function(el) {
|
||||
if (self.word[pattern[i].pt[j].l] == el) {
|
||||
charMatch = true;
|
||||
}
|
||||
})
|
||||
if (!charMatch) {
|
||||
currentPatternCheck = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (currentPatternCheck == true) {
|
||||
if (pattern[i].mPt) {
|
||||
var newWord = [];
|
||||
for (var k = 0; k < pattern[i].mPt.length; k++) {
|
||||
if (pattern[i].mPt[k].m != null) {
|
||||
newWord[pattern[i].mPt[k].l] = self.word[pattern[i].mPt[k].m]
|
||||
} else {
|
||||
newWord[pattern[i].mPt[k].l] = pattern[i].mPt[k].c
|
||||
}
|
||||
}
|
||||
self.word = newWord.join('');
|
||||
}
|
||||
self.result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* remove prefixes of size 1 char*/
|
||||
self.removePre1 = function() {
|
||||
var word = self.word;
|
||||
if (self.preRemoved == false)
|
||||
if (self.word.length > 3) {
|
||||
var pre1Regex = new RegExp('^(' + self.pre.pre1.split(' ').join('|') + ')')
|
||||
self.word = self.word.replace(pre1Regex, '');
|
||||
}
|
||||
if (word != self.word) self.preRemoved = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*remove suffixes of size 1 char */
|
||||
self.removeSuf1 = function() {
|
||||
var word = self.word;
|
||||
if (self.sufRemoved == false)
|
||||
if (self.word.length > 3) {
|
||||
var suf1Regex = new RegExp('(' + self.suf.suf1.split(' ').join('|') + ')$')
|
||||
self.word = self.word.replace(suf1Regex, '');
|
||||
}
|
||||
if (word != self.word) self.sufRemoved = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*remove suffixes of size 4, 3 and 2 chars*/
|
||||
self.removeSuf432 = function() {
|
||||
var word = self.word;
|
||||
if (self.word.length >= 6) {
|
||||
var suf4Regex = new RegExp('(' + self.suf.suf4.split(' ').join('|') + ')$')
|
||||
self.word = self.word.replace(suf4Regex, '');
|
||||
}
|
||||
if (self.word == word && self.word.length >= 5) {
|
||||
var suf3Regex = new RegExp('(' + self.suf.suf3.split(' ').join('|') + ')$')
|
||||
self.word = self.word.replace(suf3Regex, '');
|
||||
}
|
||||
if (self.word == word && self.word.length >= 4) {
|
||||
var suf2Regex = new RegExp('(' + self.suf.suf2.split(' ').join('|') + ')$')
|
||||
self.word = self.word.replace(suf2Regex, '');
|
||||
}
|
||||
if (word != self.word) self.sufRemoved = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*check the word length and decide what is the next step accordingly*/
|
||||
self.wordCheck = function() {
|
||||
var word = self.word;
|
||||
var word7Exec = [self.removeSuf432, self.removeSuf1, self.removePre1]
|
||||
var counter = 0;
|
||||
var patternChecked = false;
|
||||
while (self.word.length >= 7 && !self.result && counter < word7Exec.length) {
|
||||
if (self.word.length == 7 && !patternChecked) {
|
||||
self.checkPattern73();
|
||||
patternChecked = true;
|
||||
} else {
|
||||
word7Exec[counter]();
|
||||
counter++;
|
||||
patternChecked = false;
|
||||
}
|
||||
}
|
||||
|
||||
var word6Exec = [self.checkPattern63, self.removeSuf432, self.removeSuf1, self.removePre1, self.checkPattern64];
|
||||
counter = 0;
|
||||
while (self.word.length == 6 && !self.result && counter < word6Exec.length) {
|
||||
word6Exec[counter]();
|
||||
counter++;
|
||||
}
|
||||
|
||||
var word5Exec = [self.checkPattern53, self.removeSuf432, self.removeSuf1, self.removePre1, self.checkPattern54];
|
||||
counter = 0;
|
||||
while (self.word.length == 5 && !self.result && counter < word5Exec.length) {
|
||||
word5Exec[counter]();
|
||||
counter++;
|
||||
}
|
||||
|
||||
var word4Exec = [self.checkPattern43, self.removeSuf1, self.removePre1, self.removeSuf432];
|
||||
counter = 0;
|
||||
while (self.word.length == 4 && !self.result && counter < word4Exec.length) {
|
||||
word4Exec[counter]();
|
||||
counter++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
self.checkPattern43 = function() {
|
||||
self.patternCheck(self.patterns.pt43)
|
||||
}
|
||||
self.checkPattern53 = function() {
|
||||
self.patternCheck(self.patterns.pt53)
|
||||
}
|
||||
self.checkPattern54 = function() {
|
||||
self.patternCheck(self.patterns.pt54)
|
||||
}
|
||||
self.checkPattern63 = function() {
|
||||
self.patternCheck(self.patterns.pt63)
|
||||
}
|
||||
self.checkPattern64 = function() {
|
||||
self.patternCheck(self.patterns.pt64)
|
||||
}
|
||||
self.checkPattern73 = function() {
|
||||
self.patternCheck(self.patterns.pt73)
|
||||
}
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(token) {
|
||||
// for lunr version 2
|
||||
if (typeof token.update === "function") {
|
||||
return token.update(function(word) {
|
||||
self.setCurrent(word);
|
||||
self.stem();
|
||||
return self.getCurrent();
|
||||
})
|
||||
} else { // for lunr version <= 1
|
||||
self.setCurrent(token);
|
||||
self.stem();
|
||||
return self.getCurrent();
|
||||
}
|
||||
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.ar.stemmer, 'stemmer-ar');
|
||||
|
||||
lunr.ar.stopWordFilter = lunr.generateStopWordFilter('، اض امين اه اها اي ا اب اجل اجمع اخ اخذ اصبح اضحى اقبل اقل اكثر الا ام اما امامك امامك امسى اما ان انا انت انتم انتما انتن انت انشا انى او اوشك اولئك اولئكم اولاء اولالك اوه اي ايا اين اينما اي ان اي اف اذ اذا اذا اذما اذن الى اليكم اليكما اليكن اليك اليك الا اما ان انما اي اياك اياكم اياكما اياكن ايانا اياه اياها اياهم اياهما اياهن اياي ايه ان ا ابتدا اثر اجل احد اخرى اخلولق اذا اربعة ارتد استحال اطار اعادة اعلنت اف اكثر اكد الالاء الالى الا الاخيرة الان الاول الاولى التى التي الثاني الثانية الذاتي الذى الذي الذين السابق الف اللائي اللاتي اللتان اللتيا اللتين اللذان اللذين اللواتي الماضي المقبل الوقت الى اليوم اما امام امس ان انبرى انقلب انه انها او اول اي ايار ايام ايضا ب بات باسم بان بخ برس بسبب بس بشكل بضع بطان بعد بعض بك بكم بكما بكن بل بلى بما بماذا بمن بن بنا به بها بي بيد بين بس بله بئس تان تانك تبدل تجاه تحول تلقاء تلك تلكم تلكما تم تينك تين ته تي ثلاثة ثم ثم ثمة ثم جعل جلل جميع جير حار حاشا حاليا حاي حتى حرى حسب حم حوالى حول حيث حيثما حين حي حبذا حتى حذار خلا خلال دون دونك ذا ذات ذاك ذانك ذان ذلك ذلكم ذلكما ذلكن ذو ذوا ذواتا ذواتي ذيت ذينك ذين ذه ذي راح رجع رويدك ريث رب زيارة سبحان سرعان سنة سنوات سوف سوى ساء ساءما شبه شخصا شرع شتان صار صباح صفر صه صه ضد ضمن طاق طالما طفق طق ظل عاد عام عاما عامة عدا عدة عدد عدم عسى عشر عشرة علق على عليك عليه عليها عل عن عند عندما عوض عين عدس عما غدا غير ف فان فلان فو فى في فيم فيما فيه فيها قال قام قبل قد قط قلما قوة كانما كاين كاي كاين كاد كان كانت كذا كذلك كرب كل كلا كلاهما كلتا كلم كليكما كليهما كلما كلا كم كما كي كيت كيف كيفما كان كخ لئن لا لات لاسيما لدن لدى لعمر لقاء لك لكم لكما لكن لكنما لكي لكيلا للامم لم لما لما لن لنا له لها لو لوكالة لولا لوما لي لست لست لستم لستما لستن لست لسن لعل لكن ليت ليس ليسا ليستا ليست ليسوا لسنا ما ماانفك مابرح مادام ماذا مازال مافتئ مايو متى مثل مذ مساء مع معاذ مقابل مكانكم مكانكما مكانكن مكانك مليار مليون مما ممن من منذ منها مه مهما من من نحن نحو نعم نفس نفسه نهاية نخ نعما نعم ها هاؤم هاك هاهنا هب هذا هذه هكذا هل هلم هلا هم هما هن هنا هناك هنالك هو هي هيا هيت هيا هؤلاء هاتان هاتين هاته هاتي هج هذا هذان هذين هذه هذي هيهات وا واحد واضاف واضافت واكد وان واها واوضح وراءك وفي وقال وقالت وقد وقف وكان وكانت ولا ولم ومن وهو وهي ويكان وي وشكان يكون يمكن يوم ايان'.split(' '));
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.ar.stopWordFilter, 'stopWordFilter-ar');
|
||||
};
|
||||
}))
|
||||
@@ -1,284 +0,0 @@
|
||||
/*!
|
||||
* Lunr languages, `Danish` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2014, Mihai Valentin
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.da = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.da.trimmer,
|
||||
lunr.da.stopWordFilter,
|
||||
lunr.da.stemmer
|
||||
);
|
||||
|
||||
// for lunr version 2
|
||||
// this is necessary so that every searched word is also stemmed before
|
||||
// in lunr <= 1 this is not needed, as it is done using the normal pipeline
|
||||
if (this.searchPipeline) {
|
||||
this.searchPipeline.reset();
|
||||
this.searchPipeline.add(lunr.da.stemmer)
|
||||
}
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.da.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
|
||||
lunr.da.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.da.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.da.trimmer, 'trimmer-da');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.da.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function DanishStemmer() {
|
||||
var a_0 = [new Among("hed", -1, 1), new Among("ethed", 0, 1),
|
||||
new Among("ered", -1, 1), new Among("e", -1, 1),
|
||||
new Among("erede", 3, 1), new Among("ende", 3, 1),
|
||||
new Among("erende", 5, 1), new Among("ene", 3, 1),
|
||||
new Among("erne", 3, 1), new Among("ere", 3, 1),
|
||||
new Among("en", -1, 1), new Among("heden", 10, 1),
|
||||
new Among("eren", 10, 1), new Among("er", -1, 1),
|
||||
new Among("heder", 13, 1), new Among("erer", 13, 1),
|
||||
new Among("s", -1, 2), new Among("heds", 16, 1),
|
||||
new Among("es", 16, 1), new Among("endes", 18, 1),
|
||||
new Among("erendes", 19, 1), new Among("enes", 18, 1),
|
||||
new Among("ernes", 18, 1), new Among("eres", 18, 1),
|
||||
new Among("ens", 16, 1), new Among("hedens", 24, 1),
|
||||
new Among("erens", 24, 1), new Among("ers", 16, 1),
|
||||
new Among("ets", 16, 1), new Among("erets", 28, 1),
|
||||
new Among("et", -1, 1), new Among("eret", 30, 1)
|
||||
],
|
||||
a_1 = [
|
||||
new Among("gd", -1, -1), new Among("dt", -1, -1),
|
||||
new Among("gt", -1, -1), new Among("kt", -1, -1)
|
||||
],
|
||||
a_2 = [
|
||||
new Among("ig", -1, 1), new Among("lig", 0, 1),
|
||||
new Among("elig", 1, 1), new Among("els", -1, 1),
|
||||
new Among("l\u00F8st", -1, 2)
|
||||
],
|
||||
g_v = [17, 65, 16, 1, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128
|
||||
],
|
||||
g_s_ending = [239, 254, 42, 3,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16
|
||||
],
|
||||
I_x, I_p1, S_ch, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function r_mark_regions() {
|
||||
var v_1, c = sbp.cursor + 3;
|
||||
I_p1 = sbp.limit;
|
||||
if (0 <= c && c <= sbp.limit) {
|
||||
I_x = c;
|
||||
while (true) {
|
||||
v_1 = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 248)) {
|
||||
sbp.cursor = v_1;
|
||||
break;
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
if (v_1 >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
}
|
||||
while (!sbp.out_grouping(g_v, 97, 248)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
}
|
||||
I_p1 = sbp.cursor;
|
||||
if (I_p1 < I_x)
|
||||
I_p1 = I_x;
|
||||
}
|
||||
}
|
||||
|
||||
function r_main_suffix() {
|
||||
var among_var, v_1;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_0, 32);
|
||||
sbp.limit_backward = v_1;
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
if (sbp.in_grouping_b(g_s_ending, 97, 229))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_consonant_pair() {
|
||||
var v_1 = sbp.limit - sbp.cursor,
|
||||
v_2;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_2 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.find_among_b(a_1, 4)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.limit_backward = v_2;
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_del();
|
||||
}
|
||||
} else
|
||||
sbp.limit_backward = v_2;
|
||||
}
|
||||
}
|
||||
|
||||
function r_other_suffix() {
|
||||
var among_var, v_1 = sbp.limit - sbp.cursor,
|
||||
v_2, v_3;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "st")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "ig"))
|
||||
sbp.slice_del();
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_2 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_2, 5);
|
||||
sbp.limit_backward = v_2;
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
r_consonant_pair();
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_from("l\u00F8s");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_undouble() {
|
||||
var v_1;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.out_grouping_b(g_v, 97, 248)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
S_ch = sbp.slice_to(S_ch);
|
||||
sbp.limit_backward = v_1;
|
||||
if (sbp.eq_v_b(S_ch))
|
||||
sbp.slice_del();
|
||||
} else
|
||||
sbp.limit_backward = v_1;
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_mark_regions();
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
r_main_suffix();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_consonant_pair();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_other_suffix();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_undouble();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(token) {
|
||||
// for lunr version 2
|
||||
if (typeof token.update === "function") {
|
||||
return token.update(function(word) {
|
||||
st.setCurrent(word);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
})
|
||||
} else { // for lunr version <= 1
|
||||
st.setCurrent(token);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.da.stemmer, 'stemmer-da');
|
||||
|
||||
lunr.da.stopWordFilter = lunr.generateStopWordFilter('ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været'.split(' '));
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.da.stopWordFilter, 'stopWordFilter-da');
|
||||
};
|
||||
}))
|
||||
@@ -1,384 +0,0 @@
|
||||
/*!
|
||||
* Lunr languages, `German` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2014, Mihai Valentin
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.de = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.de.trimmer,
|
||||
lunr.de.stopWordFilter,
|
||||
lunr.de.stemmer
|
||||
);
|
||||
|
||||
// for lunr version 2
|
||||
// this is necessary so that every searched word is also stemmed before
|
||||
// in lunr <= 1 this is not needed, as it is done using the normal pipeline
|
||||
if (this.searchPipeline) {
|
||||
this.searchPipeline.reset();
|
||||
this.searchPipeline.add(lunr.de.stemmer)
|
||||
}
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.de.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
|
||||
lunr.de.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.de.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.de.trimmer, 'trimmer-de');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.de.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function GermanStemmer() {
|
||||
var a_0 = [new Among("", -1, 6), new Among("U", 0, 2),
|
||||
new Among("Y", 0, 1), new Among("\u00E4", 0, 3),
|
||||
new Among("\u00F6", 0, 4), new Among("\u00FC", 0, 5)
|
||||
],
|
||||
a_1 = [
|
||||
new Among("e", -1, 2), new Among("em", -1, 1),
|
||||
new Among("en", -1, 2), new Among("ern", -1, 1),
|
||||
new Among("er", -1, 1), new Among("s", -1, 3),
|
||||
new Among("es", 5, 2)
|
||||
],
|
||||
a_2 = [new Among("en", -1, 1),
|
||||
new Among("er", -1, 1), new Among("st", -1, 2),
|
||||
new Among("est", 2, 1)
|
||||
],
|
||||
a_3 = [new Among("ig", -1, 1),
|
||||
new Among("lich", -1, 1)
|
||||
],
|
||||
a_4 = [new Among("end", -1, 1),
|
||||
new Among("ig", -1, 2), new Among("ung", -1, 1),
|
||||
new Among("lich", -1, 3), new Among("isch", -1, 2),
|
||||
new Among("ik", -1, 2), new Among("heit", -1, 3),
|
||||
new Among("keit", -1, 4)
|
||||
],
|
||||
g_v = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 8, 0, 32, 8
|
||||
],
|
||||
g_s_ending = [117, 30, 5],
|
||||
g_st_ending = [
|
||||
117, 30, 4
|
||||
],
|
||||
I_x, I_p2, I_p1, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function habr1(c1, c2, v_1) {
|
||||
if (sbp.eq_s(1, c1)) {
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 252)) {
|
||||
sbp.slice_from(c2);
|
||||
sbp.cursor = v_1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_prelude() {
|
||||
var v_1 = sbp.cursor,
|
||||
v_2, v_3, v_4, v_5;
|
||||
while (true) {
|
||||
v_2 = sbp.cursor;
|
||||
sbp.bra = v_2;
|
||||
if (sbp.eq_s(1, "\u00DF")) {
|
||||
sbp.ket = sbp.cursor;
|
||||
sbp.slice_from("ss");
|
||||
} else {
|
||||
if (v_2 >= sbp.limit)
|
||||
break;
|
||||
sbp.cursor = v_2 + 1;
|
||||
}
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
while (true) {
|
||||
v_3 = sbp.cursor;
|
||||
while (true) {
|
||||
v_4 = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 252)) {
|
||||
v_5 = sbp.cursor;
|
||||
sbp.bra = v_5;
|
||||
if (habr1("u", "U", v_4))
|
||||
break;
|
||||
sbp.cursor = v_5;
|
||||
if (habr1("y", "Y", v_4))
|
||||
break;
|
||||
}
|
||||
if (v_4 >= sbp.limit) {
|
||||
sbp.cursor = v_3;
|
||||
return;
|
||||
}
|
||||
sbp.cursor = v_4 + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function habr2() {
|
||||
while (!sbp.in_grouping(g_v, 97, 252)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
while (!sbp.out_grouping(g_v, 97, 252)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_mark_regions() {
|
||||
I_p1 = sbp.limit;
|
||||
I_p2 = I_p1;
|
||||
var c = sbp.cursor + 3;
|
||||
if (0 <= c && c <= sbp.limit) {
|
||||
I_x = c;
|
||||
if (!habr2()) {
|
||||
I_p1 = sbp.cursor;
|
||||
if (I_p1 < I_x)
|
||||
I_p1 = I_x;
|
||||
if (!habr2())
|
||||
I_p2 = sbp.cursor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_postlude() {
|
||||
var among_var, v_1;
|
||||
while (true) {
|
||||
v_1 = sbp.cursor;
|
||||
sbp.bra = v_1;
|
||||
among_var = sbp.find_among(a_0, 6);
|
||||
if (!among_var)
|
||||
return;
|
||||
sbp.ket = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("y");
|
||||
break;
|
||||
case 2:
|
||||
case 5:
|
||||
sbp.slice_from("u");
|
||||
break;
|
||||
case 3:
|
||||
sbp.slice_from("a");
|
||||
break;
|
||||
case 4:
|
||||
sbp.slice_from("o");
|
||||
break;
|
||||
case 6:
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_R1() {
|
||||
return I_p1 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_R2() {
|
||||
return I_p2 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_standard_suffix() {
|
||||
var among_var, v_1 = sbp.limit - sbp.cursor,
|
||||
v_2, v_3, v_4;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_1, 7);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "s")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (sbp.eq_s_b(3, "nis"))
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (sbp.in_grouping_b(g_s_ending, 98, 116))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_2, 4);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
if (sbp.in_grouping_b(g_st_ending, 98, 116)) {
|
||||
var c = sbp.cursor - 3;
|
||||
if (sbp.limit_backward <= c && c <= sbp.limit) {
|
||||
sbp.cursor = c;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_4, 8);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "ig")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "e")) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "e")) {
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
v_4 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(2, "er")) {
|
||||
sbp.cursor = sbp.limit - v_4;
|
||||
if (!sbp.eq_s_b(2, "en"))
|
||||
break;
|
||||
}
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1())
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 4:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_3, 2);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2() && among_var == 1)
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_prelude();
|
||||
sbp.cursor = v_1;
|
||||
r_mark_regions();
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
r_standard_suffix();
|
||||
sbp.cursor = sbp.limit_backward;
|
||||
r_postlude();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(token) {
|
||||
// for lunr version 2
|
||||
if (typeof token.update === "function") {
|
||||
return token.update(function(word) {
|
||||
st.setCurrent(word);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
})
|
||||
} else { // for lunr version <= 1
|
||||
st.setCurrent(token);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.de.stemmer, 'stemmer-de');
|
||||
|
||||
lunr.de.stopWordFilter = lunr.generateStopWordFilter('aber alle allem allen aller alles als also am an ander andere anderem anderen anderer anderes anderm andern anderr anders auch auf aus bei bin bis bist da damit dann das dasselbe dazu daß dein deine deinem deinen deiner deines dem demselben den denn denselben der derer derselbe derselben des desselben dessen dich die dies diese dieselbe dieselben diesem diesen dieser dieses dir doch dort du durch ein eine einem einen einer eines einig einige einigem einigen einiger einiges einmal er es etwas euch euer eure eurem euren eurer eures für gegen gewesen hab habe haben hat hatte hatten hier hin hinter ich ihm ihn ihnen ihr ihre ihrem ihren ihrer ihres im in indem ins ist jede jedem jeden jeder jedes jene jenem jenen jener jenes jetzt kann kein keine keinem keinen keiner keines können könnte machen man manche manchem manchen mancher manches mein meine meinem meinen meiner meines mich mir mit muss musste nach nicht nichts noch nun nur ob oder ohne sehr sein seine seinem seinen seiner seines selbst sich sie sind so solche solchem solchen solcher solches soll sollte sondern sonst um und uns unse unsem unsen unser unses unter viel vom von vor war waren warst was weg weil weiter welche welchem welchen welcher welches wenn werde werden wie wieder will wir wird wirst wo wollen wollte während würde würden zu zum zur zwar zwischen über'.split(' '));
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.de.stopWordFilter, 'stopWordFilter-de');
|
||||
};
|
||||
}))
|
||||
@@ -1,450 +0,0 @@
|
||||
/*!
|
||||
* Lunr languages, `Dutch` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2014, Mihai Valentin
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
console.warn("[Lunr Languages] Please use the \"nl\" instead of the \"du\". The \"nl\" code is the standard code for Dutch language, and \"du\" will be removed in the next major versions.");
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.du = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.du.trimmer,
|
||||
lunr.du.stopWordFilter,
|
||||
lunr.du.stemmer
|
||||
);
|
||||
|
||||
// for lunr version 2
|
||||
// this is necessary so that every searched word is also stemmed before
|
||||
// in lunr <= 1 this is not needed, as it is done using the normal pipeline
|
||||
if (this.searchPipeline) {
|
||||
this.searchPipeline.reset();
|
||||
this.searchPipeline.add(lunr.du.stemmer)
|
||||
}
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.du.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
|
||||
lunr.du.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.du.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.du.trimmer, 'trimmer-du');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.du.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function DutchStemmer() {
|
||||
var a_0 = [new Among("", -1, 6), new Among("\u00E1", 0, 1),
|
||||
new Among("\u00E4", 0, 1), new Among("\u00E9", 0, 2),
|
||||
new Among("\u00EB", 0, 2), new Among("\u00ED", 0, 3),
|
||||
new Among("\u00EF", 0, 3), new Among("\u00F3", 0, 4),
|
||||
new Among("\u00F6", 0, 4), new Among("\u00FA", 0, 5),
|
||||
new Among("\u00FC", 0, 5)
|
||||
],
|
||||
a_1 = [new Among("", -1, 3),
|
||||
new Among("I", 0, 2), new Among("Y", 0, 1)
|
||||
],
|
||||
a_2 = [
|
||||
new Among("dd", -1, -1), new Among("kk", -1, -1),
|
||||
new Among("tt", -1, -1)
|
||||
],
|
||||
a_3 = [new Among("ene", -1, 2),
|
||||
new Among("se", -1, 3), new Among("en", -1, 2),
|
||||
new Among("heden", 2, 1), new Among("s", -1, 3)
|
||||
],
|
||||
a_4 = [
|
||||
new Among("end", -1, 1), new Among("ig", -1, 2),
|
||||
new Among("ing", -1, 1), new Among("lijk", -1, 3),
|
||||
new Among("baar", -1, 4), new Among("bar", -1, 5)
|
||||
],
|
||||
a_5 = [
|
||||
new Among("aa", -1, -1), new Among("ee", -1, -1),
|
||||
new Among("oo", -1, -1), new Among("uu", -1, -1)
|
||||
],
|
||||
g_v = [17, 65,
|
||||
16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
|
||||
],
|
||||
g_v_I = [1, 0, 0,
|
||||
17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
|
||||
],
|
||||
g_v_j = [
|
||||
17, 67, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
|
||||
],
|
||||
I_p2, I_p1, B_e_found, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function r_prelude() {
|
||||
var among_var, v_1 = sbp.cursor,
|
||||
v_2, v_3;
|
||||
while (true) {
|
||||
sbp.bra = sbp.cursor;
|
||||
among_var = sbp.find_among(a_0, 11);
|
||||
if (among_var) {
|
||||
sbp.ket = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("a");
|
||||
continue;
|
||||
case 2:
|
||||
sbp.slice_from("e");
|
||||
continue;
|
||||
case 3:
|
||||
sbp.slice_from("i");
|
||||
continue;
|
||||
case 4:
|
||||
sbp.slice_from("o");
|
||||
continue;
|
||||
case 5:
|
||||
sbp.slice_from("u");
|
||||
continue;
|
||||
case 6:
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
break;
|
||||
sbp.cursor++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
sbp.bra = v_1;
|
||||
if (sbp.eq_s(1, "y")) {
|
||||
sbp.ket = sbp.cursor;
|
||||
sbp.slice_from("Y");
|
||||
} else
|
||||
sbp.cursor = v_1;
|
||||
while (true) {
|
||||
v_2 = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 232)) {
|
||||
v_3 = sbp.cursor;
|
||||
sbp.bra = v_3;
|
||||
if (sbp.eq_s(1, "i")) {
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 232)) {
|
||||
sbp.slice_from("I");
|
||||
sbp.cursor = v_2;
|
||||
}
|
||||
} else {
|
||||
sbp.cursor = v_3;
|
||||
if (sbp.eq_s(1, "y")) {
|
||||
sbp.ket = sbp.cursor;
|
||||
sbp.slice_from("Y");
|
||||
sbp.cursor = v_2;
|
||||
} else if (habr1(v_2))
|
||||
break;
|
||||
}
|
||||
} else if (habr1(v_2))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function habr1(v_1) {
|
||||
sbp.cursor = v_1;
|
||||
if (v_1 >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_mark_regions() {
|
||||
I_p1 = sbp.limit;
|
||||
I_p2 = I_p1;
|
||||
if (!habr2()) {
|
||||
I_p1 = sbp.cursor;
|
||||
if (I_p1 < 3)
|
||||
I_p1 = 3;
|
||||
if (!habr2())
|
||||
I_p2 = sbp.cursor;
|
||||
}
|
||||
}
|
||||
|
||||
function habr2() {
|
||||
while (!sbp.in_grouping(g_v, 97, 232)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
while (!sbp.out_grouping(g_v, 97, 232)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_postlude() {
|
||||
var among_var;
|
||||
while (true) {
|
||||
sbp.bra = sbp.cursor;
|
||||
among_var = sbp.find_among(a_1, 3);
|
||||
if (among_var) {
|
||||
sbp.ket = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("y");
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_from("i");
|
||||
break;
|
||||
case 3:
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_R1() {
|
||||
return I_p1 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_R2() {
|
||||
return I_p2 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_undouble() {
|
||||
var v_1 = sbp.limit - sbp.cursor;
|
||||
if (sbp.find_among_b(a_2, 3)) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_e_ending() {
|
||||
var v_1;
|
||||
B_e_found = false;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "e")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
v_1 = sbp.limit - sbp.cursor;
|
||||
if (sbp.out_grouping_b(g_v, 97, 232)) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.slice_del();
|
||||
B_e_found = true;
|
||||
r_undouble();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_en_ending() {
|
||||
var v_1;
|
||||
if (r_R1()) {
|
||||
v_1 = sbp.limit - sbp.cursor;
|
||||
if (sbp.out_grouping_b(g_v, 97, 232)) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (!sbp.eq_s_b(3, "gem")) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.slice_del();
|
||||
r_undouble();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_standard_suffix() {
|
||||
var among_var, v_1 = sbp.limit - sbp.cursor,
|
||||
v_2, v_3, v_4, v_5, v_6;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_3, 5);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (r_R1())
|
||||
sbp.slice_from("heid");
|
||||
break;
|
||||
case 2:
|
||||
r_en_ending();
|
||||
break;
|
||||
case 3:
|
||||
if (r_R1() && sbp.out_grouping_b(g_v_j, 97, 232))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
r_e_ending();
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(4, "heid")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2()) {
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "c")) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "en")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
r_en_ending();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_4, 6);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (r_R2()) {
|
||||
sbp.slice_del();
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "ig")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2()) {
|
||||
v_4 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "e")) {
|
||||
sbp.cursor = sbp.limit - v_4;
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
r_undouble();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (r_R2()) {
|
||||
v_5 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "e")) {
|
||||
sbp.cursor = sbp.limit - v_5;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (r_R2()) {
|
||||
sbp.slice_del();
|
||||
r_e_ending();
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 5:
|
||||
if (r_R2() && B_e_found)
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (sbp.out_grouping_b(g_v_I, 73, 232)) {
|
||||
v_6 = sbp.limit - sbp.cursor;
|
||||
if (sbp.find_among_b(a_5, 4) && sbp.out_grouping_b(g_v, 97, 232)) {
|
||||
sbp.cursor = sbp.limit - v_6;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_prelude();
|
||||
sbp.cursor = v_1;
|
||||
r_mark_regions();
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
r_standard_suffix();
|
||||
sbp.cursor = sbp.limit_backward;
|
||||
r_postlude();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(token) {
|
||||
// for lunr version 2
|
||||
if (typeof token.update === "function") {
|
||||
return token.update(function(word) {
|
||||
st.setCurrent(word);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
})
|
||||
} else { // for lunr version <= 1
|
||||
st.setCurrent(token);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.du.stemmer, 'stemmer-du');
|
||||
|
||||
lunr.du.stopWordFilter = lunr.generateStopWordFilter(' aan al alles als altijd andere ben bij daar dan dat de der deze die dit doch doen door dus een eens en er ge geen geweest haar had heb hebben heeft hem het hier hij hoe hun iemand iets ik in is ja je kan kon kunnen maar me meer men met mij mijn moet na naar niet niets nog nu of om omdat onder ons ook op over reeds te tegen toch toen tot u uit uw van veel voor want waren was wat werd wezen wie wil worden wordt zal ze zelf zich zij zijn zo zonder zou'.split(' '));
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.du.stopWordFilter, 'stopWordFilter-du');
|
||||
};
|
||||
}))
|
||||
@@ -1,599 +0,0 @@
|
||||
/*!
|
||||
* Lunr languages, `Spanish` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2014, Mihai Valentin
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.es = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.es.trimmer,
|
||||
lunr.es.stopWordFilter,
|
||||
lunr.es.stemmer
|
||||
);
|
||||
|
||||
// for lunr version 2
|
||||
// this is necessary so that every searched word is also stemmed before
|
||||
// in lunr <= 1 this is not needed, as it is done using the normal pipeline
|
||||
if (this.searchPipeline) {
|
||||
this.searchPipeline.reset();
|
||||
this.searchPipeline.add(lunr.es.stemmer)
|
||||
}
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.es.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
|
||||
lunr.es.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.es.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.es.trimmer, 'trimmer-es');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.es.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function SpanishStemmer() {
|
||||
var a_0 = [new Among("", -1, 6), new Among("\u00E1", 0, 1),
|
||||
new Among("\u00E9", 0, 2), new Among("\u00ED", 0, 3),
|
||||
new Among("\u00F3", 0, 4), new Among("\u00FA", 0, 5)
|
||||
],
|
||||
a_1 = [
|
||||
new Among("la", -1, -1), new Among("sela", 0, -1),
|
||||
new Among("le", -1, -1), new Among("me", -1, -1),
|
||||
new Among("se", -1, -1), new Among("lo", -1, -1),
|
||||
new Among("selo", 5, -1), new Among("las", -1, -1),
|
||||
new Among("selas", 7, -1), new Among("les", -1, -1),
|
||||
new Among("los", -1, -1), new Among("selos", 10, -1),
|
||||
new Among("nos", -1, -1)
|
||||
],
|
||||
a_2 = [new Among("ando", -1, 6),
|
||||
new Among("iendo", -1, 6), new Among("yendo", -1, 7),
|
||||
new Among("\u00E1ndo", -1, 2), new Among("i\u00E9ndo", -1, 1),
|
||||
new Among("ar", -1, 6), new Among("er", -1, 6),
|
||||
new Among("ir", -1, 6), new Among("\u00E1r", -1, 3),
|
||||
new Among("\u00E9r", -1, 4), new Among("\u00EDr", -1, 5)
|
||||
],
|
||||
a_3 = [
|
||||
new Among("ic", -1, -1), new Among("ad", -1, -1),
|
||||
new Among("os", -1, -1), new Among("iv", -1, 1)
|
||||
],
|
||||
a_4 = [
|
||||
new Among("able", -1, 1), new Among("ible", -1, 1),
|
||||
new Among("ante", -1, 1)
|
||||
],
|
||||
a_5 = [new Among("ic", -1, 1),
|
||||
new Among("abil", -1, 1), new Among("iv", -1, 1)
|
||||
],
|
||||
a_6 = [
|
||||
new Among("ica", -1, 1), new Among("ancia", -1, 2),
|
||||
new Among("encia", -1, 5), new Among("adora", -1, 2),
|
||||
new Among("osa", -1, 1), new Among("ista", -1, 1),
|
||||
new Among("iva", -1, 9), new Among("anza", -1, 1),
|
||||
new Among("log\u00EDa", -1, 3), new Among("idad", -1, 8),
|
||||
new Among("able", -1, 1), new Among("ible", -1, 1),
|
||||
new Among("ante", -1, 2), new Among("mente", -1, 7),
|
||||
new Among("amente", 13, 6), new Among("aci\u00F3n", -1, 2),
|
||||
new Among("uci\u00F3n", -1, 4), new Among("ico", -1, 1),
|
||||
new Among("ismo", -1, 1), new Among("oso", -1, 1),
|
||||
new Among("amiento", -1, 1), new Among("imiento", -1, 1),
|
||||
new Among("ivo", -1, 9), new Among("ador", -1, 2),
|
||||
new Among("icas", -1, 1), new Among("ancias", -1, 2),
|
||||
new Among("encias", -1, 5), new Among("adoras", -1, 2),
|
||||
new Among("osas", -1, 1), new Among("istas", -1, 1),
|
||||
new Among("ivas", -1, 9), new Among("anzas", -1, 1),
|
||||
new Among("log\u00EDas", -1, 3), new Among("idades", -1, 8),
|
||||
new Among("ables", -1, 1), new Among("ibles", -1, 1),
|
||||
new Among("aciones", -1, 2), new Among("uciones", -1, 4),
|
||||
new Among("adores", -1, 2), new Among("antes", -1, 2),
|
||||
new Among("icos", -1, 1), new Among("ismos", -1, 1),
|
||||
new Among("osos", -1, 1), new Among("amientos", -1, 1),
|
||||
new Among("imientos", -1, 1), new Among("ivos", -1, 9)
|
||||
],
|
||||
a_7 = [
|
||||
new Among("ya", -1, 1), new Among("ye", -1, 1),
|
||||
new Among("yan", -1, 1), new Among("yen", -1, 1),
|
||||
new Among("yeron", -1, 1), new Among("yendo", -1, 1),
|
||||
new Among("yo", -1, 1), new Among("yas", -1, 1),
|
||||
new Among("yes", -1, 1), new Among("yais", -1, 1),
|
||||
new Among("yamos", -1, 1), new Among("y\u00F3", -1, 1)
|
||||
],
|
||||
a_8 = [
|
||||
new Among("aba", -1, 2), new Among("ada", -1, 2),
|
||||
new Among("ida", -1, 2), new Among("ara", -1, 2),
|
||||
new Among("iera", -1, 2), new Among("\u00EDa", -1, 2),
|
||||
new Among("ar\u00EDa", 5, 2), new Among("er\u00EDa", 5, 2),
|
||||
new Among("ir\u00EDa", 5, 2), new Among("ad", -1, 2),
|
||||
new Among("ed", -1, 2), new Among("id", -1, 2),
|
||||
new Among("ase", -1, 2), new Among("iese", -1, 2),
|
||||
new Among("aste", -1, 2), new Among("iste", -1, 2),
|
||||
new Among("an", -1, 2), new Among("aban", 16, 2),
|
||||
new Among("aran", 16, 2), new Among("ieran", 16, 2),
|
||||
new Among("\u00EDan", 16, 2), new Among("ar\u00EDan", 20, 2),
|
||||
new Among("er\u00EDan", 20, 2), new Among("ir\u00EDan", 20, 2),
|
||||
new Among("en", -1, 1), new Among("asen", 24, 2),
|
||||
new Among("iesen", 24, 2), new Among("aron", -1, 2),
|
||||
new Among("ieron", -1, 2), new Among("ar\u00E1n", -1, 2),
|
||||
new Among("er\u00E1n", -1, 2), new Among("ir\u00E1n", -1, 2),
|
||||
new Among("ado", -1, 2), new Among("ido", -1, 2),
|
||||
new Among("ando", -1, 2), new Among("iendo", -1, 2),
|
||||
new Among("ar", -1, 2), new Among("er", -1, 2),
|
||||
new Among("ir", -1, 2), new Among("as", -1, 2),
|
||||
new Among("abas", 39, 2), new Among("adas", 39, 2),
|
||||
new Among("idas", 39, 2), new Among("aras", 39, 2),
|
||||
new Among("ieras", 39, 2), new Among("\u00EDas", 39, 2),
|
||||
new Among("ar\u00EDas", 45, 2), new Among("er\u00EDas", 45, 2),
|
||||
new Among("ir\u00EDas", 45, 2), new Among("es", -1, 1),
|
||||
new Among("ases", 49, 2), new Among("ieses", 49, 2),
|
||||
new Among("abais", -1, 2), new Among("arais", -1, 2),
|
||||
new Among("ierais", -1, 2), new Among("\u00EDais", -1, 2),
|
||||
new Among("ar\u00EDais", 55, 2), new Among("er\u00EDais", 55, 2),
|
||||
new Among("ir\u00EDais", 55, 2), new Among("aseis", -1, 2),
|
||||
new Among("ieseis", -1, 2), new Among("asteis", -1, 2),
|
||||
new Among("isteis", -1, 2), new Among("\u00E1is", -1, 2),
|
||||
new Among("\u00E9is", -1, 1), new Among("ar\u00E9is", 64, 2),
|
||||
new Among("er\u00E9is", 64, 2), new Among("ir\u00E9is", 64, 2),
|
||||
new Among("ados", -1, 2), new Among("idos", -1, 2),
|
||||
new Among("amos", -1, 2), new Among("\u00E1bamos", 70, 2),
|
||||
new Among("\u00E1ramos", 70, 2), new Among("i\u00E9ramos", 70, 2),
|
||||
new Among("\u00EDamos", 70, 2), new Among("ar\u00EDamos", 74, 2),
|
||||
new Among("er\u00EDamos", 74, 2), new Among("ir\u00EDamos", 74, 2),
|
||||
new Among("emos", -1, 1), new Among("aremos", 78, 2),
|
||||
new Among("eremos", 78, 2), new Among("iremos", 78, 2),
|
||||
new Among("\u00E1semos", 78, 2), new Among("i\u00E9semos", 78, 2),
|
||||
new Among("imos", -1, 2), new Among("ar\u00E1s", -1, 2),
|
||||
new Among("er\u00E1s", -1, 2), new Among("ir\u00E1s", -1, 2),
|
||||
new Among("\u00EDs", -1, 2), new Among("ar\u00E1", -1, 2),
|
||||
new Among("er\u00E1", -1, 2), new Among("ir\u00E1", -1, 2),
|
||||
new Among("ar\u00E9", -1, 2), new Among("er\u00E9", -1, 2),
|
||||
new Among("ir\u00E9", -1, 2), new Among("i\u00F3", -1, 2)
|
||||
],
|
||||
a_9 = [
|
||||
new Among("a", -1, 1), new Among("e", -1, 2),
|
||||
new Among("o", -1, 1), new Among("os", -1, 1),
|
||||
new Among("\u00E1", -1, 1), new Among("\u00E9", -1, 2),
|
||||
new Among("\u00ED", -1, 1), new Among("\u00F3", -1, 1)
|
||||
],
|
||||
g_v = [17,
|
||||
65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 4, 10
|
||||
],
|
||||
I_p2, I_p1, I_pV, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function habr1() {
|
||||
if (sbp.out_grouping(g_v, 97, 252)) {
|
||||
while (!sbp.in_grouping(g_v, 97, 252)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function habr2() {
|
||||
if (sbp.in_grouping(g_v, 97, 252)) {
|
||||
var v_1 = sbp.cursor;
|
||||
if (habr1()) {
|
||||
sbp.cursor = v_1;
|
||||
if (!sbp.in_grouping(g_v, 97, 252))
|
||||
return true;
|
||||
while (!sbp.out_grouping(g_v, 97, 252)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function habr3() {
|
||||
var v_1 = sbp.cursor,
|
||||
v_2;
|
||||
if (habr2()) {
|
||||
sbp.cursor = v_1;
|
||||
if (!sbp.out_grouping(g_v, 97, 252))
|
||||
return;
|
||||
v_2 = sbp.cursor;
|
||||
if (habr1()) {
|
||||
sbp.cursor = v_2;
|
||||
if (!sbp.in_grouping(g_v, 97, 252) || sbp.cursor >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
}
|
||||
}
|
||||
I_pV = sbp.cursor;
|
||||
}
|
||||
|
||||
function habr4() {
|
||||
while (!sbp.in_grouping(g_v, 97, 252)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return false;
|
||||
sbp.cursor++;
|
||||
}
|
||||
while (!sbp.out_grouping(g_v, 97, 252)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return false;
|
||||
sbp.cursor++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function r_mark_regions() {
|
||||
var v_1 = sbp.cursor;
|
||||
I_pV = sbp.limit;
|
||||
I_p1 = I_pV;
|
||||
I_p2 = I_pV;
|
||||
habr3();
|
||||
sbp.cursor = v_1;
|
||||
if (habr4()) {
|
||||
I_p1 = sbp.cursor;
|
||||
if (habr4())
|
||||
I_p2 = sbp.cursor;
|
||||
}
|
||||
}
|
||||
|
||||
function r_postlude() {
|
||||
var among_var;
|
||||
while (true) {
|
||||
sbp.bra = sbp.cursor;
|
||||
among_var = sbp.find_among(a_0, 6);
|
||||
if (among_var) {
|
||||
sbp.ket = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("a");
|
||||
continue;
|
||||
case 2:
|
||||
sbp.slice_from("e");
|
||||
continue;
|
||||
case 3:
|
||||
sbp.slice_from("i");
|
||||
continue;
|
||||
case 4:
|
||||
sbp.slice_from("o");
|
||||
continue;
|
||||
case 5:
|
||||
sbp.slice_from("u");
|
||||
continue;
|
||||
case 6:
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
break;
|
||||
sbp.cursor++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function r_RV() {
|
||||
return I_pV <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_R1() {
|
||||
return I_p1 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_R2() {
|
||||
return I_p2 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_attached_pronoun() {
|
||||
var among_var;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.find_among_b(a_1, 13)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_2, 11);
|
||||
if (among_var && r_RV())
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_from("iendo");
|
||||
break;
|
||||
case 2:
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_from("ando");
|
||||
break;
|
||||
case 3:
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_from("ar");
|
||||
break;
|
||||
case 4:
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_from("er");
|
||||
break;
|
||||
case 5:
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_from("ir");
|
||||
break;
|
||||
case 6:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 7:
|
||||
if (sbp.eq_s_b(1, "u"))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function habr5(a, n) {
|
||||
if (!r_R2())
|
||||
return true;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
var among_var = sbp.find_among_b(a, n);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (among_var == 1 && r_R2())
|
||||
sbp.slice_del();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function habr6(c1) {
|
||||
if (!r_R2())
|
||||
return true;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, c1)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_standard_suffix() {
|
||||
var among_var;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_6, 46);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
if (habr6("ic"))
|
||||
return false;
|
||||
break;
|
||||
case 3:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_from("log");
|
||||
break;
|
||||
case 4:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_from("u");
|
||||
break;
|
||||
case 5:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_from("ente");
|
||||
break;
|
||||
case 6:
|
||||
if (!r_R1())
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_3, 4);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2()) {
|
||||
sbp.slice_del();
|
||||
if (among_var == 1) {
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "at")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (habr5(a_4, 3))
|
||||
return false;
|
||||
break;
|
||||
case 8:
|
||||
if (habr5(a_5, 3))
|
||||
return false;
|
||||
break;
|
||||
case 9:
|
||||
if (habr6("at"))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_y_verb_suffix() {
|
||||
var among_var, v_1;
|
||||
if (sbp.cursor >= I_pV) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_pV;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_7, 12);
|
||||
sbp.limit_backward = v_1;
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (among_var == 1) {
|
||||
if (!sbp.eq_s_b(1, "u"))
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_verb_suffix() {
|
||||
var among_var, v_1, v_2, v_3;
|
||||
if (sbp.cursor >= I_pV) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_pV;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_8, 96);
|
||||
sbp.limit_backward = v_1;
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "u")) {
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "g"))
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
else
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
} else
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.bra = sbp.cursor;
|
||||
case 2:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_residual_suffix() {
|
||||
var among_var, v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_9, 8);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (r_RV())
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
if (r_RV()) {
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "u")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
v_1 = sbp.limit - sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "g")) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (r_RV())
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_mark_regions();
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
r_attached_pronoun();
|
||||
sbp.cursor = sbp.limit;
|
||||
if (!r_standard_suffix()) {
|
||||
sbp.cursor = sbp.limit;
|
||||
if (!r_y_verb_suffix()) {
|
||||
sbp.cursor = sbp.limit;
|
||||
r_verb_suffix();
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit;
|
||||
r_residual_suffix();
|
||||
sbp.cursor = sbp.limit_backward;
|
||||
r_postlude();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(token) {
|
||||
// for lunr version 2
|
||||
if (typeof token.update === "function") {
|
||||
return token.update(function(word) {
|
||||
st.setCurrent(word);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
})
|
||||
} else { // for lunr version <= 1
|
||||
st.setCurrent(token);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.es.stemmer, 'stemmer-es');
|
||||
|
||||
lunr.es.stopWordFilter = lunr.generateStopWordFilter('a al algo algunas algunos ante antes como con contra cual cuando de del desde donde durante e el ella ellas ellos en entre era erais eran eras eres es esa esas ese eso esos esta estaba estabais estaban estabas estad estada estadas estado estados estamos estando estar estaremos estará estarán estarás estaré estaréis estaría estaríais estaríamos estarían estarías estas este estemos esto estos estoy estuve estuviera estuvierais estuvieran estuvieras estuvieron estuviese estuvieseis estuviesen estuvieses estuvimos estuviste estuvisteis estuviéramos estuviésemos estuvo está estábamos estáis están estás esté estéis estén estés fue fuera fuerais fueran fueras fueron fuese fueseis fuesen fueses fui fuimos fuiste fuisteis fuéramos fuésemos ha habida habidas habido habidos habiendo habremos habrá habrán habrás habré habréis habría habríais habríamos habrían habrías habéis había habíais habíamos habían habías han has hasta hay haya hayamos hayan hayas hayáis he hemos hube hubiera hubierais hubieran hubieras hubieron hubiese hubieseis hubiesen hubieses hubimos hubiste hubisteis hubiéramos hubiésemos hubo la las le les lo los me mi mis mucho muchos muy más mí mía mías mío míos nada ni no nos nosotras nosotros nuestra nuestras nuestro nuestros o os otra otras otro otros para pero poco por porque que quien quienes qué se sea seamos sean seas seremos será serán serás seré seréis sería seríais seríamos serían serías seáis sido siendo sin sobre sois somos son soy su sus suya suyas suyo suyos sí también tanto te tendremos tendrá tendrán tendrás tendré tendréis tendría tendríais tendríamos tendrían tendrías tened tenemos tenga tengamos tengan tengas tengo tengáis tenida tenidas tenido tenidos teniendo tenéis tenía teníais teníamos tenían tenías ti tiene tienen tienes todo todos tu tus tuve tuviera tuvierais tuvieran tuvieras tuvieron tuviese tuvieseis tuviesen tuvieses tuvimos tuviste tuvisteis tuviéramos tuviésemos tuvo tuya tuyas tuyo tuyos tú un una uno unos vosotras vosotros vuestra vuestras vuestro vuestros y ya yo él éramos'.split(' '));
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.es.stopWordFilter, 'stopWordFilter-es');
|
||||
};
|
||||
}))
|
||||
@@ -1,541 +0,0 @@
|
||||
/*!
|
||||
* Lunr languages, `Finnish` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2014, Mihai Valentin
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
;
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.fi = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.fi.trimmer,
|
||||
lunr.fi.stopWordFilter,
|
||||
lunr.fi.stemmer
|
||||
);
|
||||
|
||||
// for lunr version 2
|
||||
// this is necessary so that every searched word is also stemmed before
|
||||
// in lunr <= 1 this is not needed, as it is done using the normal pipeline
|
||||
if (this.searchPipeline) {
|
||||
this.searchPipeline.reset();
|
||||
this.searchPipeline.add(lunr.fi.stemmer)
|
||||
}
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.fi.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
|
||||
lunr.fi.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.fi.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.fi.trimmer, 'trimmer-fi');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.fi.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function FinnishStemmer() {
|
||||
var a_0 = [new Among("pa", -1, 1), new Among("sti", -1, 2),
|
||||
new Among("kaan", -1, 1), new Among("han", -1, 1),
|
||||
new Among("kin", -1, 1), new Among("h\u00E4n", -1, 1),
|
||||
new Among("k\u00E4\u00E4n", -1, 1), new Among("ko", -1, 1),
|
||||
new Among("p\u00E4", -1, 1), new Among("k\u00F6", -1, 1)
|
||||
],
|
||||
a_1 = [
|
||||
new Among("lla", -1, -1), new Among("na", -1, -1),
|
||||
new Among("ssa", -1, -1), new Among("ta", -1, -1),
|
||||
new Among("lta", 3, -1), new Among("sta", 3, -1)
|
||||
],
|
||||
a_2 = [
|
||||
new Among("ll\u00E4", -1, -1), new Among("n\u00E4", -1, -1),
|
||||
new Among("ss\u00E4", -1, -1), new Among("t\u00E4", -1, -1),
|
||||
new Among("lt\u00E4", 3, -1), new Among("st\u00E4", 3, -1)
|
||||
],
|
||||
a_3 = [
|
||||
new Among("lle", -1, -1), new Among("ine", -1, -1)
|
||||
],
|
||||
a_4 = [
|
||||
new Among("nsa", -1, 3), new Among("mme", -1, 3),
|
||||
new Among("nne", -1, 3), new Among("ni", -1, 2),
|
||||
new Among("si", -1, 1), new Among("an", -1, 4),
|
||||
new Among("en", -1, 6), new Among("\u00E4n", -1, 5),
|
||||
new Among("ns\u00E4", -1, 3)
|
||||
],
|
||||
a_5 = [new Among("aa", -1, -1),
|
||||
new Among("ee", -1, -1), new Among("ii", -1, -1),
|
||||
new Among("oo", -1, -1), new Among("uu", -1, -1),
|
||||
new Among("\u00E4\u00E4", -1, -1),
|
||||
new Among("\u00F6\u00F6", -1, -1)
|
||||
],
|
||||
a_6 = [new Among("a", -1, 8),
|
||||
new Among("lla", 0, -1), new Among("na", 0, -1),
|
||||
new Among("ssa", 0, -1), new Among("ta", 0, -1),
|
||||
new Among("lta", 4, -1), new Among("sta", 4, -1),
|
||||
new Among("tta", 4, 9), new Among("lle", -1, -1),
|
||||
new Among("ine", -1, -1), new Among("ksi", -1, -1),
|
||||
new Among("n", -1, 7), new Among("han", 11, 1),
|
||||
new Among("den", 11, -1, r_VI), new Among("seen", 11, -1, r_LONG),
|
||||
new Among("hen", 11, 2), new Among("tten", 11, -1, r_VI),
|
||||
new Among("hin", 11, 3), new Among("siin", 11, -1, r_VI),
|
||||
new Among("hon", 11, 4), new Among("h\u00E4n", 11, 5),
|
||||
new Among("h\u00F6n", 11, 6), new Among("\u00E4", -1, 8),
|
||||
new Among("ll\u00E4", 22, -1), new Among("n\u00E4", 22, -1),
|
||||
new Among("ss\u00E4", 22, -1), new Among("t\u00E4", 22, -1),
|
||||
new Among("lt\u00E4", 26, -1), new Among("st\u00E4", 26, -1),
|
||||
new Among("tt\u00E4", 26, 9)
|
||||
],
|
||||
a_7 = [new Among("eja", -1, -1),
|
||||
new Among("mma", -1, 1), new Among("imma", 1, -1),
|
||||
new Among("mpa", -1, 1), new Among("impa", 3, -1),
|
||||
new Among("mmi", -1, 1), new Among("immi", 5, -1),
|
||||
new Among("mpi", -1, 1), new Among("impi", 7, -1),
|
||||
new Among("ej\u00E4", -1, -1), new Among("mm\u00E4", -1, 1),
|
||||
new Among("imm\u00E4", 10, -1), new Among("mp\u00E4", -1, 1),
|
||||
new Among("imp\u00E4", 12, -1)
|
||||
],
|
||||
a_8 = [new Among("i", -1, -1),
|
||||
new Among("j", -1, -1)
|
||||
],
|
||||
a_9 = [new Among("mma", -1, 1),
|
||||
new Among("imma", 0, -1)
|
||||
],
|
||||
g_AEI = [17, 1, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 8
|
||||
],
|
||||
g_V1 = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 8, 0, 32
|
||||
],
|
||||
g_V2 = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 8, 0, 32
|
||||
],
|
||||
g_particle_end = [17, 97, 24, 1, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32
|
||||
],
|
||||
B_ending_removed, S_x, I_p2, I_p1, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function r_mark_regions() {
|
||||
I_p1 = sbp.limit;
|
||||
I_p2 = I_p1;
|
||||
if (!habr1()) {
|
||||
I_p1 = sbp.cursor;
|
||||
if (!habr1())
|
||||
I_p2 = sbp.cursor;
|
||||
}
|
||||
}
|
||||
|
||||
function habr1() {
|
||||
var v_1;
|
||||
while (true) {
|
||||
v_1 = sbp.cursor;
|
||||
if (sbp.in_grouping(g_V1, 97, 246))
|
||||
break;
|
||||
sbp.cursor = v_1;
|
||||
if (v_1 >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
while (!sbp.out_grouping(g_V1, 97, 246)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_R2() {
|
||||
return I_p2 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_particle_etc() {
|
||||
var among_var, v_1;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_0, 10);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.limit_backward = v_1;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (!sbp.in_grouping_b(g_particle_end, 97, 246))
|
||||
return;
|
||||
break;
|
||||
case 2:
|
||||
if (!r_R2())
|
||||
return;
|
||||
break;
|
||||
}
|
||||
sbp.slice_del();
|
||||
} else
|
||||
sbp.limit_backward = v_1;
|
||||
}
|
||||
}
|
||||
|
||||
function r_possessive() {
|
||||
var among_var, v_1, v_2;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_4, 9);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.limit_backward = v_1;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "k")) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(3, "kse")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_from("ksi");
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 4:
|
||||
if (sbp.find_among_b(a_1, 6))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 5:
|
||||
if (sbp.find_among_b(a_2, 6))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 6:
|
||||
if (sbp.find_among_b(a_3, 2))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
} else
|
||||
sbp.limit_backward = v_1;
|
||||
}
|
||||
}
|
||||
|
||||
function r_LONG() {
|
||||
return sbp.find_among_b(a_5, 7);
|
||||
}
|
||||
|
||||
function r_VI() {
|
||||
return sbp.eq_s_b(1, "i") && sbp.in_grouping_b(g_V2, 97, 246);
|
||||
}
|
||||
|
||||
function r_case_ending() {
|
||||
var among_var, v_1, v_2;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_6, 30);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.limit_backward = v_1;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (!sbp.eq_s_b(1, "a"))
|
||||
return;
|
||||
break;
|
||||
case 2:
|
||||
case 9:
|
||||
if (!sbp.eq_s_b(1, "e"))
|
||||
return;
|
||||
break;
|
||||
case 3:
|
||||
if (!sbp.eq_s_b(1, "i"))
|
||||
return;
|
||||
break;
|
||||
case 4:
|
||||
if (!sbp.eq_s_b(1, "o"))
|
||||
return;
|
||||
break;
|
||||
case 5:
|
||||
if (!sbp.eq_s_b(1, "\u00E4"))
|
||||
return;
|
||||
break;
|
||||
case 6:
|
||||
if (!sbp.eq_s_b(1, "\u00F6"))
|
||||
return;
|
||||
break;
|
||||
case 7:
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (!r_LONG()) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
if (!sbp.eq_s_b(2, "ie")) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
if (sbp.cursor <= sbp.limit_backward) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
break;
|
||||
}
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
break;
|
||||
case 8:
|
||||
if (!sbp.in_grouping_b(g_V1, 97, 246) ||
|
||||
!sbp.out_grouping_b(g_V1, 97, 246))
|
||||
return;
|
||||
break;
|
||||
}
|
||||
sbp.slice_del();
|
||||
B_ending_removed = true;
|
||||
} else
|
||||
sbp.limit_backward = v_1;
|
||||
}
|
||||
}
|
||||
|
||||
function r_other_endings() {
|
||||
var among_var, v_1, v_2;
|
||||
if (sbp.cursor >= I_p2) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p2;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_7, 14);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.limit_backward = v_1;
|
||||
if (among_var == 1) {
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "po"))
|
||||
return;
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
}
|
||||
sbp.slice_del();
|
||||
} else
|
||||
sbp.limit_backward = v_1;
|
||||
}
|
||||
}
|
||||
|
||||
function r_i_plural() {
|
||||
var v_1;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.find_among_b(a_8, 2)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.slice_del();
|
||||
} else
|
||||
sbp.limit_backward = v_1;
|
||||
}
|
||||
}
|
||||
|
||||
function r_t_plural() {
|
||||
var among_var, v_1, v_2, v_3, v_4, v_5;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "t")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (sbp.in_grouping_b(g_V1, 97, 246)) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.slice_del();
|
||||
sbp.limit_backward = v_1;
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
if (sbp.cursor >= I_p2) {
|
||||
sbp.cursor = I_p2;
|
||||
v_4 = sbp.limit_backward;
|
||||
sbp.limit_backward = sbp.cursor;
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_9, 2);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.limit_backward = v_4;
|
||||
if (among_var == 1) {
|
||||
v_5 = sbp.limit - sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "po"))
|
||||
return;
|
||||
sbp.cursor = sbp.limit - v_5;
|
||||
}
|
||||
sbp.slice_del();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.limit_backward = v_1;
|
||||
}
|
||||
}
|
||||
|
||||
function r_tidy() {
|
||||
var v_1, v_2, v_3, v_4;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (r_LONG()) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.in_grouping_b(g_AEI, 97, 228)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (sbp.out_grouping_b(g_V1, 97, 246))
|
||||
sbp.slice_del();
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "j")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "o")) {
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
if (sbp.eq_s_b(1, "u"))
|
||||
sbp.slice_del();
|
||||
} else
|
||||
sbp.slice_del();
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "o")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "j"))
|
||||
sbp.slice_del();
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.limit_backward = v_1;
|
||||
while (true) {
|
||||
v_4 = sbp.limit - sbp.cursor;
|
||||
if (sbp.out_grouping_b(g_V1, 97, 246)) {
|
||||
sbp.cursor = sbp.limit - v_4;
|
||||
break;
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_4;
|
||||
if (sbp.cursor <= sbp.limit_backward)
|
||||
return;
|
||||
sbp.cursor--;
|
||||
}
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
S_x = sbp.slice_to();
|
||||
if (sbp.eq_v_b(S_x))
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_mark_regions();
|
||||
B_ending_removed = false;
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
r_particle_etc();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_possessive();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_case_ending();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_other_endings();
|
||||
sbp.cursor = sbp.limit;
|
||||
if (B_ending_removed) {
|
||||
r_i_plural();
|
||||
sbp.cursor = sbp.limit;
|
||||
} else {
|
||||
sbp.cursor = sbp.limit;
|
||||
r_t_plural();
|
||||
sbp.cursor = sbp.limit;
|
||||
}
|
||||
r_tidy();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(token) {
|
||||
// for lunr version 2
|
||||
if (typeof token.update === "function") {
|
||||
return token.update(function(word) {
|
||||
st.setCurrent(word);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
})
|
||||
} else { // for lunr version <= 1
|
||||
st.setCurrent(token);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.fi.stemmer, 'stemmer-fi');
|
||||
|
||||
lunr.fi.stopWordFilter = lunr.generateStopWordFilter('ei eivät emme en et ette että he heidän heidät heihin heille heillä heiltä heissä heistä heitä hän häneen hänelle hänellä häneltä hänen hänessä hänestä hänet häntä itse ja johon joiden joihin joiksi joilla joille joilta joina joissa joista joita joka joksi jolla jolle jolta jona jonka jos jossa josta jota jotka kanssa keiden keihin keiksi keille keillä keiltä keinä keissä keistä keitä keneen keneksi kenelle kenellä keneltä kenen kenenä kenessä kenestä kenet ketkä ketkä ketä koska kuin kuka kun me meidän meidät meihin meille meillä meiltä meissä meistä meitä mihin miksi mikä mille millä miltä minkä minkä minua minulla minulle minulta minun minussa minusta minut minuun minä minä missä mistä mitkä mitä mukaan mutta ne niiden niihin niiksi niille niillä niiltä niin niin niinä niissä niistä niitä noiden noihin noiksi noilla noille noilta noin noina noissa noista noita nuo nyt näiden näihin näiksi näille näillä näiltä näinä näissä näistä näitä nämä ole olemme olen olet olette oli olimme olin olisi olisimme olisin olisit olisitte olisivat olit olitte olivat olla olleet ollut on ovat poikki se sekä sen siihen siinä siitä siksi sille sillä sillä siltä sinua sinulla sinulle sinulta sinun sinussa sinusta sinut sinuun sinä sinä sitä tai te teidän teidät teihin teille teillä teiltä teissä teistä teitä tuo tuohon tuoksi tuolla tuolle tuolta tuon tuona tuossa tuosta tuota tähän täksi tälle tällä tältä tämä tämän tänä tässä tästä tätä vaan vai vaikka yli'.split(' '));
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.fi.stopWordFilter, 'stopWordFilter-fi');
|
||||
};
|
||||
}))
|
||||
@@ -1,703 +0,0 @@
|
||||
/*!
|
||||
* Lunr languages, `French` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2014, Mihai Valentin
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.fr = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.fr.trimmer,
|
||||
lunr.fr.stopWordFilter,
|
||||
lunr.fr.stemmer
|
||||
);
|
||||
|
||||
// for lunr version 2
|
||||
// this is necessary so that every searched word is also stemmed before
|
||||
// in lunr <= 1 this is not needed, as it is done using the normal pipeline
|
||||
if (this.searchPipeline) {
|
||||
this.searchPipeline.reset();
|
||||
this.searchPipeline.add(lunr.fr.stemmer)
|
||||
}
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.fr.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
|
||||
lunr.fr.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.fr.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.fr.trimmer, 'trimmer-fr');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.fr.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function FrenchStemmer() {
|
||||
var a_0 = [new Among("col", -1, -1), new Among("par", -1, -1),
|
||||
new Among("tap", -1, -1)
|
||||
],
|
||||
a_1 = [new Among("", -1, 4),
|
||||
new Among("I", 0, 1), new Among("U", 0, 2), new Among("Y", 0, 3)
|
||||
],
|
||||
a_2 = [
|
||||
new Among("iqU", -1, 3), new Among("abl", -1, 3),
|
||||
new Among("I\u00E8r", -1, 4), new Among("i\u00E8r", -1, 4),
|
||||
new Among("eus", -1, 2), new Among("iv", -1, 1)
|
||||
],
|
||||
a_3 = [
|
||||
new Among("ic", -1, 2), new Among("abil", -1, 1),
|
||||
new Among("iv", -1, 3)
|
||||
],
|
||||
a_4 = [new Among("iqUe", -1, 1),
|
||||
new Among("atrice", -1, 2), new Among("ance", -1, 1),
|
||||
new Among("ence", -1, 5), new Among("logie", -1, 3),
|
||||
new Among("able", -1, 1), new Among("isme", -1, 1),
|
||||
new Among("euse", -1, 11), new Among("iste", -1, 1),
|
||||
new Among("ive", -1, 8), new Among("if", -1, 8),
|
||||
new Among("usion", -1, 4), new Among("ation", -1, 2),
|
||||
new Among("ution", -1, 4), new Among("ateur", -1, 2),
|
||||
new Among("iqUes", -1, 1), new Among("atrices", -1, 2),
|
||||
new Among("ances", -1, 1), new Among("ences", -1, 5),
|
||||
new Among("logies", -1, 3), new Among("ables", -1, 1),
|
||||
new Among("ismes", -1, 1), new Among("euses", -1, 11),
|
||||
new Among("istes", -1, 1), new Among("ives", -1, 8),
|
||||
new Among("ifs", -1, 8), new Among("usions", -1, 4),
|
||||
new Among("ations", -1, 2), new Among("utions", -1, 4),
|
||||
new Among("ateurs", -1, 2), new Among("ments", -1, 15),
|
||||
new Among("ements", 30, 6), new Among("issements", 31, 12),
|
||||
new Among("it\u00E9s", -1, 7), new Among("ment", -1, 15),
|
||||
new Among("ement", 34, 6), new Among("issement", 35, 12),
|
||||
new Among("amment", 34, 13), new Among("emment", 34, 14),
|
||||
new Among("aux", -1, 10), new Among("eaux", 39, 9),
|
||||
new Among("eux", -1, 1), new Among("it\u00E9", -1, 7)
|
||||
],
|
||||
a_5 = [
|
||||
new Among("ira", -1, 1), new Among("ie", -1, 1),
|
||||
new Among("isse", -1, 1), new Among("issante", -1, 1),
|
||||
new Among("i", -1, 1), new Among("irai", 4, 1),
|
||||
new Among("ir", -1, 1), new Among("iras", -1, 1),
|
||||
new Among("ies", -1, 1), new Among("\u00EEmes", -1, 1),
|
||||
new Among("isses", -1, 1), new Among("issantes", -1, 1),
|
||||
new Among("\u00EEtes", -1, 1), new Among("is", -1, 1),
|
||||
new Among("irais", 13, 1), new Among("issais", 13, 1),
|
||||
new Among("irions", -1, 1), new Among("issions", -1, 1),
|
||||
new Among("irons", -1, 1), new Among("issons", -1, 1),
|
||||
new Among("issants", -1, 1), new Among("it", -1, 1),
|
||||
new Among("irait", 21, 1), new Among("issait", 21, 1),
|
||||
new Among("issant", -1, 1), new Among("iraIent", -1, 1),
|
||||
new Among("issaIent", -1, 1), new Among("irent", -1, 1),
|
||||
new Among("issent", -1, 1), new Among("iront", -1, 1),
|
||||
new Among("\u00EEt", -1, 1), new Among("iriez", -1, 1),
|
||||
new Among("issiez", -1, 1), new Among("irez", -1, 1),
|
||||
new Among("issez", -1, 1)
|
||||
],
|
||||
a_6 = [new Among("a", -1, 3),
|
||||
new Among("era", 0, 2), new Among("asse", -1, 3),
|
||||
new Among("ante", -1, 3), new Among("\u00E9e", -1, 2),
|
||||
new Among("ai", -1, 3), new Among("erai", 5, 2),
|
||||
new Among("er", -1, 2), new Among("as", -1, 3),
|
||||
new Among("eras", 8, 2), new Among("\u00E2mes", -1, 3),
|
||||
new Among("asses", -1, 3), new Among("antes", -1, 3),
|
||||
new Among("\u00E2tes", -1, 3), new Among("\u00E9es", -1, 2),
|
||||
new Among("ais", -1, 3), new Among("erais", 15, 2),
|
||||
new Among("ions", -1, 1), new Among("erions", 17, 2),
|
||||
new Among("assions", 17, 3), new Among("erons", -1, 2),
|
||||
new Among("ants", -1, 3), new Among("\u00E9s", -1, 2),
|
||||
new Among("ait", -1, 3), new Among("erait", 23, 2),
|
||||
new Among("ant", -1, 3), new Among("aIent", -1, 3),
|
||||
new Among("eraIent", 26, 2), new Among("\u00E8rent", -1, 2),
|
||||
new Among("assent", -1, 3), new Among("eront", -1, 2),
|
||||
new Among("\u00E2t", -1, 3), new Among("ez", -1, 2),
|
||||
new Among("iez", 32, 2), new Among("eriez", 33, 2),
|
||||
new Among("assiez", 33, 3), new Among("erez", 32, 2),
|
||||
new Among("\u00E9", -1, 2)
|
||||
],
|
||||
a_7 = [new Among("e", -1, 3),
|
||||
new Among("I\u00E8re", 0, 2), new Among("i\u00E8re", 0, 2),
|
||||
new Among("ion", -1, 1), new Among("Ier", -1, 2),
|
||||
new Among("ier", -1, 2), new Among("\u00EB", -1, 4)
|
||||
],
|
||||
a_8 = [
|
||||
new Among("ell", -1, -1), new Among("eill", -1, -1),
|
||||
new Among("enn", -1, -1), new Among("onn", -1, -1),
|
||||
new Among("ett", -1, -1)
|
||||
],
|
||||
g_v = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 128, 130, 103, 8, 5
|
||||
],
|
||||
g_keep_with_s = [1, 65, 20, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
|
||||
],
|
||||
I_p2, I_p1, I_pV, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function habr1(c1, c2, v_1) {
|
||||
if (sbp.eq_s(1, c1)) {
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 251)) {
|
||||
sbp.slice_from(c2);
|
||||
sbp.cursor = v_1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function habr2(c1, c2, v_1) {
|
||||
if (sbp.eq_s(1, c1)) {
|
||||
sbp.ket = sbp.cursor;
|
||||
sbp.slice_from(c2);
|
||||
sbp.cursor = v_1;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_prelude() {
|
||||
var v_1, v_2;
|
||||
while (true) {
|
||||
v_1 = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 251)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
v_2 = sbp.cursor;
|
||||
if (habr1("u", "U", v_1))
|
||||
continue;
|
||||
sbp.cursor = v_2;
|
||||
if (habr1("i", "I", v_1))
|
||||
continue;
|
||||
sbp.cursor = v_2;
|
||||
if (habr2("y", "Y", v_1))
|
||||
continue;
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
sbp.bra = v_1;
|
||||
if (!habr1("y", "Y", v_1)) {
|
||||
sbp.cursor = v_1;
|
||||
if (sbp.eq_s(1, "q")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (habr2("u", "U", v_1))
|
||||
continue;
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
if (v_1 >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function habr3() {
|
||||
while (!sbp.in_grouping(g_v, 97, 251)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
while (!sbp.out_grouping(g_v, 97, 251)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_mark_regions() {
|
||||
var v_1 = sbp.cursor;
|
||||
I_pV = sbp.limit;
|
||||
I_p1 = I_pV;
|
||||
I_p2 = I_pV;
|
||||
if (sbp.in_grouping(g_v, 97, 251) && sbp.in_grouping(g_v, 97, 251) &&
|
||||
sbp.cursor < sbp.limit)
|
||||
sbp.cursor++;
|
||||
else {
|
||||
sbp.cursor = v_1;
|
||||
if (!sbp.find_among(a_0, 3)) {
|
||||
sbp.cursor = v_1;
|
||||
do {
|
||||
if (sbp.cursor >= sbp.limit) {
|
||||
sbp.cursor = I_pV;
|
||||
break;
|
||||
}
|
||||
sbp.cursor++;
|
||||
} while (!sbp.in_grouping(g_v, 97, 251));
|
||||
}
|
||||
}
|
||||
I_pV = sbp.cursor;
|
||||
sbp.cursor = v_1;
|
||||
if (!habr3()) {
|
||||
I_p1 = sbp.cursor;
|
||||
if (!habr3())
|
||||
I_p2 = sbp.cursor;
|
||||
}
|
||||
}
|
||||
|
||||
function r_postlude() {
|
||||
var among_var, v_1;
|
||||
while (true) {
|
||||
v_1 = sbp.cursor;
|
||||
sbp.bra = v_1;
|
||||
among_var = sbp.find_among(a_1, 4);
|
||||
if (!among_var)
|
||||
break;
|
||||
sbp.ket = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("i");
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_from("u");
|
||||
break;
|
||||
case 3:
|
||||
sbp.slice_from("y");
|
||||
break;
|
||||
case 4:
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_RV() {
|
||||
return I_pV <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_R1() {
|
||||
return I_p1 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_R2() {
|
||||
return I_p2 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_standard_suffix() {
|
||||
var among_var, v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_4, 43);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "ic")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (!r_R2())
|
||||
sbp.slice_from("iqU");
|
||||
else
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_from("log");
|
||||
break;
|
||||
case 4:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_from("u");
|
||||
break;
|
||||
case 5:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_from("ent");
|
||||
break;
|
||||
case 6:
|
||||
if (!r_RV())
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_2, 6);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (r_R2()) {
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "at")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
else if (r_R1())
|
||||
sbp.slice_from("eux");
|
||||
break;
|
||||
case 3:
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 4:
|
||||
if (r_RV())
|
||||
sbp.slice_from("i");
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_3, 3);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
else
|
||||
sbp.slice_from("abl");
|
||||
break;
|
||||
case 2:
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
else
|
||||
sbp.slice_from("iqU");
|
||||
break;
|
||||
case 3:
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "at")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2()) {
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "ic")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
else
|
||||
sbp.slice_from("iqU");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
sbp.slice_from("eau");
|
||||
break;
|
||||
case 10:
|
||||
if (!r_R1())
|
||||
return false;
|
||||
sbp.slice_from("al");
|
||||
break;
|
||||
case 11:
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
else if (!r_R1())
|
||||
return false;
|
||||
else
|
||||
sbp.slice_from("eux");
|
||||
break;
|
||||
case 12:
|
||||
if (!r_R1() || !sbp.out_grouping_b(g_v, 97, 251))
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 13:
|
||||
if (r_RV())
|
||||
sbp.slice_from("ant");
|
||||
return false;
|
||||
case 14:
|
||||
if (r_RV())
|
||||
sbp.slice_from("ent");
|
||||
return false;
|
||||
case 15:
|
||||
v_1 = sbp.limit - sbp.cursor;
|
||||
if (sbp.in_grouping_b(g_v, 97, 251) && r_RV()) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.slice_del();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_i_verb_suffix() {
|
||||
var among_var, v_1;
|
||||
if (sbp.cursor < I_pV)
|
||||
return false;
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_pV;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_5, 35);
|
||||
if (!among_var) {
|
||||
sbp.limit_backward = v_1;
|
||||
return false;
|
||||
}
|
||||
sbp.bra = sbp.cursor;
|
||||
if (among_var == 1) {
|
||||
if (!sbp.out_grouping_b(g_v, 97, 251)) {
|
||||
sbp.limit_backward = v_1;
|
||||
return false;
|
||||
}
|
||||
sbp.slice_del();
|
||||
}
|
||||
sbp.limit_backward = v_1;
|
||||
return true;
|
||||
}
|
||||
|
||||
function r_verb_suffix() {
|
||||
var among_var, v_2, v_3;
|
||||
if (sbp.cursor < I_pV)
|
||||
return false;
|
||||
v_2 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_pV;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_6, 38);
|
||||
if (!among_var) {
|
||||
sbp.limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (!r_R2()) {
|
||||
sbp.limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 3:
|
||||
sbp.slice_del();
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "e")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_del();
|
||||
} else
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
break;
|
||||
}
|
||||
sbp.limit_backward = v_2;
|
||||
return true;
|
||||
}
|
||||
|
||||
function r_residual_suffix() {
|
||||
var among_var, v_1 = sbp.limit - sbp.cursor,
|
||||
v_2, v_4, v_5;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "s")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (sbp.out_grouping_b(g_keep_with_s, 97, 232)) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.slice_del();
|
||||
} else
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
} else
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (sbp.cursor >= I_pV) {
|
||||
v_4 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_pV;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_7, 7);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (r_R2()) {
|
||||
v_5 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "s")) {
|
||||
sbp.cursor = sbp.limit - v_5;
|
||||
if (!sbp.eq_s_b(1, "t"))
|
||||
break;
|
||||
}
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_from("i");
|
||||
break;
|
||||
case 3:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 4:
|
||||
if (sbp.eq_s_b(2, "gu"))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
sbp.limit_backward = v_4;
|
||||
}
|
||||
}
|
||||
|
||||
function r_un_double() {
|
||||
var v_1 = sbp.limit - sbp.cursor;
|
||||
if (sbp.find_among_b(a_8, 5)) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_un_accent() {
|
||||
var v_1, v_2 = 1;
|
||||
while (sbp.out_grouping_b(g_v, 97, 251))
|
||||
v_2--;
|
||||
if (v_2 <= 0) {
|
||||
sbp.ket = sbp.cursor;
|
||||
v_1 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "\u00E9")) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (!sbp.eq_s_b(1, "\u00E8"))
|
||||
return;
|
||||
}
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_from("e");
|
||||
}
|
||||
}
|
||||
|
||||
function habr5() {
|
||||
if (!r_standard_suffix()) {
|
||||
sbp.cursor = sbp.limit;
|
||||
if (!r_i_verb_suffix()) {
|
||||
sbp.cursor = sbp.limit;
|
||||
if (!r_verb_suffix()) {
|
||||
sbp.cursor = sbp.limit;
|
||||
r_residual_suffix();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "Y")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_from("i");
|
||||
} else {
|
||||
sbp.cursor = sbp.limit;
|
||||
if (sbp.eq_s_b(1, "\u00E7")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_from("c");
|
||||
}
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_prelude();
|
||||
sbp.cursor = v_1;
|
||||
r_mark_regions();
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
habr5();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_un_double();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_un_accent();
|
||||
sbp.cursor = sbp.limit_backward;
|
||||
r_postlude();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(token) {
|
||||
// for lunr version 2
|
||||
if (typeof token.update === "function") {
|
||||
return token.update(function(word) {
|
||||
st.setCurrent(word);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
})
|
||||
} else { // for lunr version <= 1
|
||||
st.setCurrent(token);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.fr.stemmer, 'stemmer-fr');
|
||||
|
||||
lunr.fr.stopWordFilter = lunr.generateStopWordFilter('ai aie aient aies ait as au aura aurai auraient aurais aurait auras aurez auriez aurions aurons auront aux avaient avais avait avec avez aviez avions avons ayant ayez ayons c ce ceci celà ces cet cette d dans de des du elle en es est et eu eue eues eurent eus eusse eussent eusses eussiez eussions eut eux eûmes eût eûtes furent fus fusse fussent fusses fussiez fussions fut fûmes fût fûtes ici il ils j je l la le les leur leurs lui m ma mais me mes moi mon même n ne nos notre nous on ont ou par pas pour qu que quel quelle quelles quels qui s sa sans se sera serai seraient serais serait seras serez seriez serions serons seront ses soi soient sois soit sommes son sont soyez soyons suis sur t ta te tes toi ton tu un une vos votre vous y à étaient étais était étant étiez étions été étée étées étés êtes'.split(' '));
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.fr.stopWordFilter, 'stopWordFilter-fr');
|
||||
};
|
||||
}))
|
||||
@@ -1,565 +0,0 @@
|
||||
/*!
|
||||
* Lunr languages, `Hungarian` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2014, Mihai Valentin
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.hu = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.hu.trimmer,
|
||||
lunr.hu.stopWordFilter,
|
||||
lunr.hu.stemmer
|
||||
);
|
||||
|
||||
// for lunr version 2
|
||||
// this is necessary so that every searched word is also stemmed before
|
||||
// in lunr <= 1 this is not needed, as it is done using the normal pipeline
|
||||
if (this.searchPipeline) {
|
||||
this.searchPipeline.reset();
|
||||
this.searchPipeline.add(lunr.hu.stemmer)
|
||||
}
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.hu.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
|
||||
lunr.hu.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.hu.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.hu.trimmer, 'trimmer-hu');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.hu.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function HungarianStemmer() {
|
||||
var a_0 = [new Among("cs", -1, -1), new Among("dzs", -1, -1),
|
||||
new Among("gy", -1, -1), new Among("ly", -1, -1),
|
||||
new Among("ny", -1, -1), new Among("sz", -1, -1),
|
||||
new Among("ty", -1, -1), new Among("zs", -1, -1)
|
||||
],
|
||||
a_1 = [
|
||||
new Among("\u00E1", -1, 1), new Among("\u00E9", -1, 2)
|
||||
],
|
||||
a_2 = [
|
||||
new Among("bb", -1, -1), new Among("cc", -1, -1),
|
||||
new Among("dd", -1, -1), new Among("ff", -1, -1),
|
||||
new Among("gg", -1, -1), new Among("jj", -1, -1),
|
||||
new Among("kk", -1, -1), new Among("ll", -1, -1),
|
||||
new Among("mm", -1, -1), new Among("nn", -1, -1),
|
||||
new Among("pp", -1, -1), new Among("rr", -1, -1),
|
||||
new Among("ccs", -1, -1), new Among("ss", -1, -1),
|
||||
new Among("zzs", -1, -1), new Among("tt", -1, -1),
|
||||
new Among("vv", -1, -1), new Among("ggy", -1, -1),
|
||||
new Among("lly", -1, -1), new Among("nny", -1, -1),
|
||||
new Among("tty", -1, -1), new Among("ssz", -1, -1),
|
||||
new Among("zz", -1, -1)
|
||||
],
|
||||
a_3 = [new Among("al", -1, 1),
|
||||
new Among("el", -1, 2)
|
||||
],
|
||||
a_4 = [new Among("ba", -1, -1),
|
||||
new Among("ra", -1, -1), new Among("be", -1, -1),
|
||||
new Among("re", -1, -1), new Among("ig", -1, -1),
|
||||
new Among("nak", -1, -1), new Among("nek", -1, -1),
|
||||
new Among("val", -1, -1), new Among("vel", -1, -1),
|
||||
new Among("ul", -1, -1), new Among("n\u00E1l", -1, -1),
|
||||
new Among("n\u00E9l", -1, -1), new Among("b\u00F3l", -1, -1),
|
||||
new Among("r\u00F3l", -1, -1), new Among("t\u00F3l", -1, -1),
|
||||
new Among("b\u00F5l", -1, -1), new Among("r\u00F5l", -1, -1),
|
||||
new Among("t\u00F5l", -1, -1), new Among("\u00FCl", -1, -1),
|
||||
new Among("n", -1, -1), new Among("an", 19, -1),
|
||||
new Among("ban", 20, -1), new Among("en", 19, -1),
|
||||
new Among("ben", 22, -1), new Among("k\u00E9ppen", 22, -1),
|
||||
new Among("on", 19, -1), new Among("\u00F6n", 19, -1),
|
||||
new Among("k\u00E9pp", -1, -1), new Among("kor", -1, -1),
|
||||
new Among("t", -1, -1), new Among("at", 29, -1),
|
||||
new Among("et", 29, -1), new Among("k\u00E9nt", 29, -1),
|
||||
new Among("ank\u00E9nt", 32, -1), new Among("enk\u00E9nt", 32, -1),
|
||||
new Among("onk\u00E9nt", 32, -1), new Among("ot", 29, -1),
|
||||
new Among("\u00E9rt", 29, -1), new Among("\u00F6t", 29, -1),
|
||||
new Among("hez", -1, -1), new Among("hoz", -1, -1),
|
||||
new Among("h\u00F6z", -1, -1), new Among("v\u00E1", -1, -1),
|
||||
new Among("v\u00E9", -1, -1)
|
||||
],
|
||||
a_5 = [new Among("\u00E1n", -1, 2),
|
||||
new Among("\u00E9n", -1, 1), new Among("\u00E1nk\u00E9nt", -1, 3)
|
||||
],
|
||||
a_6 = [
|
||||
new Among("stul", -1, 2), new Among("astul", 0, 1),
|
||||
new Among("\u00E1stul", 0, 3), new Among("st\u00FCl", -1, 2),
|
||||
new Among("est\u00FCl", 3, 1), new Among("\u00E9st\u00FCl", 3, 4)
|
||||
],
|
||||
a_7 = [
|
||||
new Among("\u00E1", -1, 1), new Among("\u00E9", -1, 2)
|
||||
],
|
||||
a_8 = [
|
||||
new Among("k", -1, 7), new Among("ak", 0, 4),
|
||||
new Among("ek", 0, 6), new Among("ok", 0, 5),
|
||||
new Among("\u00E1k", 0, 1), new Among("\u00E9k", 0, 2),
|
||||
new Among("\u00F6k", 0, 3)
|
||||
],
|
||||
a_9 = [new Among("\u00E9i", -1, 7),
|
||||
new Among("\u00E1\u00E9i", 0, 6), new Among("\u00E9\u00E9i", 0, 5),
|
||||
new Among("\u00E9", -1, 9), new Among("k\u00E9", 3, 4),
|
||||
new Among("ak\u00E9", 4, 1), new Among("ek\u00E9", 4, 1),
|
||||
new Among("ok\u00E9", 4, 1), new Among("\u00E1k\u00E9", 4, 3),
|
||||
new Among("\u00E9k\u00E9", 4, 2), new Among("\u00F6k\u00E9", 4, 1),
|
||||
new Among("\u00E9\u00E9", 3, 8)
|
||||
],
|
||||
a_10 = [new Among("a", -1, 18),
|
||||
new Among("ja", 0, 17), new Among("d", -1, 16),
|
||||
new Among("ad", 2, 13), new Among("ed", 2, 13),
|
||||
new Among("od", 2, 13), new Among("\u00E1d", 2, 14),
|
||||
new Among("\u00E9d", 2, 15), new Among("\u00F6d", 2, 13),
|
||||
new Among("e", -1, 18), new Among("je", 9, 17),
|
||||
new Among("nk", -1, 4), new Among("unk", 11, 1),
|
||||
new Among("\u00E1nk", 11, 2), new Among("\u00E9nk", 11, 3),
|
||||
new Among("\u00FCnk", 11, 1), new Among("uk", -1, 8),
|
||||
new Among("juk", 16, 7), new Among("\u00E1juk", 17, 5),
|
||||
new Among("\u00FCk", -1, 8), new Among("j\u00FCk", 19, 7),
|
||||
new Among("\u00E9j\u00FCk", 20, 6), new Among("m", -1, 12),
|
||||
new Among("am", 22, 9), new Among("em", 22, 9),
|
||||
new Among("om", 22, 9), new Among("\u00E1m", 22, 10),
|
||||
new Among("\u00E9m", 22, 11), new Among("o", -1, 18),
|
||||
new Among("\u00E1", -1, 19), new Among("\u00E9", -1, 20)
|
||||
],
|
||||
a_11 = [
|
||||
new Among("id", -1, 10), new Among("aid", 0, 9),
|
||||
new Among("jaid", 1, 6), new Among("eid", 0, 9),
|
||||
new Among("jeid", 3, 6), new Among("\u00E1id", 0, 7),
|
||||
new Among("\u00E9id", 0, 8), new Among("i", -1, 15),
|
||||
new Among("ai", 7, 14), new Among("jai", 8, 11),
|
||||
new Among("ei", 7, 14), new Among("jei", 10, 11),
|
||||
new Among("\u00E1i", 7, 12), new Among("\u00E9i", 7, 13),
|
||||
new Among("itek", -1, 24), new Among("eitek", 14, 21),
|
||||
new Among("jeitek", 15, 20), new Among("\u00E9itek", 14, 23),
|
||||
new Among("ik", -1, 29), new Among("aik", 18, 26),
|
||||
new Among("jaik", 19, 25), new Among("eik", 18, 26),
|
||||
new Among("jeik", 21, 25), new Among("\u00E1ik", 18, 27),
|
||||
new Among("\u00E9ik", 18, 28), new Among("ink", -1, 20),
|
||||
new Among("aink", 25, 17), new Among("jaink", 26, 16),
|
||||
new Among("eink", 25, 17), new Among("jeink", 28, 16),
|
||||
new Among("\u00E1ink", 25, 18), new Among("\u00E9ink", 25, 19),
|
||||
new Among("aitok", -1, 21), new Among("jaitok", 32, 20),
|
||||
new Among("\u00E1itok", -1, 22), new Among("im", -1, 5),
|
||||
new Among("aim", 35, 4), new Among("jaim", 36, 1),
|
||||
new Among("eim", 35, 4), new Among("jeim", 38, 1),
|
||||
new Among("\u00E1im", 35, 2), new Among("\u00E9im", 35, 3)
|
||||
],
|
||||
g_v = [
|
||||
17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 52, 14
|
||||
],
|
||||
I_p1, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function r_mark_regions() {
|
||||
var v_1 = sbp.cursor,
|
||||
v_2;
|
||||
I_p1 = sbp.limit;
|
||||
if (sbp.in_grouping(g_v, 97, 252)) {
|
||||
while (true) {
|
||||
v_2 = sbp.cursor;
|
||||
if (sbp.out_grouping(g_v, 97, 252)) {
|
||||
sbp.cursor = v_2;
|
||||
if (!sbp.find_among(a_0, 8)) {
|
||||
sbp.cursor = v_2;
|
||||
if (v_2 < sbp.limit)
|
||||
sbp.cursor++;
|
||||
}
|
||||
I_p1 = sbp.cursor;
|
||||
return;
|
||||
}
|
||||
sbp.cursor = v_2;
|
||||
if (v_2 >= sbp.limit) {
|
||||
I_p1 = v_2;
|
||||
return;
|
||||
}
|
||||
sbp.cursor++;
|
||||
}
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
if (sbp.out_grouping(g_v, 97, 252)) {
|
||||
while (!sbp.in_grouping(g_v, 97, 252)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
}
|
||||
I_p1 = sbp.cursor;
|
||||
}
|
||||
}
|
||||
|
||||
function r_R1() {
|
||||
return I_p1 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_v_ending() {
|
||||
var among_var;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_1, 2);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("a");
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_from("e");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_double() {
|
||||
var v_1 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.find_among_b(a_2, 23))
|
||||
return false;
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
return true;
|
||||
}
|
||||
|
||||
function r_undouble() {
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.ket = sbp.cursor;
|
||||
var c = sbp.cursor - 1;
|
||||
if (sbp.limit_backward <= c && c <= sbp.limit) {
|
||||
sbp.cursor = c;
|
||||
sbp.bra = c;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_instrum() {
|
||||
var among_var;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_3, 2);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
if (among_var == 1 || among_var == 2)
|
||||
if (!r_double())
|
||||
return;
|
||||
sbp.slice_del();
|
||||
r_undouble();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_case() {
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.find_among_b(a_4, 44)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
sbp.slice_del();
|
||||
r_v_ending();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_case_special() {
|
||||
var among_var;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_5, 3);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("e");
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
sbp.slice_from("a");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_case_other() {
|
||||
var among_var;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_6, 6);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
case 2:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 3:
|
||||
sbp.slice_from("a");
|
||||
break;
|
||||
case 4:
|
||||
sbp.slice_from("e");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_factive() {
|
||||
var among_var;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_7, 2);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
if (among_var == 1 || among_var == 2)
|
||||
if (!r_double())
|
||||
return;
|
||||
sbp.slice_del();
|
||||
r_undouble()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_plural() {
|
||||
var among_var;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_8, 7);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("a");
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_from("e");
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_owned() {
|
||||
var among_var;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_9, 12);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
case 4:
|
||||
case 7:
|
||||
case 9:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
case 5:
|
||||
case 8:
|
||||
sbp.slice_from("e");
|
||||
break;
|
||||
case 3:
|
||||
case 6:
|
||||
sbp.slice_from("a");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_sing_owner() {
|
||||
var among_var;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_10, 31);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
case 4:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
case 12:
|
||||
case 13:
|
||||
case 16:
|
||||
case 17:
|
||||
case 18:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
case 5:
|
||||
case 10:
|
||||
case 14:
|
||||
case 19:
|
||||
sbp.slice_from("a");
|
||||
break;
|
||||
case 3:
|
||||
case 6:
|
||||
case 11:
|
||||
case 15:
|
||||
case 20:
|
||||
sbp.slice_from("e");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_plur_owner() {
|
||||
var among_var;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_11, 42);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
case 17:
|
||||
case 20:
|
||||
case 21:
|
||||
case 24:
|
||||
case 25:
|
||||
case 26:
|
||||
case 29:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
case 7:
|
||||
case 12:
|
||||
case 18:
|
||||
case 22:
|
||||
case 27:
|
||||
sbp.slice_from("a");
|
||||
break;
|
||||
case 3:
|
||||
case 8:
|
||||
case 13:
|
||||
case 19:
|
||||
case 23:
|
||||
case 28:
|
||||
sbp.slice_from("e");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_mark_regions();
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
r_instrum();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_case();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_case_special();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_case_other();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_factive();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_owned();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_sing_owner();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_plur_owner();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_plural();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(token) {
|
||||
// for lunr version 2
|
||||
if (typeof token.update === "function") {
|
||||
return token.update(function(word) {
|
||||
st.setCurrent(word);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
})
|
||||
} else { // for lunr version <= 1
|
||||
st.setCurrent(token);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.hu.stemmer, 'stemmer-hu');
|
||||
|
||||
lunr.hu.stopWordFilter = lunr.generateStopWordFilter('a abban ahhoz ahogy ahol aki akik akkor alatt amely amelyek amelyekben amelyeket amelyet amelynek ami amikor amit amolyan amíg annak arra arról az azok azon azonban azt aztán azután azzal azért be belül benne bár cikk cikkek cikkeket csak de e ebben eddig egy egyes egyetlen egyik egyre egyéb egész ehhez ekkor el ellen elsõ elég elõ elõször elõtt emilyen ennek erre ez ezek ezen ezt ezzel ezért fel felé hanem hiszen hogy hogyan igen ill ill. illetve ilyen ilyenkor ismét ison itt jobban jó jól kell kellett keressünk keresztül ki kívül között közül legalább legyen lehet lehetett lenne lenni lesz lett maga magát majd majd meg mellett mely melyek mert mi mikor milyen minden mindenki mindent mindig mint mintha mit mivel miért most már más másik még míg nagy nagyobb nagyon ne nekem neki nem nincs néha néhány nélkül olyan ott pedig persze rá s saját sem semmi sok sokat sokkal szemben szerint szinte számára talán tehát teljes tovább továbbá több ugyanis utolsó után utána vagy vagyis vagyok valaki valami valamint való van vannak vele vissza viszont volna volt voltak voltam voltunk által általában át én éppen és így õ õk õket össze úgy új újabb újra'.split(' '));
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.hu.stopWordFilter, 'stopWordFilter-hu');
|
||||
};
|
||||
}))
|
||||
@@ -1,617 +0,0 @@
|
||||
/*!
|
||||
* Lunr languages, `Italian` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2014, Mihai Valentin
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.it = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.it.trimmer,
|
||||
lunr.it.stopWordFilter,
|
||||
lunr.it.stemmer
|
||||
);
|
||||
|
||||
// for lunr version 2
|
||||
// this is necessary so that every searched word is also stemmed before
|
||||
// in lunr <= 1 this is not needed, as it is done using the normal pipeline
|
||||
if (this.searchPipeline) {
|
||||
this.searchPipeline.reset();
|
||||
this.searchPipeline.add(lunr.it.stemmer)
|
||||
}
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.it.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
|
||||
lunr.it.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.it.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.it.trimmer, 'trimmer-it');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.it.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function ItalianStemmer() {
|
||||
var a_0 = [new Among("", -1, 7), new Among("qu", 0, 6),
|
||||
new Among("\u00E1", 0, 1), new Among("\u00E9", 0, 2),
|
||||
new Among("\u00ED", 0, 3), new Among("\u00F3", 0, 4),
|
||||
new Among("\u00FA", 0, 5)
|
||||
],
|
||||
a_1 = [new Among("", -1, 3),
|
||||
new Among("I", 0, 1), new Among("U", 0, 2)
|
||||
],
|
||||
a_2 = [
|
||||
new Among("la", -1, -1), new Among("cela", 0, -1),
|
||||
new Among("gliela", 0, -1), new Among("mela", 0, -1),
|
||||
new Among("tela", 0, -1), new Among("vela", 0, -1),
|
||||
new Among("le", -1, -1), new Among("cele", 6, -1),
|
||||
new Among("gliele", 6, -1), new Among("mele", 6, -1),
|
||||
new Among("tele", 6, -1), new Among("vele", 6, -1),
|
||||
new Among("ne", -1, -1), new Among("cene", 12, -1),
|
||||
new Among("gliene", 12, -1), new Among("mene", 12, -1),
|
||||
new Among("sene", 12, -1), new Among("tene", 12, -1),
|
||||
new Among("vene", 12, -1), new Among("ci", -1, -1),
|
||||
new Among("li", -1, -1), new Among("celi", 20, -1),
|
||||
new Among("glieli", 20, -1), new Among("meli", 20, -1),
|
||||
new Among("teli", 20, -1), new Among("veli", 20, -1),
|
||||
new Among("gli", 20, -1), new Among("mi", -1, -1),
|
||||
new Among("si", -1, -1), new Among("ti", -1, -1),
|
||||
new Among("vi", -1, -1), new Among("lo", -1, -1),
|
||||
new Among("celo", 31, -1), new Among("glielo", 31, -1),
|
||||
new Among("melo", 31, -1), new Among("telo", 31, -1),
|
||||
new Among("velo", 31, -1)
|
||||
],
|
||||
a_3 = [new Among("ando", -1, 1),
|
||||
new Among("endo", -1, 1), new Among("ar", -1, 2),
|
||||
new Among("er", -1, 2), new Among("ir", -1, 2)
|
||||
],
|
||||
a_4 = [
|
||||
new Among("ic", -1, -1), new Among("abil", -1, -1),
|
||||
new Among("os", -1, -1), new Among("iv", -1, 1)
|
||||
],
|
||||
a_5 = [
|
||||
new Among("ic", -1, 1), new Among("abil", -1, 1),
|
||||
new Among("iv", -1, 1)
|
||||
],
|
||||
a_6 = [new Among("ica", -1, 1),
|
||||
new Among("logia", -1, 3), new Among("osa", -1, 1),
|
||||
new Among("ista", -1, 1), new Among("iva", -1, 9),
|
||||
new Among("anza", -1, 1), new Among("enza", -1, 5),
|
||||
new Among("ice", -1, 1), new Among("atrice", 7, 1),
|
||||
new Among("iche", -1, 1), new Among("logie", -1, 3),
|
||||
new Among("abile", -1, 1), new Among("ibile", -1, 1),
|
||||
new Among("usione", -1, 4), new Among("azione", -1, 2),
|
||||
new Among("uzione", -1, 4), new Among("atore", -1, 2),
|
||||
new Among("ose", -1, 1), new Among("ante", -1, 1),
|
||||
new Among("mente", -1, 1), new Among("amente", 19, 7),
|
||||
new Among("iste", -1, 1), new Among("ive", -1, 9),
|
||||
new Among("anze", -1, 1), new Among("enze", -1, 5),
|
||||
new Among("ici", -1, 1), new Among("atrici", 25, 1),
|
||||
new Among("ichi", -1, 1), new Among("abili", -1, 1),
|
||||
new Among("ibili", -1, 1), new Among("ismi", -1, 1),
|
||||
new Among("usioni", -1, 4), new Among("azioni", -1, 2),
|
||||
new Among("uzioni", -1, 4), new Among("atori", -1, 2),
|
||||
new Among("osi", -1, 1), new Among("anti", -1, 1),
|
||||
new Among("amenti", -1, 6), new Among("imenti", -1, 6),
|
||||
new Among("isti", -1, 1), new Among("ivi", -1, 9),
|
||||
new Among("ico", -1, 1), new Among("ismo", -1, 1),
|
||||
new Among("oso", -1, 1), new Among("amento", -1, 6),
|
||||
new Among("imento", -1, 6), new Among("ivo", -1, 9),
|
||||
new Among("it\u00E0", -1, 8), new Among("ist\u00E0", -1, 1),
|
||||
new Among("ist\u00E8", -1, 1), new Among("ist\u00EC", -1, 1)
|
||||
],
|
||||
a_7 = [
|
||||
new Among("isca", -1, 1), new Among("enda", -1, 1),
|
||||
new Among("ata", -1, 1), new Among("ita", -1, 1),
|
||||
new Among("uta", -1, 1), new Among("ava", -1, 1),
|
||||
new Among("eva", -1, 1), new Among("iva", -1, 1),
|
||||
new Among("erebbe", -1, 1), new Among("irebbe", -1, 1),
|
||||
new Among("isce", -1, 1), new Among("ende", -1, 1),
|
||||
new Among("are", -1, 1), new Among("ere", -1, 1),
|
||||
new Among("ire", -1, 1), new Among("asse", -1, 1),
|
||||
new Among("ate", -1, 1), new Among("avate", 16, 1),
|
||||
new Among("evate", 16, 1), new Among("ivate", 16, 1),
|
||||
new Among("ete", -1, 1), new Among("erete", 20, 1),
|
||||
new Among("irete", 20, 1), new Among("ite", -1, 1),
|
||||
new Among("ereste", -1, 1), new Among("ireste", -1, 1),
|
||||
new Among("ute", -1, 1), new Among("erai", -1, 1),
|
||||
new Among("irai", -1, 1), new Among("isci", -1, 1),
|
||||
new Among("endi", -1, 1), new Among("erei", -1, 1),
|
||||
new Among("irei", -1, 1), new Among("assi", -1, 1),
|
||||
new Among("ati", -1, 1), new Among("iti", -1, 1),
|
||||
new Among("eresti", -1, 1), new Among("iresti", -1, 1),
|
||||
new Among("uti", -1, 1), new Among("avi", -1, 1),
|
||||
new Among("evi", -1, 1), new Among("ivi", -1, 1),
|
||||
new Among("isco", -1, 1), new Among("ando", -1, 1),
|
||||
new Among("endo", -1, 1), new Among("Yamo", -1, 1),
|
||||
new Among("iamo", -1, 1), new Among("avamo", -1, 1),
|
||||
new Among("evamo", -1, 1), new Among("ivamo", -1, 1),
|
||||
new Among("eremo", -1, 1), new Among("iremo", -1, 1),
|
||||
new Among("assimo", -1, 1), new Among("ammo", -1, 1),
|
||||
new Among("emmo", -1, 1), new Among("eremmo", 54, 1),
|
||||
new Among("iremmo", 54, 1), new Among("immo", -1, 1),
|
||||
new Among("ano", -1, 1), new Among("iscano", 58, 1),
|
||||
new Among("avano", 58, 1), new Among("evano", 58, 1),
|
||||
new Among("ivano", 58, 1), new Among("eranno", -1, 1),
|
||||
new Among("iranno", -1, 1), new Among("ono", -1, 1),
|
||||
new Among("iscono", 65, 1), new Among("arono", 65, 1),
|
||||
new Among("erono", 65, 1), new Among("irono", 65, 1),
|
||||
new Among("erebbero", -1, 1), new Among("irebbero", -1, 1),
|
||||
new Among("assero", -1, 1), new Among("essero", -1, 1),
|
||||
new Among("issero", -1, 1), new Among("ato", -1, 1),
|
||||
new Among("ito", -1, 1), new Among("uto", -1, 1),
|
||||
new Among("avo", -1, 1), new Among("evo", -1, 1),
|
||||
new Among("ivo", -1, 1), new Among("ar", -1, 1),
|
||||
new Among("ir", -1, 1), new Among("er\u00E0", -1, 1),
|
||||
new Among("ir\u00E0", -1, 1), new Among("er\u00F2", -1, 1),
|
||||
new Among("ir\u00F2", -1, 1)
|
||||
],
|
||||
g_v = [17, 65, 16, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 128, 128, 8, 2, 1
|
||||
],
|
||||
g_AEIO = [17, 65, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 8, 2
|
||||
],
|
||||
g_CG = [17],
|
||||
I_p2, I_p1, I_pV, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function habr1(c1, c2, v_1) {
|
||||
if (sbp.eq_s(1, c1)) {
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 249)) {
|
||||
sbp.slice_from(c2);
|
||||
sbp.cursor = v_1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_prelude() {
|
||||
var among_var, v_1 = sbp.cursor,
|
||||
v_2, v_3, v_4;
|
||||
while (true) {
|
||||
sbp.bra = sbp.cursor;
|
||||
among_var = sbp.find_among(a_0, 7);
|
||||
if (among_var) {
|
||||
sbp.ket = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("\u00E0");
|
||||
continue;
|
||||
case 2:
|
||||
sbp.slice_from("\u00E8");
|
||||
continue;
|
||||
case 3:
|
||||
sbp.slice_from("\u00EC");
|
||||
continue;
|
||||
case 4:
|
||||
sbp.slice_from("\u00F2");
|
||||
continue;
|
||||
case 5:
|
||||
sbp.slice_from("\u00F9");
|
||||
continue;
|
||||
case 6:
|
||||
sbp.slice_from("qU");
|
||||
continue;
|
||||
case 7:
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
break;
|
||||
sbp.cursor++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
while (true) {
|
||||
v_2 = sbp.cursor;
|
||||
while (true) {
|
||||
v_3 = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 249)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
v_4 = sbp.cursor;
|
||||
if (habr1("u", "U", v_3))
|
||||
break;
|
||||
sbp.cursor = v_4;
|
||||
if (habr1("i", "I", v_3))
|
||||
break;
|
||||
}
|
||||
sbp.cursor = v_3;
|
||||
if (sbp.cursor >= sbp.limit) {
|
||||
sbp.cursor = v_2;
|
||||
return;
|
||||
}
|
||||
sbp.cursor++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function habr2(v_1) {
|
||||
sbp.cursor = v_1;
|
||||
if (!sbp.in_grouping(g_v, 97, 249))
|
||||
return false;
|
||||
while (!sbp.out_grouping(g_v, 97, 249)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return false;
|
||||
sbp.cursor++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function habr3() {
|
||||
if (sbp.in_grouping(g_v, 97, 249)) {
|
||||
var v_1 = sbp.cursor;
|
||||
if (sbp.out_grouping(g_v, 97, 249)) {
|
||||
while (!sbp.in_grouping(g_v, 97, 249)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return habr2(v_1);
|
||||
sbp.cursor++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return habr2(v_1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function habr4() {
|
||||
var v_1 = sbp.cursor,
|
||||
v_2;
|
||||
if (!habr3()) {
|
||||
sbp.cursor = v_1;
|
||||
if (!sbp.out_grouping(g_v, 97, 249))
|
||||
return;
|
||||
v_2 = sbp.cursor;
|
||||
if (sbp.out_grouping(g_v, 97, 249)) {
|
||||
while (!sbp.in_grouping(g_v, 97, 249)) {
|
||||
if (sbp.cursor >= sbp.limit) {
|
||||
sbp.cursor = v_2;
|
||||
if (sbp.in_grouping(g_v, 97, 249) &&
|
||||
sbp.cursor < sbp.limit)
|
||||
sbp.cursor++;
|
||||
return;
|
||||
}
|
||||
sbp.cursor++;
|
||||
}
|
||||
I_pV = sbp.cursor;
|
||||
return;
|
||||
}
|
||||
sbp.cursor = v_2;
|
||||
if (!sbp.in_grouping(g_v, 97, 249) || sbp.cursor >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
}
|
||||
I_pV = sbp.cursor;
|
||||
}
|
||||
|
||||
function habr5() {
|
||||
while (!sbp.in_grouping(g_v, 97, 249)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return false;
|
||||
sbp.cursor++;
|
||||
}
|
||||
while (!sbp.out_grouping(g_v, 97, 249)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return false;
|
||||
sbp.cursor++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function r_mark_regions() {
|
||||
var v_1 = sbp.cursor;
|
||||
I_pV = sbp.limit;
|
||||
I_p1 = I_pV;
|
||||
I_p2 = I_pV;
|
||||
habr4();
|
||||
sbp.cursor = v_1;
|
||||
if (habr5()) {
|
||||
I_p1 = sbp.cursor;
|
||||
if (habr5())
|
||||
I_p2 = sbp.cursor;
|
||||
}
|
||||
}
|
||||
|
||||
function r_postlude() {
|
||||
var among_var;
|
||||
while (true) {
|
||||
sbp.bra = sbp.cursor;
|
||||
among_var = sbp.find_among(a_1, 3);
|
||||
if (!among_var)
|
||||
break;
|
||||
sbp.ket = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("i");
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_from("u");
|
||||
break;
|
||||
case 3:
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_RV() {
|
||||
return I_pV <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_R1() {
|
||||
return I_p1 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_R2() {
|
||||
return I_p2 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_attached_pronoun() {
|
||||
var among_var;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.find_among_b(a_2, 37)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_3, 5);
|
||||
if (among_var && r_RV()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_from("e");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_standard_suffix() {
|
||||
var among_var;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_6, 51);
|
||||
if (!among_var)
|
||||
return false;
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "ic")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_from("log");
|
||||
break;
|
||||
case 4:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_from("u");
|
||||
break;
|
||||
case 5:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_from("ente");
|
||||
break;
|
||||
case 6:
|
||||
if (!r_RV())
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 7:
|
||||
if (!r_R1())
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_4, 4);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2()) {
|
||||
sbp.slice_del();
|
||||
if (among_var == 1) {
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "at")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_5, 3);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (among_var == 1)
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "at")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2()) {
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "ic")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function r_verb_suffix() {
|
||||
var among_var, v_1;
|
||||
if (sbp.cursor >= I_pV) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_pV;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_7, 87);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (among_var == 1)
|
||||
sbp.slice_del();
|
||||
}
|
||||
sbp.limit_backward = v_1;
|
||||
}
|
||||
}
|
||||
|
||||
function habr6() {
|
||||
var v_1 = sbp.limit - sbp.cursor;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.in_grouping_b(g_AEIO, 97, 242)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_RV()) {
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "i")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_RV()) {
|
||||
sbp.slice_del();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
}
|
||||
|
||||
function r_vowel_suffix() {
|
||||
habr6();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "h")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (sbp.in_grouping_b(g_CG, 99, 103))
|
||||
if (r_RV())
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_prelude();
|
||||
sbp.cursor = v_1;
|
||||
r_mark_regions();
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
r_attached_pronoun();
|
||||
sbp.cursor = sbp.limit;
|
||||
if (!r_standard_suffix()) {
|
||||
sbp.cursor = sbp.limit;
|
||||
r_verb_suffix();
|
||||
}
|
||||
sbp.cursor = sbp.limit;
|
||||
r_vowel_suffix();
|
||||
sbp.cursor = sbp.limit_backward;
|
||||
r_postlude();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(token) {
|
||||
// for lunr version 2
|
||||
if (typeof token.update === "function") {
|
||||
return token.update(function(word) {
|
||||
st.setCurrent(word);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
})
|
||||
} else { // for lunr version <= 1
|
||||
st.setCurrent(token);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.it.stemmer, 'stemmer-it');
|
||||
|
||||
lunr.it.stopWordFilter = lunr.generateStopWordFilter('a abbia abbiamo abbiano abbiate ad agl agli ai al all alla alle allo anche avemmo avendo avesse avessero avessi avessimo aveste avesti avete aveva avevamo avevano avevate avevi avevo avrai avranno avrebbe avrebbero avrei avremmo avremo avreste avresti avrete avrà avrò avuta avute avuti avuto c che chi ci coi col come con contro cui da dagl dagli dai dal dall dalla dalle dallo degl degli dei del dell della delle dello di dov dove e ebbe ebbero ebbi ed era erano eravamo eravate eri ero essendo faccia facciamo facciano facciate faccio facemmo facendo facesse facessero facessi facessimo faceste facesti faceva facevamo facevano facevate facevi facevo fai fanno farai faranno farebbe farebbero farei faremmo faremo fareste faresti farete farà farò fece fecero feci fosse fossero fossi fossimo foste fosti fu fui fummo furono gli ha hai hanno ho i il in io l la le lei li lo loro lui ma mi mia mie miei mio ne negl negli nei nel nell nella nelle nello noi non nostra nostre nostri nostro o per perché più quale quanta quante quanti quanto quella quelle quelli quello questa queste questi questo sarai saranno sarebbe sarebbero sarei saremmo saremo sareste saresti sarete sarà sarò se sei si sia siamo siano siate siete sono sta stai stando stanno starai staranno starebbe starebbero starei staremmo staremo stareste staresti starete starà starò stava stavamo stavano stavate stavi stavo stemmo stesse stessero stessi stessimo steste stesti stette stettero stetti stia stiamo stiano stiate sto su sua sue sugl sugli sui sul sull sulla sulle sullo suo suoi ti tra tu tua tue tuo tuoi tutti tutto un una uno vi voi vostra vostre vostri vostro è'.split(' '));
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.it.stopWordFilter, 'stopWordFilter-it');
|
||||
};
|
||||
}))
|
||||
@@ -1,188 +0,0 @@
|
||||
/*!
|
||||
* Lunr languages, `Japanese` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2014, Chad Liu
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
/*
|
||||
Japanese tokenization is trickier, since it does not
|
||||
take into account spaces.
|
||||
Since the tokenization function is represented different
|
||||
internally for each of the Lunr versions, this had to be done
|
||||
in order to try to try to pick the best way of doing this based
|
||||
on the Lunr version
|
||||
*/
|
||||
var isLunr2 = lunr.version[0] == "2";
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.ja = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.ja.trimmer,
|
||||
lunr.ja.stopWordFilter,
|
||||
lunr.ja.stemmer
|
||||
);
|
||||
|
||||
// change the tokenizer for japanese one
|
||||
if (isLunr2) { // for lunr version 2.0.0
|
||||
this.tokenizer = lunr.ja.tokenizer;
|
||||
} else {
|
||||
if (lunr.tokenizer) { // for lunr version 0.6.0
|
||||
lunr.tokenizer = lunr.ja.tokenizer;
|
||||
}
|
||||
if (this.tokenizerFn) { // for lunr version 0.7.0 -> 1.0.0
|
||||
this.tokenizerFn = lunr.ja.tokenizer;
|
||||
}
|
||||
}
|
||||
};
|
||||
var segmenter = new lunr.TinySegmenter(); // インスタンス生成
|
||||
|
||||
lunr.ja.tokenizer = function(obj) {
|
||||
var i;
|
||||
var str;
|
||||
var len;
|
||||
var segs;
|
||||
var tokens;
|
||||
var char;
|
||||
var sliceLength;
|
||||
var sliceStart;
|
||||
var sliceEnd;
|
||||
var segStart;
|
||||
|
||||
if (!arguments.length || obj == null || obj == undefined)
|
||||
return [];
|
||||
|
||||
if (Array.isArray(obj)) {
|
||||
return obj.map(
|
||||
function(t) {
|
||||
return isLunr2 ? new lunr.Token(t.toLowerCase()) : t.toLowerCase();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
str = obj.toString().toLowerCase().replace(/^\s+/, '');
|
||||
for (i = str.length - 1; i >= 0; i--) {
|
||||
if (/\S/.test(str.charAt(i))) {
|
||||
str = str.substring(0, i + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tokens = [];
|
||||
len = str.length;
|
||||
for (sliceEnd = 0, sliceStart = 0; sliceEnd <= len; sliceEnd++) {
|
||||
char = str.charAt(sliceEnd);
|
||||
sliceLength = sliceEnd - sliceStart;
|
||||
|
||||
if ((char.match(/\s/) || sliceEnd == len)) {
|
||||
if (sliceLength > 0) {
|
||||
segs = segmenter.segment(str.slice(sliceStart, sliceEnd)).filter(
|
||||
function(token) {
|
||||
return !!token;
|
||||
}
|
||||
);
|
||||
|
||||
segStart = sliceStart;
|
||||
for (i = 0; i < segs.length; i++) {
|
||||
if (isLunr2) {
|
||||
tokens.push(
|
||||
new lunr.Token(
|
||||
segs[i], {
|
||||
position: [segStart, segs[i].length],
|
||||
index: tokens.length
|
||||
}
|
||||
)
|
||||
);
|
||||
} else {
|
||||
tokens.push(segs[i]);
|
||||
}
|
||||
segStart += segs[i].length;
|
||||
}
|
||||
}
|
||||
|
||||
sliceStart = sliceEnd + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return tokens;
|
||||
}
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.ja.stemmer = (function() {
|
||||
|
||||
/* TODO japanese stemmer */
|
||||
return function(word) {
|
||||
return word;
|
||||
}
|
||||
})();
|
||||
lunr.Pipeline.registerFunction(lunr.ja.stemmer, 'stemmer-ja');
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.ja.wordCharacters = "一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Za-zA-Z0-90-9";
|
||||
lunr.ja.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.ja.wordCharacters);
|
||||
lunr.Pipeline.registerFunction(lunr.ja.trimmer, 'trimmer-ja');
|
||||
|
||||
/* lunr stop word filter. see http://www.ranks.nl/stopwords/japanese */
|
||||
lunr.ja.stopWordFilter = lunr.generateStopWordFilter(
|
||||
'これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし'.split(' '));
|
||||
lunr.Pipeline.registerFunction(lunr.ja.stopWordFilter, 'stopWordFilter-ja');
|
||||
|
||||
// alias ja => jp for backward-compatibility.
|
||||
// jp is the country code, while ja is the language code
|
||||
// a new lunr.ja.js has been created, but in order to
|
||||
// keep the backward compatibility, we'll leave the lunr.jp.js
|
||||
// here for a while, and just make it use the new lunr.ja.js
|
||||
lunr.jp = lunr.ja;
|
||||
lunr.Pipeline.registerFunction(lunr.jp.stemmer, 'stemmer-jp');
|
||||
lunr.Pipeline.registerFunction(lunr.jp.trimmer, 'trimmer-jp');
|
||||
lunr.Pipeline.registerFunction(lunr.jp.stopWordFilter, 'stopWordFilter-jp');
|
||||
};
|
||||
}))
|
||||