mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2025-01-29 19:07:30 +01:00
Fixed Asian search after lunr-languages upgrade
This commit is contained in:
parent
4ab23ffdc4
commit
9a16b9c6ea
@ -451,7 +451,7 @@ At the time of writing, the following languages are supported:
|
||||
<td><code>it</code> / Italian</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>jp</code> / Japanese</td>
|
||||
<td><code>ja</code> / Japanese</td>
|
||||
<td><code>no</code> / Norwegian</td>
|
||||
<td><code>pt</code> / Portugese</td>
|
||||
<td><code>ro</code> / Romanian</td>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
material/assets/javascripts/lunr/lunr.ja.js
Normal file
1
material/assets/javascripts/lunr/lunr.ja.js
Normal file
@ -0,0 +1 @@
|
||||
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(m){if(void 0===m)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===m.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var l="2"==m.version[0];m.ja=function(){this.pipeline.reset(),this.pipeline.add(m.ja.trimmer,m.ja.stopWordFilter,m.ja.stemmer),l?this.tokenizer=m.ja.tokenizer:(m.tokenizer&&(m.tokenizer=m.ja.tokenizer),this.tokenizerFn&&(this.tokenizerFn=m.ja.tokenizer))};var j=new m.TinySegmenter;m.ja.tokenizer=function(e){var r,t,i,n,o,s,p,a,u;if(!arguments.length||null==e||null==e)return[];if(Array.isArray(e))return e.map(function(e){return l?new m.Token(e.toLowerCase()):e.toLowerCase()});for(r=(t=e.toString().toLowerCase().replace(/^\s+/,"")).length-1;0<=r;r--)if(/\S/.test(t.charAt(r))){t=t.substring(0,r+1);break}for(o=[],i=t.length,p=a=0;a<=i;a++)if(s=a-p,t.charAt(a).match(/\s/)||a==i){if(0<s)for(n=j.segment(t.slice(p,a)).filter(function(e){return!!e}),u=p,r=0;r<n.length;r++)l?o.push(new m.Token(n[r],{position:[u,n[r].length],index:o.length})):o.push(n[r]),u+=n[r].length;p=a+1}return o},m.ja.stemmer=function(e){return e},m.Pipeline.registerFunction(m.ja.stemmer,"stemmer-ja"),m.ja.wordCharacters="一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Za-zA-Z0-90-9",m.ja.trimmer=m.trimmerSupport.generateTrimmer(m.ja.wordCharacters),m.Pipeline.registerFunction(m.ja.trimmer,"trimmer-ja"),m.ja.stopWordFilter=m.generateStopWordFilter("これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし".split(" ")),m.Pipeline.registerFunction(m.ja.stopWordFilter,"stopWordFilter-ja"),m.jp=m.ja,m.Pipeline.registerFunction(m.jp.stemmer,"stemmer-jp"),m.Pipeline.registerFunction(m.jp.trimmer,"trimmer-jp"),m.Pipeline.registerFunction(m.jp.stopWordFilter,"stopWordFilter-jp")}});
|
@ -1 +1 @@
|
||||
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(n){if(void 0===n)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===n.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var i="2"==n.version[0];n.jp=function(){this.pipeline.reset(),this.pipeline.add(n.jp.stopWordFilter,n.jp.stemmer),i?this.tokenizer=n.jp.tokenizer:(n.tokenizer&&(n.tokenizer=n.jp.tokenizer),this.tokenizerFn&&(this.tokenizerFn=n.jp.tokenizer))};var o=new n.TinySegmenter;n.jp.tokenizer=function(e){if(!arguments.length||null==e||null==e)return[];if(Array.isArray(e))return e.map(function(e){return i?new n.Token(e.toLowerCase()):e.toLowerCase()});for(var r=e.toString().toLowerCase().replace(/^\s+/,""),t=r.length-1;0<=t;t--)if(/\S/.test(r.charAt(t))){r=r.substring(0,t+1);break}return o.segment(r).filter(function(e){return!!e}).map(function(e){return i?new n.Token(e):e})},n.jp.stemmer=function(e){return e},n.Pipeline.registerFunction(n.jp.stemmer,"stemmer-jp"),n.jp.wordCharacters="一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Za-zA-Z0-90-9",n.jp.stopWordFilter=function(e){if(-1===n.jp.stopWordFilter.stopWords.indexOf(i?e.toString():e))return e},n.jp.stopWordFilter=n.generateStopWordFilter("これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし".split(" ")),n.Pipeline.registerFunction(n.jp.stopWordFilter,"stopWordFilter-jp")}});
|
||||
module.exports=require("./lunr.ja");
|
1
material/assets/javascripts/lunr/lunr.nl.js
Normal file
1
material/assets/javascripts/lunr/lunr.nl.js
Normal file
File diff suppressed because one or more lines are too long
1
material/assets/javascripts/lunr/lunr.th.js
Normal file
1
material/assets/javascripts/lunr/lunr.th.js
Normal file
@ -0,0 +1 @@
|
||||
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(t){if(void 0===t)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===t.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var i="2"==t.version[0];t.th=function(){this.pipeline.reset(),this.pipeline.add(t.th.trimmer),i?this.tokenizer=t.th.tokenizer:(t.tokenizer&&(t.tokenizer=t.th.tokenizer),this.tokenizerFn&&(this.tokenizerFn=t.th.tokenizer))},t.th.wordCharacters="[-]",t.th.trimmer=t.trimmerSupport.generateTrimmer(t.th.wordCharacters),t.Pipeline.registerFunction(t.th.trimmer,"trimmer-th");var n=t.wordcut;n.init(),t.th.tokenizer=function(e){if(!arguments.length||null==e||null==e)return[];if(Array.isArray(e))return e.map(function(e){return i?new t.Token(e):e});var r=e.toString().replace(/^\s+/,"");return n.cut(r).split("|")}}});
|
1
material/assets/javascripts/lunr/wordcut.js
Normal file
1
material/assets/javascripts/lunr/wordcut.js
Normal file
File diff suppressed because one or more lines are too long
@ -190,7 +190,7 @@
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% block scripts %}
|
||||
<script src="{{ 'assets/javascripts/application.955ddd4c.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/application.a1129ccd.js' | url }}"></script>
|
||||
{% if lang.t("search.language") != "en" %}
|
||||
{% set languages = lang.t("search.language").split(",") %}
|
||||
{% if languages | length and languages[0] != "" %}
|
||||
@ -198,10 +198,10 @@
|
||||
<script src="{{ (path ~ 'lunr.stemmer.support.js') | url }}"></script>
|
||||
{% for language in languages | map("trim") %}
|
||||
{% if language != "en" %}
|
||||
{% if language == "jp" %}
|
||||
{% if language == "ja" %}
|
||||
<script src="{{ (path ~ 'tinyseg.js') | url }}"></script>
|
||||
{% endif %}
|
||||
{% if language in ("da", "de", "du", "es", "fi", "fr", "hu", "it", "jp", "no", "pt", "ro", "ru", "sv", "tr") %}
|
||||
{% if language in ("da", "de", "es", "fi", "fr", "hu", "it", "ja", "nl", "no", "pt", "ro", "ru", "sv", "th", "tr") %}
|
||||
<script src="{{ (path ~ 'lunr.' ~ language ~ '.js') | url }}"></script>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
@ -7,7 +7,7 @@
|
||||
"footer.next": "次",
|
||||
"meta.comments": "コメント",
|
||||
"meta.source": "ソース",
|
||||
"search.language": "jp",
|
||||
"search.language": "ja",
|
||||
"search.placeholder": "検索",
|
||||
"search.result.placeholder": "検索キーワードを入力してください",
|
||||
"search.result.none": "何も見つかりませんでした",
|
||||
|
@ -7,7 +7,7 @@
|
||||
"footer.next": "다음",
|
||||
"meta.comments": "댓글",
|
||||
"meta.source": "출처",
|
||||
"search.language": "jp",
|
||||
"search.language": "ja",
|
||||
"search.placeholder": "검색",
|
||||
"search.result.placeholder": "검색어를 입력하세요",
|
||||
"search.result.none": "검색어와 일치하는 문서가 없습니다",
|
||||
|
@ -7,7 +7,7 @@
|
||||
"footer.next": "Volgende",
|
||||
"meta.comments": "Reacties",
|
||||
"meta.source": "Bron",
|
||||
"search.language": "du",
|
||||
"search.language": "nl",
|
||||
"search.placeholder": "Zoeken",
|
||||
"search.result.placeholder": "Typ om te beginnen met zoeken",
|
||||
"search.result.none": "Geen overeenkomende documenten",
|
||||
|
@ -7,7 +7,7 @@
|
||||
"footer.next": "下一頁",
|
||||
"meta.comments": "評論",
|
||||
"meta.source": "來源",
|
||||
"search.language": "jp",
|
||||
"search.language": "ja",
|
||||
"search.placeholder": "搜尋",
|
||||
"search.result.placeholder": "鍵入以開始檢索",
|
||||
"search.result.none": "沒有找到符合條件的結果",
|
||||
|
@ -7,7 +7,7 @@
|
||||
"footer.next": "下一頁",
|
||||
"meta.comments": "留言",
|
||||
"meta.source": "來源",
|
||||
"search.language": "jp",
|
||||
"search.language": "ja",
|
||||
"search.placeholder": "搜尋",
|
||||
"search.result.placeholder": "打字進行搜尋",
|
||||
"search.result.none": "沒有符合的項目",
|
||||
|
@ -7,7 +7,7 @@
|
||||
"footer.next": "前进",
|
||||
"meta.comments": "评论",
|
||||
"meta.source": "来源",
|
||||
"search.language": "jp",
|
||||
"search.language": "ja",
|
||||
"search.placeholder": "搜索",
|
||||
"search.result.placeholder": "键入以开始搜索",
|
||||
"search.result.none": "没有找到符合条件的结果",
|
||||
|
@ -357,7 +357,7 @@
|
||||
<script src="{{ (path ~ 'lunr.stemmer.support.js') | url }}"></script>
|
||||
{% for language in languages | map("trim") %}
|
||||
{% if language != "en" %}
|
||||
{% if language == "jp" %}
|
||||
{% if language == "ja" %}
|
||||
<script src="{{ (path ~ 'tinyseg.js') | url }}"></script>
|
||||
{% endif %}
|
||||
{% if language in ($md-lunr-languages$) %}
|
||||
|
@ -30,7 +30,7 @@
|
||||
"footer.next": "次",
|
||||
"meta.comments": "コメント",
|
||||
"meta.source": "ソース",
|
||||
"search.language": "jp",
|
||||
"search.language": "ja",
|
||||
"search.placeholder": "検索",
|
||||
"search.result.placeholder": "検索キーワードを入力してください",
|
||||
"search.result.none": "何も見つかりませんでした",
|
||||
|
@ -30,7 +30,7 @@
|
||||
"footer.next": "다음",
|
||||
"meta.comments": "댓글",
|
||||
"meta.source": "출처",
|
||||
"search.language": "jp",
|
||||
"search.language": "ja",
|
||||
"search.placeholder": "검색",
|
||||
"search.result.placeholder": "검색어를 입력하세요",
|
||||
"search.result.none": "검색어와 일치하는 문서가 없습니다",
|
||||
|
@ -30,7 +30,7 @@
|
||||
"footer.next": "Volgende",
|
||||
"meta.comments": "Reacties",
|
||||
"meta.source": "Bron",
|
||||
"search.language": "du",
|
||||
"search.language": "nl",
|
||||
"search.placeholder": "Zoeken",
|
||||
"search.result.placeholder": "Typ om te beginnen met zoeken",
|
||||
"search.result.none": "Geen overeenkomende documenten",
|
||||
|
@ -30,7 +30,7 @@
|
||||
"footer.next": "下一頁",
|
||||
"meta.comments": "評論",
|
||||
"meta.source": "來源",
|
||||
"search.language": "jp",
|
||||
"search.language": "ja",
|
||||
"search.placeholder": "搜尋",
|
||||
"search.result.placeholder": "鍵入以開始檢索",
|
||||
"search.result.none": "沒有找到符合條件的結果",
|
||||
|
@ -30,7 +30,7 @@
|
||||
"footer.next": "下一頁",
|
||||
"meta.comments": "留言",
|
||||
"meta.source": "來源",
|
||||
"search.language": "jp",
|
||||
"search.language": "ja",
|
||||
"search.placeholder": "搜尋",
|
||||
"search.result.placeholder": "打字進行搜尋",
|
||||
"search.result.none": "沒有符合的項目",
|
||||
|
@ -30,7 +30,7 @@
|
||||
"footer.next": "前进",
|
||||
"meta.comments": "评论",
|
||||
"meta.source": "来源",
|
||||
"search.language": "jp",
|
||||
"search.language": "ja",
|
||||
"search.placeholder": "搜索",
|
||||
"search.result.placeholder": "键入以开始搜索",
|
||||
"search.result.none": "没有找到符合条件的结果",
|
||||
|
@ -224,7 +224,8 @@ module.exports = (_env, args) => { // eslint-disable-line complexity
|
||||
const matches = file.match(/lunr.(\w{2}).js$/)
|
||||
if (matches) {
|
||||
const [, language] = matches
|
||||
files.push(`"${language}"`)
|
||||
if (!["du", "jp"].includes(language))
|
||||
files.push(`"${language}"`)
|
||||
}
|
||||
return files
|
||||
}, [])
|
||||
|
Loading…
x
Reference in New Issue
Block a user