use maintained theme

This commit is contained in:
Christoph Cullmann 2021-02-18 22:21:36 +01:00
parent 640572ecab
commit 0c7cb4486a
1779 changed files with 41468 additions and 26258 deletions

View file

@ -0,0 +1,55 @@
html {
font-family: $global-font-family;
font-weight: $global-font-weight;
font-display: swap;
font-size: $global-font-size;
line-height: $global-line-height;
width: 100%;
}
/* scrollbar, only support webkit */
::-webkit-scrollbar {
width: 0.5rem;
height: 0.5rem;
}
::-webkit-scrollbar-thumb {
background-color: $scrollbar-color;
&:hover {
background-color: $scrollbar-hover-color;
}
}
::selection {
background-color: $selection-color;
[theme="dark"] & {
background-color: $selection-color-dark;
}
}
body {
background-color: $global-background-color;
color: $global-font-color;
@include overflow-wrap(break-word);
scrollbar-color: auto;
&[theme="dark"] {
color: $global-font-color-dark;
background-color: $global-background-color-dark;
}
}
@include ms;
@include link(true, true);
@import "../_partial/mask";
@import "../_partial/icon";
@import "../_partial/details";
@import "../_partial/fixed-button";
@import "../_partial/cookieconsent";
img {
@include object-fit(contain);
}

View file

@ -0,0 +1,15 @@
/** Layout **/
.wrapper {
display: flex;
flex-direction: column;
min-height: 100vh;
width: 100%;
main {
flex: 1 0 auto;
.container {
padding: 0 1rem;
}
}
}

View file

@ -0,0 +1,80 @@
@media only screen and (max-width: 1440px) {
.page {
width: 56%;
}
}
@media only screen and (max-width: 1200px) {
.page {
width: 52%;
}
#header-desktop .header-wrapper {
padding-right: 1rem;
}
.search-dropdown.desktop {
right: 1rem;
}
}
@media only screen and (max-width: 960px) {
#toc-auto {
display: none;
}
#toc-static {
display: block;
}
.page {
width: 80%;
}
#header-desktop .header-wrapper {
padding-left: 1rem;
}
}
@media only screen and (max-width: 680px) {
#header-desktop {
display: none;
}
#header-mobile {
display: block;
}
body.blur {
overflow: hidden;
}
.page {
width: 100%;
[header-mobile] & {
padding-top: $header-height;
}
[header-mobile="normal"] & {
padding-top: 0;
}
.categories-card {
.card-item {
width: 100%;
}
}
}
.copyright {
.copyright-line {
.icp-splitter {
display: none;
}
.icp-br {
display: block;
}
}
}
}

View file

@ -0,0 +1,4 @@
// ==============================
// Custom style
// 自定义样式
// ==============================

View file

@ -0,0 +1,5 @@
@mixin blur {
.blur & {
@include filter(blur(1.5px));
}
}

View file

@ -0,0 +1,110 @@
@mixin border-radius($value) {
-webkit-border-radius: $value;
-moz-border-radius: $value;
border-radius: $value;
}
@mixin box-shadow($values...) {
-webkit-box-shadow: $values;
box-shadow: $values;
}
@mixin transition($values...) {
-webkit-transition: $values;
-moz-transition: $values;
-o-transition: $values;
transition: $values;
}
@mixin transform($value) {
-webkit-transform: $value;
-moz-transform: $value;
-ms-transform: $value;
-o-transform: $value;
transform: $value;
}
@mixin filter($value) {
-webkit-filter: $value;
-moz-filter: $value;
-ms-filter: $value;
filter: $value;
}
@mixin flex($value) {
-webkit-flex: $value;
flex: $value;
}
@mixin box($orient) {
display: -moz-box;
display: -webkit-box;
display: box;
-webkit-box-orient: $orient;
-moz-box-orient: $orient;
box-orient: $orient;
}
@mixin placeholder($color) {
input::-webkit-input-placeholder {
color: $color;
}
input:-moz-placeholder {
color: $color;
}
input::-moz-placeholder {
color: $color;
}
input:-ms-input-placeholder {
color: $color;
}
input::placeholder {
color: $color;
}
}
@mixin max-content($property) {
#{$property}: -webkit-max-content;
#{$property}: -moz-max-content;
#{$property}: intrinsic;
#{$property}: max-content;
}
@mixin tab-size($value) {
-moz-tab-size: $value;
-o-tab-size: $value;
tab-size: $value;
}
@mixin appearance($value) {
-moz-appearance: $value;
-webkit-appearance: $value;
}
@mixin overflow-wrap($value) {
word-wrap: $value;
overflow-wrap: $value;
}
@mixin line-break($value) {
-webkit-line-break: $value;
-ms-line-break: $value;
line-break: $value;
}
@mixin ms {
input::-ms-clear {
display: none;
}
}
@mixin object-fit($value) {
-o-object-fit: $value;
object-fit: $value;
font-family: "object-fit: #{$value};";
}

View file

@ -0,0 +1,7 @@
@mixin details-transition-open {
@include transition(max-height 0.8s cubic-bezier(0, 1, 0, 1) -0.1s);
}
@mixin details-transition-close {
@include transition(max-height 0.8s cubic-bezier(0.5, 0, 1, 0) 0s);
}

View file

@ -0,0 +1,4 @@
@import "_compatibility";
@import "_link";
@import "_blur";
@import "_details";

View file

@ -0,0 +1,26 @@
@mixin link($light, $dark) {
a,
a::before,
a::after {
text-decoration: none;
color: if($light, $global-link-color, $single-link-color);
[theme="dark"] & {
color: if($dark, $global-link-color-dark, $single-link-color-dark);
}
}
a:active,
a:hover {
color: if($light, $global-link-hover-color, $single-link-hover-color);
[theme="dark"] & {
color: if(
$dark,
$global-link-hover-color-dark,
$single-link-hover-color-dark
);
}
}
}

View file

@ -0,0 +1,4 @@
// ==============================
// Override Variables
// 覆盖变量
// ==============================

View file

@ -0,0 +1,6 @@
#content-404 {
font-size: 1.8rem;
line-height: 3rem;
@include transform(translateY(30vh));
text-align: center;
}

View file

@ -0,0 +1,13 @@
.archive {
.single-title {
text-align: right;
}
.group-title {
margin-top: 1.5rem;
margin-bottom: 1rem;
}
@import "../_partial/_archive/terms";
@import "../_partial/_archive/tags";
}

View file

@ -0,0 +1,183 @@
.home {
.home-profile {
@include transform(translateY(16vh));
padding: 0 0 0.5rem;
text-align: center;
.home-avatar {
padding: 0.5rem;
img {
display: inline-block;
width: 8rem;
height: auto;
margin: 0 auto;
@include border-radius(100%);
@include box-shadow(0 0 0 0.3618em rgba(0, 0, 0, 0.05));
@include transition(all 0.4s ease);
&:hover {
position: relative;
@include transform(translateY(-0.75rem));
}
}
}
.home-title {
font-size: 1.25rem;
font-weight: bold;
margin: 0;
padding: 0.5rem;
}
.home-subtitle {
font-size: 1rem;
font-weight: normal;
margin: 0;
padding: 0.5rem;
}
.links {
padding: 0.5rem;
font-size: 1.5rem;
a * {
vertical-align: text-bottom;
}
img {
height: 1.5rem;
padding: 0 0.25rem;
}
}
.home-disclaimer {
font-size: 1rem;
line-height: 1.5rem;
font-weight: normal;
margin: 0;
padding: 0.5rem;
color: $global-font-secondary-color;
[theme="dark"] & {
color: $global-font-secondary-color-dark;
}
}
}
}
.home[posts] {
.home-profile {
@include transform(translateY(0));
padding-top: 2rem;
}
.home-avatar img {
width: 6rem;
}
.summary {
padding-top: 1rem;
padding-bottom: 0.8rem;
color: $global-font-color;
border-bottom: 1px dashed $global-border-color;
[theme="dark"] & {
color: $global-font-color-dark;
border-bottom: 1px dashed $global-border-color-dark;
}
.featured-image-preview {
width: 100%;
padding: 30% 0 0;
position: relative;
margin: 0.6rem auto;
@include transition(transform 0.4s ease);
img {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
@include object-fit(none);
}
img.lazyloaded {
@include object-fit(cover);
}
&:hover {
@include transform(scale(1.01));
}
}
.single-title {
font-size: 1.25rem;
line-height: 140%;
margin: 0.4rem 0;
}
.content {
@include box(vertical);
-webkit-line-clamp: 3;
margin-top: 0.3rem;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
@include overflow-wrap(break-word);
color: $global-font-secondary-color;
[theme="dark"] & {
color: $global-font-secondary-color-dark;
}
h2,
h3,
h4,
h5,
h6,
p {
font-size: 1rem;
line-height: 1.5;
display: inline;
&::after {
content: "\A";
white-space: pre;
}
}
h2 {
font-size: 1.125rem;
}
@include link(false, true);
b,
strong {
color: $global-font-secondary-color;
[theme="dark"] & {
color: $global-font-secondary-color-dark;
}
}
}
.post-footer {
margin-top: 0.4rem;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.875rem;
@include link(false, false);
.post-tags {
padding: 0;
@include link(true, true);
}
}
}
}

View file

@ -0,0 +1,22 @@
.page {
position: relative;
max-width: 800px;
width: 60%;
margin: 0 auto;
[header-desktop] & {
padding-top: $header-height;
}
[header-desktop="normal"] & {
padding-top: 0;
}
@include blur;
}
@import "_single";
@import "_special";
@import "_archive";
@import "_home";
@import "_404";

View file

@ -0,0 +1,336 @@
@import "../_partial/_single/toc";
.single {
.single-title {
margin: 1rem 0 0.5rem;
font-size: 1.6rem;
font-weight: bold;
line-height: 140%;
}
.single-subtitle {
margin: 0.4rem 0;
font-size: 1.2rem;
font-weight: normal;
font-style: italic;
line-height: 100%;
}
.post-meta {
font-size: 0.875rem;
color: $global-font-secondary-color;
span {
display: inline-block;
}
[theme="dark"] & {
color: $global-font-secondary-color-dark;
}
@include link(false, true);
.author {
font-size: 1.05rem;
}
}
.featured-image {
margin: 0.5rem 0 1rem 0;
img {
display: block;
max-width: 100%;
height: auto;
margin: 0 auto;
overflow: hidden;
}
img.lazyloaded {
width: 100%;
}
}
.content {
> h2 {
font-size: 1.5rem;
& code {
font-size: 1.25rem;
}
}
> h3 {
font-size: 1.375rem;
& code {
font-size: 1.125rem;
}
}
> h4 {
font-size: 1.25rem;
& code {
font-size: 1rem;
}
}
> h5 {
font-size: 1.125rem;
}
> h6 {
font-size: 1rem;
}
h2,
h3,
h4,
h5,
h6 {
font-weight: bold;
margin: 1.2rem 0;
[theme="dark"] & {
font-weight: bolder;
}
}
> h2,
> h3,
> h4,
> h5,
> h6 {
> .header-mark::before {
content: "|";
margin-right: 0.3125rem;
color: $single-link-color;
[theme="dark"] & {
color: $single-link-color-dark;
}
}
}
> h2 > .header-mark::before {
content: "#";
}
p {
margin: 0.5rem 0;
}
b,
strong {
font-weight: bold;
[theme="dark"] & {
color: #ddd;
}
}
@include link(false, false);
a {
@include overflow-wrap(break-word);
[theme="dark"] & b,
[theme="dark"] & strong {
color: $single-link-color-dark;
}
}
[theme="dark"] a:hover b,
[theme="dark"] a:hover strong {
color: $single-link-hover-color-dark;
}
ul,
ol {
margin: 0.5rem 0;
padding-left: 2.5rem;
}
ul {
list-style-type: disc;
}
ruby {
background: $code-background-color;
rt {
color: $global-font-secondary-color;
}
[theme="dark"] & {
background: $code-background-color-dark;
rt {
color: $global-font-secondary-color-dark;
}
}
}
.table-wrapper {
overflow-x: auto;
&::-webkit-scrollbar {
background-color: $table-background-color;
[theme="dark"] & {
background-color: $table-background-color-dark;
}
}
> table {
width: 100%;
max-width: 100%;
margin: 0.625rem 0;
border-spacing: 0;
background: $table-background-color;
border-collapse: collapse;
[theme="dark"] & {
background: $table-background-color-dark;
}
thead {
background: $table-thead-color;
[theme="dark"] & {
background-color: $table-thead-color-dark;
}
}
th,
td {
padding: 0.3rem 1rem;
border: 1px solid darken($table-thead-color, 2%);
[theme="dark"] & {
border-color: darken($table-thead-color-dark, 2%);
}
}
}
}
img {
max-width: 100%;
min-height: 1em;
}
figure {
margin: 0.5rem;
text-align: center;
.image-caption:not(:empty) {
min-width: 20%;
max-width: 80%;
display: inline-block;
padding: 0.5rem;
margin: 0 auto;
font-size: 0.875rem;
color: #969696;
}
img {
display: block;
height: auto;
margin: 0 auto;
overflow: hidden;
}
}
.lazyloading {
@include object-fit(none);
}
blockquote {
display: block;
border-left: 0.5rem solid $blockquote-color;
background-color: rgba($blockquote-color, 0.2);
padding: 0.25rem 0.75rem;
margin: 1rem 0;
[theme="dark"] & {
border-left-color: $blockquote-color-dark;
background-color: rgba($blockquote-color-dark, 0.2);
}
}
.footnotes {
color: $global-font-secondary-color;
[theme="dark"] & {
color: $global-font-secondary-color-dark;
}
p {
margin: 0.25rem 0;
}
}
@import "../_partial/_single/code";
@import "../_partial/_single/instagram";
@import "../_partial/_single/admonition";
@import "../_partial/_single/echarts";
@import "../_partial/_single/mapbox";
@import "../_partial/_single/music";
@import "../_partial/_single/bilibili";
hr {
margin: 1rem 0;
position: relative;
border-top: 1px dashed $global-border-color;
border-bottom: none;
[theme="dark"] & {
border-top: 1px dashed $global-border-color-dark;
}
}
kbd {
display: inline-block;
padding: 0.25rem;
background-color: $global-background-color;
border: 1px solid $global-border-color;
border-bottom-color: $global-border-color;
@include border-radius(3px);
@include box-shadow(inset 0 -1px 0 $global-border-color);
font-size: 0.8rem;
font-family: $code-font-family;
color: $code-color;
[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;
}
}
.typeit {
.code {
padding: 0.375rem;
font-size: 0.875rem;
font-family: $code-font-family;
font-weight: bold;
word-break: break-all;
}
}
.version {
height: 1.25em;
vertical-align: text-bottom;
}
}
@import "../_partial/_single/footer";
@import "../_partial/_single/comment";
}
.lg-toolbar .lg-icon::after {
color: #999;
}

View file

@ -0,0 +1,6 @@
.special {
.single-title,
.single-subtitle {
text-align: right;
}
}

View file

@ -0,0 +1,27 @@
.tag-cloud-tags {
margin: 10px 0;
@include link(true, true);
a {
display: inline-block;
position: relative;
margin: 5px 10px;
@include overflow-wrap(break-word);
@include transition(all ease-out 0.3s);
&:active,
&:focus,
&:hover {
@include transform(scale(1.2));
}
sup {
color: $global-font-secondary-color;
[theme="dark"] & {
color: $global-font-secondary-color-dark;
}
}
}
}

View file

@ -0,0 +1,82 @@
.categories-card {
margin: 0 auto;
margin-top: 3rem;
display: flex;
align-items: center;
justify-content: space-between;
flex-direction: row;
flex-wrap: wrap;
line-height: 1.6rem;
.card-item {
font-size: 0.875rem;
text-align: left;
width: 45%;
display: flex;
align-items: flex-start;
margin-top: 2rem;
min-height: 10rem;
padding: 0 2%;
position: relative;
.card-item-wrapper {
width: 100%;
overflow: hidden;
.card-item-title {
font-size: 1.2rem;
font-weight: bold;
display: inline-block;
margin-top: 1rem;
margin-bottom: 0.75rem;
}
span {
float: right;
padding-right: 1rem;
}
}
}
}
.archive-item {
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
margin: 0.25rem 0 0.25rem 1.5rem;
}
.archive-item-link {
min-width: 10%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
&:hover {
color: $global-link-hover-color;
background-color: transparent;
}
[theme="dark"] & {
color: $global-link-color-dark;
&:hover {
color: $global-link-hover-color-dark;
}
}
}
.archive-item-date {
width: 4em;
text-align: right;
color: $global-font-secondary-color;
[theme="dark"] & {
color: $global-font-secondary-color-dark;
}
}
.more-post {
text-align: right;
}

View file

@ -0,0 +1,19 @@
.cc-window.cc-banner {
.cc-btn {
color: $global-font-color;
&:hover,
&:focus {
background-color: #ccc;
}
[theme="dark"] & {
color: $global-font-color;
&:hover,
&:focus {
background-color: #fff;
}
}
}
}

View file

@ -0,0 +1,33 @@
.details {
.details-summary {
&:hover {
cursor: pointer;
}
}
i.details-icon {
color: $global-font-secondary-color;
@include transition(transform 0.2s ease);
[theme="dark"] & {
color: $global-font-secondary-color-dark;
}
}
.details-content {
max-height: 0;
overflow-y: hidden;
@include details-transition-open;
}
&.open {
i.details-icon {
@include transform(rotate(90deg));
}
.details-content {
max-height: $MAX_LENGTH;
@include details-transition-close;
}
}
}

View file

@ -0,0 +1,50 @@
#fixed-buttons {
display: none;
}
.fixed-button {
display: none;
z-index: 100;
position: fixed;
right: 1.5rem;
font-size: 1rem;
line-height: 1.3rem;
padding: 0.6rem 0.6rem;
color: $global-font-secondary-color;
background: $header-background-color;
@include border-radius(2rem);
@include transition(color 0.4s ease);
@include blur;
&:hover,
&:active {
color: $global-font-color;
cursor: pointer;
}
&:active,
&:focus,
&:hover {
outline: none;
}
[theme="dark"] & {
color: $global-font-secondary-color-dark;
background: $header-background-color-dark;
&:hover,
&:active {
color: $global-font-color-dark;
}
}
}
#back-to-top {
display: block;
bottom: 1.5rem;
}
#view-comments {
bottom: 4.5rem;
}

View file

@ -0,0 +1,21 @@
footer {
height: 2rem;
width: 100%;
text-align: center;
line-height: 1.25rem;
padding: 1rem 0;
.footer-container {
font-size: 0.875rem;
.footer-line {
width: 100%;
.icp-br {
display: none;
}
}
}
@include blur;
}

View file

@ -0,0 +1,471 @@
header {
width: 100%;
z-index: 150;
background-color: $header-background-color;
@include transition(box-shadow 0.3s ease);
[theme="dark"] & {
background-color: $header-background-color-dark;
}
.logo {
min-height: 1.5em;
height: 1.5em;
vertical-align: text-bottom;
}
.logo,
.header-title-pre {
padding-right: 0.25rem;
}
.header-title-post {
padding-left: 0.25rem;
}
&:hover {
@include box-shadow(0 0 1.5rem 0 rgba(0, 0, 0, 0.1));
}
}
.header-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
width: 100%;
}
.header-title {
font-family: $header-title-font-family;
font-weight: bold;
margin-right: 0.5rem;
min-width: 10%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
@include flex(10);
}
.menu .menu-item {
position: relative;
}
.language-select {
position: absolute;
opacity: 0;
left: 0;
top: 0;
width: 100%;
height: 100%;
&:hover {
cursor: pointer;
}
}
.search {
position: relative;
input {
color: transparent;
box-sizing: border-box;
height: 2.5rem;
width: 2.5rem;
@include border-radius(0.5rem);
border: none;
outline: none;
background-color: $header-background-color;
vertical-align: baseline !important;
@include transition(width 0.3s ease);
[theme="dark"] & {
background-color: $header-background-color-dark;
}
}
@include placeholder(transparent);
.search-button {
margin: 0;
position: absolute;
left: auto;
right: 1rem;
}
.search-toggle {
left: 0.5rem;
right: auto;
}
.search-loading {
display: none;
}
.search-clear {
display: none;
}
.open &,
&.mobile {
input {
color: $global-font-color;
background-color: $search-background-color;
padding: 0 2rem 0 2rem;
}
[theme="dark"] & {
input {
color: $global-font-color-dark;
background-color: $search-background-color-dark;
}
@include placeholder($global-font-secondary-color-dark);
}
@include placeholder($global-font-secondary-color);
.search-button {
color: $global-font-secondary-color;
[theme="dark"] & {
color: $global-font-secondary-color-dark;
}
}
.search-clear:hover {
color: #ff6b6b;
}
.search-toggle:hover {
cursor: default;
}
}
}
.theme-switch i {
@include transform(rotate(225deg));
}
#header-desktop {
display: block;
position: fixed;
height: $header-height;
line-height: $header-height;
[header-desktop="normal"] & {
position: static;
}
.header-wrapper {
padding: 0 2rem 0 10vh;
.header-title {
font-size: $header-title-font-size;
}
.menu {
overflow: hidden;
white-space: nowrap;
.menu-inner {
float: right;
}
.menu-item {
margin: 0 0.5rem;
&.delimiter {
border-left: 1.5px solid $global-font-color;
[theme="dark"] & {
border-left-color: $global-border-color-dark;
}
}
&.language {
margin-right: 0;
}
&.search {
margin: 0 -0.5rem 0 0;
}
}
a.active {
font-weight: 900;
color: $header-hover-color;
[theme="dark"] & {
color: $header-hover-color-dark;
}
}
}
}
&.open .header-wrapper .menu .menu-item.search {
margin: 0 0.25rem 0 0.5rem;
input {
width: 24rem;
}
}
}
#header-mobile {
display: none;
position: fixed;
height: $header-height;
line-height: $header-height;
[header-mobile="normal"] & {
position: static;
}
.header-container {
padding: 0;
margin: 0;
.header-wrapper {
padding: 0 1rem;
font-size: 1.125rem;
@include transition(margin-top 0.3s ease);
.header-title {
font-size: $header-title-font-size;
max-width: 80%;
}
.menu-toggle {
line-height: 4rem;
cursor: pointer;
@include transition(width 0.3s ease);
span {
display: block;
background: $global-font-color;
width: 1.5rem;
height: 2px;
@include border-radius(3px);
@include transition(all 0.3s ease-in-out);
[theme="dark"] & {
background: $global-font-color-dark;
}
}
span:nth-child(1) {
margin-bottom: 0.5rem;
}
span:nth-child(3) {
margin-top: 0.5rem;
}
&.active {
span:nth-child(1) {
@include transform(rotate(45deg) translate(0.4rem, 0.5rem));
}
span:nth-child(2) {
opacity: 0;
}
span:nth-child(3) {
@include transform(rotate(-45deg) translate(0.4rem, -0.5rem));
}
}
}
}
.menu {
text-align: center;
background: $header-background-color;
border-top: 2px solid $global-border-color;
display: none;
padding-top: 0.5rem;
@include box-shadow(0 0.125rem 0.25rem rgba(0, 0, 0, 0.1));
.search-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: ($header-height - 2.5rem) / 2 1rem;
line-height: 2.5rem;
}
.search {
flex-grow: 10;
.algolia-autocomplete,
input {
width: 100%;
}
}
.search-button {
top: 0;
}
.search-cancel {
display: none;
margin-left: 0.75rem;
}
.menu-item {
display: block;
line-height: 2.5rem;
}
&.active {
display: block;
}
[theme="dark"] & {
background: $header-background-color-dark;
border-top-color: $global-border-color-dark;
}
}
}
&.open {
.header-wrapper {
margin-top: -$header-height;
}
.menu {
padding-top: 0;
border-top: none;
.menu-item {
display: none;
}
.search-cancel {
display: inline;
}
}
}
}
.search-dropdown {
position: fixed;
z-index: 200;
top: $header-height;
@include box-shadow(0 0.125rem 0.25rem rgba(0, 0, 0, 0.1));
&.desktop {
right: 2rem;
width: 30rem;
}
&.mobile {
right: 0;
width: 100%;
}
.dropdown-menu {
right: 0 !important;
background-color: $global-background-color;
[theme="dark"] & {
background-color: $global-background-color-dark;
}
.suggestions {
overflow-y: auto;
max-height: calc(100vh - #{$header-height});
.suggestion {
padding: 0.75rem 1rem;
.suggestion-title {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 1rem;
font-weight: bold;
max-width: 75%;
}
.suggestion-date {
font-size: 0.875rem;
float: right;
text-align: right;
color: $global-font-secondary-color;
[theme="dark"] & {
color: $global-font-secondary-color-dark;
}
}
.suggestion-context {
line-height: 1.25rem;
@include box(vertical);
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
@include overflow-wrap(break-word);
color: $global-font-secondary-color;
[theme="dark"] & {
color: $global-font-secondary-color-dark;
}
}
em {
font-style: normal;
background-color: $selection-color;
[theme="dark"] & {
background-color: $selection-color-dark;
}
}
&.cursor {
background: darken($code-background-color, 5%);
[theme="dark"] & {
background: lighten($code-background-color-dark, 5%);
}
}
&:hover {
cursor: pointer;
}
}
}
.search-empty {
padding: 1rem;
text-align: center;
.search-query {
font-weight: bold;
[theme="dark"] & {
color: #ddd;
}
}
}
.search-footer {
padding: 0.5rem 1rem;
float: right;
font-size: 0.8rem;
color: $global-font-secondary-color;
[theme="dark"] {
color: $global-font-secondary-color-dark;
}
@include link(false, false);
a {
font-size: 1rem;
}
}
}
}

View file

@ -0,0 +1,17 @@
svg.icon {
display: inline-block;
width: 1.25em;
height: 1em;
text-align: center;
path {
fill: currentColor;
}
}
img.emoji {
height: 1em;
width: 1em;
margin: 0 0.05em 0 0.1em;
vertical-align: -0.1em;
}

View file

@ -0,0 +1,16 @@
#mask {
background-repeat: no-repeat;
background-position: center;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
background-color: rgba(0, 0, 0, 0);
.blur & {
z-index: 100;
background-color: rgba(0, 0, 0, 0.25);
}
}

View file

@ -0,0 +1,90 @@
.pagination {
display: flex;
flex-direction: row;
justify-content: center;
list-style: none;
white-space: nowrap;
width: 100%;
padding: 1rem 0 0;
a {
font-size: 0.8rem;
color: #bfbfbf;
letter-spacing: 0.1rem;
font-weight: 700;
padding: 5px 5px;
text-decoration: none;
@include transition(0.3s);
}
li {
padding-bottom: 3px;
margin: 0 20px;
box-sizing: border-box;
position: relative;
display: inline;
&.disabled {
display: none;
}
&:hover a {
color: $pagination-link-hover-color;
}
[theme="dark"] &:hover a {
color: $pagination-link-hover-color-dark;
}
&:before,
&:after {
position: absolute;
content: "";
width: 0;
height: 3px;
background: $pagination-link-hover-color;
@include transition(0.3s);
bottom: 0px;
}
[theme="dark"] &:before,
[theme="dark"] &:after {
background: $pagination-link-hover-color-dark;
}
&:before .active,
&:after .active {
width: 100%;
}
&:before {
left: 50%;
}
&:after {
right: 50%;
}
&:hover {
&:before,
&:after {
width: 50%;
}
}
&.active {
a {
color: $pagination-link-hover-color;
}
[theme="dark"] & a {
color: $pagination-link-hover-color-dark;
}
&:before,
&:after {
width: 60%;
}
}
}
}

View file

@ -0,0 +1,70 @@
.admonition {
position: relative;
margin: 1rem 0;
padding: 0 0.75rem;
background-color: map-get($admonition-background-color-map, "note");
border-left: 0.25rem solid map-get($admonition-color-map, "note");
overflow: auto;
.admonition-title {
font-weight: bold;
margin: 0 -0.75rem;
padding: 0.25rem 1.8rem;
border-bottom: 1px solid map-get($admonition-background-color-map, "note");
background-color: opacify(
map-get($admonition-background-color-map, "note"),
0.15
);
}
&.open .admonition-title {
background-color: map-get($admonition-background-color-map, "note");
}
.admonition-content {
padding: 0.5rem 0;
}
i.icon {
font-size: 0.85rem;
color: map-get($admonition-color-map, "note");
position: absolute;
top: 0.6rem;
left: 0.4rem;
}
i.details-icon {
position: absolute;
top: 0.6rem;
right: 0.3rem;
}
@each $type, $color in $admonition-color-map {
&.#{$type} {
border-left-color: $color;
i.icon {
color: $color;
}
}
}
@each $type, $color in $admonition-background-color-map {
&.#{$type} {
background-color: $color;
.admonition-title {
border-bottom-color: $color;
background-color: opacify($color, 0.15);
}
&.open .admonition-title {
background-color: $color;
}
}
}
&:last-child {
margin-bottom: 0.75rem;
}
}

View file

@ -0,0 +1,16 @@
.bilibili {
position: relative;
width: 100%;
height: 0;
padding-bottom: 75%;
margin: 3% auto;
text-align: center;
iframe {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
}

View file

@ -0,0 +1,403 @@
code {
display: inline-block;
max-width: 100%;
padding: 0 0.4rem;
@include overflow-wrap(break-word);
@include line-break(anywhere);
font-size: $code-font-size;
font-family: $code-font-family;
color: $code-color;
[theme="dark"] & {
color: $code-color-dark;
}
}
pre {
margin: 0;
padding: 0.25rem 0 0.25rem 0.5rem;
@include tab-size(4);
code {
padding: 0;
}
img {
min-height: 1em;
max-height: 1.2em;
vertical-align: text-bottom;
}
}
code,
pre,
.highlight table,
.highlight tr,
.highlight td {
background: $code-background-color;
[theme="dark"] & {
background: $code-background-color-dark;
}
}
.highlight,
.gist {
font-family: $code-font-family;
font-size: $code-font-size;
.table-wrapper {
> table,
> table thead,
> table tr,
> table td {
margin: 0;
padding: 0;
border: none !important;
white-space: nowrap;
}
}
}
.highlight {
line-height: 1.4em;
margin: 0.5rem 0;
> .chroma {
position: relative;
.code-header {
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
width: 100%;
font-family: $global-font-family;
font-weight: bold;
color: $code-info-color;
background: darken($code-background-color, 8%);
[theme="dark"] & {
color: $code-info-color-dark;
background: darken($code-background-color-dark, 6%);
}
&:hover {
cursor: pointer;
}
.code-title {
width: 100%;
padding: 0.4rem;
}
.code-title::after {
padding-left: 0.2rem;
content: "Code";
}
@each $type, $text in $code-type-map {
&.#{$type} .code-title::after {
content: $text;
}
}
}
.lntd:first-child {
min-width: 1.6rem;
text-align: right;
}
.lntd:last-child {
width: 100%;
pre {
@include max-content(min-width);
}
}
.ln {
padding-right: 0.75rem;
}
.hl {
display: block;
background-color: darken($code-background-color, 10%);
[theme="dark"] & {
background-color: darken($code-background-color-dark, 5%);
}
}
.ln,
.lnt {
color: $global-font-secondary-color;
[theme="dark"] & {
color: $global-font-secondary-color-dark;
}
}
.arrow {
padding: 0 0.2rem;
@include transition(transform 0.2s ease);
}
.ellipses {
padding: 0.4rem;
}
.copy {
display: none;
padding: 0.4rem;
&:hover {
cursor: pointer;
color: $global-link-hover-color;
[theme="dark"] & {
color: $global-link-hover-color-dark;
}
}
}
.table-wrapper {
max-height: 0;
overflow-y: hidden;
@include details-transition-open;
}
&.open {
.code-header {
background: darken($code-background-color, 3%);
[theme="dark"] & {
background: darken($code-background-color-dark, 3%);
}
}
.table-wrapper {
max-height: $MAX_LENGTH;
@include details-transition-close;
}
.arrow {
@include transform(rotate(90deg));
}
.ellipses {
display: none;
}
.copy {
display: inline;
}
}
}
/* Comment */
.c,
/* CommentHashbang */ .ch,
/* CommentMultiline */ .cm,
/* CommentSingle */ .c1,
/* CommentSpecial */ .cs,
/* CommentPreproc */ .cp,
/* CommentPreprocFile */ .cpf {
font-style: italic;
}
/* GenericUnderline */
.gl {
text-decoration: underline;
}
@each $class, $color in $code-highlight-color-map {
.#{$class} {
color: $color;
}
}
[theme="dark"] & {
@each $class, $color in $code-highlight-color-map-dark {
.#{$class} {
color: $color;
}
}
}
}
.gist {
.gist-file,
.gist-data,
.gist-meta {
border: none;
}
.gist-meta {
padding: 0.4rem 0.8rem;
background-color: darken($code-background-color, 5%);
@include link(false, false);
[theme="dark"] & {
background-color: darken($code-background-color-dark, 5%);
}
}
[theme="dark"] & {
// imported from https://github.com/lonekorean/gist-syntax-themes/blob/master/stylesheets/one-dark.css
.highlight {
background: #141414;
}
.blob-num,
.blob-code-inner,
.highlight,
.pl-enm,
.pl-ko,
.pl-mo,
.pl-mp1 .pl-sf,
.pl-ms,
.pl-pdc1,
.pl-scp,
.pl-smc,
.pl-som,
.pl-va,
.pl-vpf,
.pl-vpu,
.pl-mdr {
color: #aab1bf;
}
.pl-mb,
.pl-pdb {
font-weight: 700;
}
.pl-c,
.pl-c span,
.pl-pdc {
color: #5b6270;
font-style: italic;
}
.pl-sr .pl-cce {
color: #56b5c2;
font-weight: 400;
}
.pl-ef,
.pl-en,
.pl-enf,
.pl-eoai,
.pl-kos,
.pl-mh .pl-pdh,
.pl-mr {
color: #61afef;
}
.pl-ens,
.pl-vi {
color: #be5046;
}
.pl-enti,
.pl-mai .pl-sf,
.pl-ml,
.pl-sf,
.pl-sr,
.pl-sr .pl-sra,
.pl-src,
.pl-st,
.pl-vo {
color: #56b5c2;
}
.pl-eoi,
.pl-mri,
.pl-pds,
.pl-pse .pl-s1,
.pl-s,
.pl-s1 {
color: #97c279;
}
.pl-k,
.pl-kolp,
.pl-mc,
.pl-pde {
color: #c578dd;
}
.pl-mi,
.pl-pdi {
color: #c578dd;
font-style: italic;
}
.pl-mp,
.pl-stp {
color: #818896;
}
.pl-mdh,
.pl-mdi,
.pl-mdr {
font-weight: 400;
}
.pl-mdht,
.pl-mi1 {
color: #97c279;
background: #020;
}
.pl-md,
.pl-mdhf {
color: #df6b75;
background: #200;
}
.pl-corl {
color: #df6b75;
text-decoration: underline;
}
.pl-ib {
background: #df6b75;
}
.pl-ii {
background: #e0c184;
color: #fff;
}
.pl-iu {
background: #e05151;
}
.pl-ms1 {
color: #aab1bf;
background: #373b41;
}
.pl-c1,
.pl-cn,
.pl-e,
.pl-eoa,
.pl-eoac,
.pl-eoac .pl-pde,
.pl-kou,
.pl-mm,
.pl-mp .pl-s3,
.pl-mq,
.pl-s3,
.pl-sok,
.pl-sv,
.pl-mb {
color: #d19965;
}
.pl-enc,
.pl-entc,
.pl-pse .pl-s2,
.pl-s2,
.pl-sc,
.pl-smp,
.pl-sr .pl-sre,
.pl-stj,
.pl-v,
.pl-pdb {
color: #e4bf7a;
}
.pl-ent,
.pl-entl,
.pl-entm,
.pl-mh,
.pl-pdv,
.pl-smi,
.pl-sol,
.pl-mdh,
.pl-mdi {
color: #df6b75;
}
}
}

View file

@ -0,0 +1,3 @@
#comments {
padding: 8rem 0 2rem;
}

View file

@ -0,0 +1,4 @@
.echarts {
margin: 0.5rem 0;
text-align: center;
}

View file

@ -0,0 +1,98 @@
.post-footer {
margin-top: 3rem;
.post-info {
border-bottom: 1px solid $global-border-color;
padding: 1rem 0 0.3rem;
[theme="dark"] & {
border-bottom: 1px solid $global-border-color-dark;
}
.post-info-line {
display: flex;
justify-content: space-between;
.post-info-mod {
font-size: 0.8em;
color: $global-font-secondary-color;
[theme="dark"] & {
color: $global-font-secondary-color-dark;
}
@include link(false, false);
}
.post-info-license {
font-size: 0.8em;
color: $global-font-secondary-color;
[theme="dark"] & {
color: $global-font-secondary-color-dark;
}
@include link(false, false);
}
.post-info-md {
font-size: 0.8rem;
width: 8rem;
@include link(false, false);
}
.post-info-share {
a * {
vertical-align: text-bottom;
}
}
}
}
.post-info-more {
padding: 0.3rem 0 1rem;
display: flex;
justify-content: space-between;
font-size: 0.9rem;
}
.post-tags {
max-width: 65%;
* {
display: inline;
}
}
.post-nav {
&::before,
&::after {
content: " ";
display: table;
}
& a.prev,
& a.next {
font-size: 1rem;
font-weight: 600;
@include transition(all 0.3s ease-out);
}
& a.prev {
float: left;
}
& a.prev:hover {
@include transform(translateX(-4px));
}
& a.next {
float: right;
}
& a.next:hover {
@include transform(translateX(4px));
}
}
}

View file

@ -0,0 +1,5 @@
iframe.instagram-media {
[theme="dark"] & {
border: none !important;
}
}

View file

@ -0,0 +1,4 @@
.mapbox {
margin: 0.5rem 0;
padding: 0.5rem 0;
}

View file

@ -0,0 +1,3 @@
meting-js {
margin: 0.5rem 0;
}

View file

@ -0,0 +1,157 @@
.toc {
.toc-title {
font-size: $toc-title-font-size;
font-weight: bold;
text-transform: uppercase;
}
.toc-content {
font-size: $toc-content-font-size;
ul {
text-indent: -0.85rem;
padding-left: 0.8rem;
list-style: none;
a:first-child::before {
content: "|";
font-weight: bolder;
margin-right: 0.5rem;
color: $single-link-color;
[theme="dark"] & {
color: $single-link-color-dark;
}
}
ul {
padding-left: 1.5rem;
}
}
}
ruby {
background: $code-background-color;
rt {
color: $global-font-secondary-color;
}
[theme="dark"] & {
background: $code-background-color-dark;
rt {
color: $global-font-secondary-color-dark;
}
}
}
}
#toc-auto {
display: block;
position: absolute;
width: $MAX_LENGTH;
max-width: 0;
padding: 0 0.8rem;
border-left: 4px solid $global-border-color;
@include overflow-wrap(break-word);
box-sizing: border-box;
top: 10rem;
left: 0;
visibility: hidden;
[header-desktop="normal"] & {
top: 5rem;
}
@include blur;
[theme="dark"] & {
border-left-color: $global-border-color-dark;
}
.toc-title {
margin: 0.8rem 0;
}
.toc-content {
&.always-active ul {
display: block;
}
> nav > ul {
margin: 0.625rem 0;
}
ul {
ul {
display: none;
}
.has-active > ul {
display: block;
}
}
a.active {
font-weight: bold;
color: $single-link-color;
[theme="dark"] & {
color: $single-link-color-dark;
}
&::before {
color: $single-link-hover-color;
[theme="dark"] & {
color: $single-link-hover-color-dark;
}
}
}
}
}
#toc-static {
display: none;
margin: 0.8rem 0;
&[kept="true"] {
display: block;
}
.toc-title {
display: flex;
justify-content: space-between;
line-height: 2em;
padding: 0 0.75rem;
background: darken($code-background-color, 6%);
[theme="dark"] & {
background: darken($code-background-color-dark, 6%);
}
}
.toc-content {
background-color: $code-background-color;
> nav > ul {
margin: 0;
padding: 0.4rem 1rem 0.4rem 1.8rem;
}
[theme="dark"] & {
background-color: $code-background-color-dark;
}
}
&.open {
.toc-title {
background: darken($code-background-color, 3%);
[theme="dark"] & {
background: darken($code-background-color-dark, 3%);
}
}
}
}

View file

@ -0,0 +1,369 @@
// ==============================
// Variables
// ==============================
// ========== Global ========== //
// Font and Line Height
$global-font-family: system-ui, -apple-system, BlinkMacSystemFont, PingFang SC,
Microsoft YaHei UI, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans,
Droid Sans, Helvetica Neue, Helvetica, Arial, sans-serif !default;
$global-font-size: 16px;
$global-font-weight: 400;
$global-line-height: 1.5rem;
// Color of the background
$global-background-color: #fff !default;
$global-background-color-dark: #292a2d !default;
// Color of the text
$global-font-color: #161209 !default;
$global-font-color-dark: #a9a9b3 !default;
// Color of the secondary text
$global-font-secondary-color: #a9a9b3 !default;
$global-font-secondary-color-dark: #5d5d5f !default;
// Color of the link
$global-link-color: #161209 !default;
$global-link-color-dark: #a9a9b3 !default;
// Color of the hover link
$global-link-hover-color: #2d96bd !default;
$global-link-hover-color-dark: #fff !default;
// Color of the border
$global-border-color: #f0f0f0 !default;
$global-border-color-dark: #363636 !default;
// ========== Global ========== //
// ========== Scrollbar ========== //
// Color of the scrollbar
$scrollbar-color: #87878d !default;
// Color of the hover scrollbar
$scrollbar-hover-color: #a9a9b3 !default;
// ========== Scrollbar ========== //
// ========== Selection ========== //
// Color of the selected text
$selection-color: rgba(53, 166, 247, 0.25) !default;
$selection-color-dark: rgba(50, 112, 194, 0.4) !default;
// ========== Selection ========== //
// ========== Header ========== //
// Height of the header
$header-height: 3.5rem !default;
// Color of the header background
$header-background-color: #f8f8f8 !default;
$header-background-color-dark: #252627 !default;
// Font style of the header title
$header-title-font-family: $global-font-family !default;
$header-title-font-size: 1.5rem !default;
// Color of the hover header item
$header-hover-color: #161209 !default;
$header-hover-color-dark: #fff !default;
// Color of the search background
$search-background-color: #e9e9e9 !default;
$search-background-color-dark: #363636 !default;
// ========== Header ========== //
// ========== Single Content ========== //
// Font size of the TOC
$toc-title-font-size: 1.2rem !default;
$toc-content-font-size: 1rem !default;
// Color of the single link
$single-link-color: #2d96bd !default;
$single-link-color-dark: #55bde2 !default;
// Color of the hover single link
$single-link-hover-color: #ef3982 !default;
$single-link-hover-color-dark: #bdebfc !default;
// Color of the table background
$table-background-color: #fff !default;
$table-background-color-dark: #272c34 !default;
// Color of the table thead
$table-thead-color: #ededed !default;
$table-thead-color-dark: #20252b !default;
// Color of the blockquote
$blockquote-color: #6bd6fd !default;
$blockquote-color-dark: #59c5ec !default;
// ========== Single Content ========== //
// ========== Pagination ========== //
// Color of the link in pagination
$pagination-link-color: #2d96bd !default;
$pagination-link-color-dark: #a9a9b3 !default;
// Color of the hover link in pagination
$pagination-link-hover-color: #000 !default;
$pagination-link-hover-color-dark: #fff !default;
// ========== Pagination ========== //
// ========== Code ========== //
// Color of the code
$code-color: #e74c3c !default;
$code-color-dark: #e5bf78 !default;
// Color of the code background
$code-background-color: #f5f5f5 !default;
$code-background-color-dark: #272c34 !default;
$code-info-color: #9c9c9c !default;
$code-info-color-dark: #b1b0b0 !default;
// Font size of the code
$code-font-size: 0.875rem !default;
// Font family of the code
$code-font-family: Source Code Pro, Menlo, Consolas, Monaco, monospace,
$global-font-family !default;
// Code type map
$code-type-map: (
// Custom code type
language-bash: "Bash",
language-c: "C",
language-cs: "C#",
language-cpp: "C++",
language-clojure: "Clojure",
language-coffeescript: "CoffeeScript",
language-css: "CSS",
language-dart: "Dart",
language-diff: "Diff",
language-erlang: "Erlang",
language-go: "Go",
language-go-html-template: "Go HTML Template",
language-groovy: "Groovy",
language-haskell: "Haskell",
language-html: "HTML",
language-http: "HTTP",
language-xml: "XML",
language-java: "Java",
language-js: "JavaScript",
language-javascript: "JavaScript",
language-json: "JSON",
language-kotlin: "Kotlin",
language-latex: "LaTeX",
language-less: "Less",
language-lisp: "Lisp",
language-lua: "Lua",
language-makefile: "Makefile",
language-markdown: "Markdown",
language-matlab: "Matlab",
language-objectivec: "Objective-C",
language-php: "PHP",
language-perl: "Perl",
language-python: "Python",
language-r: "R",
language-ruby: "Ruby",
language-rust: "Rust",
language-scala: "Scala",
language-scss: "Scss",
language-shell: "Shell",
language-sql: "SQL",
language-swift: "Swift",
language-tex: "TeX",
language-toml: "TOML",
language-ts: "TypeScript",
language-typescript: "TypeScript",
language-vue: "Vue",
language-yml: "YAML",
language-yaml: "YAML"
) !default;
// Color map of the code highlight
$code-highlight-color-map: (
/* Parentheses */ "p": #a9a9b3,
/* Keyword */ "k": #b501a9,
/* KeywordConstant */ "kc": #b501a9,
/* KeywordDeclaration */ "kd": #b501a9,
/* KeywordNamespace */ "kn": #b501a9,
/* KeywordPseudo */ "kp": #b501a9,
/* KeywordReserved */ "kr": #b501a9,
/* KeywordType */ "kt": #b501a9,
/* Name */ "n": #333333,
/* NameAttribute */ "na": #2b77fa,
/* NameBuiltin */ "nb": #f74840,
/* NameBuiltinPseudo */ "bp": #f74840,
/* NameClass */ "nc": #cb8100,
/* NameConstant */ "no": #2b77fa,
/* NameDecorator */ "nd": #0086c1,
/* NameEntity */ "ni": #2b77fa,
/* NameException */ "ne": #2b77fa,
/* NameFunction */ "nf": #2b77fa,
/* NameFunctionMagic */ "fm": #1ccad6,
/* NameLabel */ "nl": #2b77fa,
/* NameNamespace */ "nn": #2b77fa,
/* NameOther */ "nx": #333333,
/* NameProperty */ "py": #2b77fa,
/* NameTag */ "nt": #2b77fa,
/* NameVariable */ "nv": #2b77fa,
/* NameVariableClass */ "vc": #2b77fa,
/* NameVariableGlobal */ "vg": #2b77fa,
/* NameVariableInstance */ "vi": #2b77fa,
/* NameVariableMagic */ "vm": #2b77fa,
/* Literal */ "l": #2aa198,
/* LiteralDate */ "ld": #2aa198,
/* LiteralString */ "s": #24a443,
/* LiteralStringAffix */ "sa": #24a443,
/* LiteralStringBacktick */ "sb": #24a443,
/* LiteralStringChar */ "sc": #24a443,
/* LiteralStringDelimiter */ "dl": #24a443,
/* LiteralStringDoc */ "sd": #24a443,
/* LiteralStringDouble */ "s2": #24a443,
/* LiteralStringEscape */ "se": #24a443,
/* LiteralStringHeredoc */ "sh": #24a443,
/* LiteralStringInterpol */ "si": #24a443,
/* LiteralStringOther */ "sx": #24a443,
/* LiteralStringRegex */ "sr": #24a443,
/* LiteralStringSingle */ "s1": #24a443,
/* LiteralStringSymbol */ "ss": #24a443,
/* LiteralNumber */ "m": #e2893c,
/* LiteralNumberBin */ "mb": #e2893c,
/* LiteralNumberFloat */ "mf": #e2893c,
/* LiteralNumberHex */ "mh": #e2893c,
/* LiteralNumberInteger */ "mi": #e2893c,
/* LiteralNumberIntegerLong */ "il": #e2893c,
/* LiteralNumberOct */ "mo": #e2893c,
/* Operator */ "o": #f19b04,
/* OperatorWord */ "ow": #b501a9,
/* Comment */ "c": #a0a1a8,
/* CommentHashbang */ "ch": #a0a1a8,
/* CommentMultiline */ "cm": #a0a1a8,
/* CommentSingle */ "c1": #a0a1a8,
/* CommentSpecial */ "cs": #a0a1a8,
/* CommentPreproc */ "cp": #a0a1a8,
/* CommentPreprocFile */ "cpf": #a0a1a8,
/* Generic */ "g": #e72d40,
/* GenericDeleted */ "gd": #e72d40,
/* GenericEmph */ "ge": #e72d40,
/* GenericError */ "gr": #e72d40,
/* GenericHeading */ "gh": #e72d40,
/* GenericInserted */ "gi": #e72d40,
/* GenericOutput */ "go": #e72d40,
/* GenericPrompt */ "gp": #e72d40,
/* GenericStrong */ "gs": #e72d40,
/* GenericSubheading */ "gu": #e72d40,
/* GenericTraceback */ "gt": #e72d40,
/* TextWhitespace */ "w": #bbbbbb
) !default;
$code-highlight-color-map-dark: (
/* Parentheses */ "p": #a9a9b3,
/* Keyword */ "k": #d371e3,
/* KeywordConstant */ "kc": #d371e3,
/* KeywordDeclaration */ "kd": #d371e3,
/* KeywordNamespace */ "kn": #d371e3,
/* KeywordPseudo */ "kp": #d371e3,
/* KeywordReserved */ "kr": #d371e3,
/* KeywordType */ "kt": #d371e3,
/* Name */ "n": #a9b2c0,
/* NameAttribute */ "na": #41b0f5,
/* NameBuiltin */ "nb": #19b9c4,
/* NameBuiltinPseudo */ "bp": #ecbf6f,
/* NameClass */ "nc": #ecbf6f,
/* NameConstant */ "no": #41b0f5,
/* NameDecorator */ "nd": #ecbf6f,
/* NameEntity */ "ni": #41b0f5,
/* NameException */ "ne": #41b0f5,
/* NameFunction */ "nf": #41b0f5,
/* NameFunctionMagic */ "fm": #19b9c4,
/* NameLabel */ "nl": #41b0f5,
/* NameNamespace */ "nn": #41b0f5,
/* NameOther */ "nx": #a9a9b3,
/* NameProperty */ "py": #41b0f5,
/* NameTag */ "nt": #41b0f5,
/* NameVariable */ "nv": #41b0f5,
/* NameVariableClass */ "vc": #41b0f5,
/* NameVariableGlobal */ "vg": #41b0f5,
/* NameVariableInstance */ "vi": #41b0f5,
/* NameVariableMagic */ "vm": #41b0f5,
/* Literal */ "l": #2aa198,
/* LiteralDate */ "ld": #2aa198,
/* LiteralString */ "s": #8cc570,
/* LiteralStringAffix */ "sa": #8cc570,
/* LiteralStringBacktick */ "sb": #8cc570,
/* LiteralStringChar */ "sc": #8cc570,
/* LiteralStringDelimiter */ "dl": #8cc570,
/* LiteralStringDoc */ "sd": #8cc570,
/* LiteralStringDouble */ "s2": #8cc570,
/* LiteralStringEscape */ "se": #8cc570,
/* LiteralStringHeredoc */ "sh": #8cc570,
/* LiteralStringInterpol */ "si": #8cc570,
/* LiteralStringOther */ "sx": #8cc570,
/* LiteralStringRegex */ "sr": #8cc570,
/* LiteralStringSingle */ "s1": #8cc570,
/* LiteralStringSymbol */ "ss": #8cc570,
/* LiteralNumber */ "m": #db985c,
/* LiteralNumberBin */ "mb": #db985c,
/* LiteralNumberFloat */ "mf": #db985c,
/* LiteralNumberHex */ "mh": #db985c,
/* LiteralNumberInteger */ "mi": #db985c,
/* LiteralNumberIntegerLong */ "il": #db985c,
/* LiteralNumberOct */ "mo": #db985c,
/* Operator */ "o": #ecbf6f,
/* OperatorWord */ "ow": #d371e3,
/* Comment */ "c": #7e848f,
/* CommentHashbang */ "ch": #7e848f,
/* CommentMultiline */ "cm": #7e848f,
/* CommentSingle */ "c1": #7e848f,
/* CommentSpecial */ "cs": #7e848f,
/* CommentPreproc */ "cp": #7e848f,
/* CommentPreprocFile */ "cpf": #7e848f,
/* Generic */ "g": #f16372,
/* GenericDeleted */ "gd": #f16372,
/* GenericEmph */ "ge": #f16372,
/* GenericError */ "gr": #f16372,
/* GenericHeading */ "gh": #f16372,
/* GenericInserted */ "gi": #f16372,
/* GenericOutput */ "go": #f16372,
/* GenericPrompt */ "gp": #f16372,
/* GenericStrong */ "gs": #f16372,
/* GenericSubheading */ "gu": #f16372,
/* GenericTraceback */ "gt": #f16372,
/* TextWhitespace */ "w": #bbbbbb
) !default;
// ========== Code ========== //
// ========== Admonition ========== //
// Color map of the admonition
$admonition-color-map: (
"note": #448aff,
"abstract": #00b0ff,
"info": #00b8d4,
"tip": #00bfa5,
"success": #00c853,
"question": #64dd17,
"warning": #ff9100,
"failure": #ff5252,
"danger": #ff1744,
"bug": #f50057,
"example": #651fff,
"quote": #9e9e9e,
) !default;
// Color map of the admonition background
$admonition-background-color-map: (
"note": rgba(68, 138, 255, 0.1),
"abstract": rgba(0, 176, 255, 0.1),
"info": rgba(0, 184, 212, 0.1),
"tip": rgba(0, 191, 165, 0.1),
"success": rgba(0, 200, 83, 0.1),
"question": rgba(100, 221, 23, 0.1),
"warning": rgba(255, 145, 0, 0.1),
"failure": rgba(255, 82, 82, 0.1),
"danger": rgba(255, 23, 68, 0.1),
"bug": rgba(245, 0, 87, 0.1),
"example": rgba(101, 31, 255, 0.1),
"quote": rgba(159, 159, 159, 0.1),
) !default;
// ========== Admonition ========== //
$MAX_LENGTH: 12000px;

View file

@ -0,0 +1,19 @@
@charset "utf-8";
@import "_variables";
@import "_override";
@import "_mixin/index";
@import "_core/base";
@import "_core/layout";
@import "_page/index";
@import "_partial/header";
@import "_partial/footer";
@import "_partial/pagination";
@import "_core/media";
@import "_custom";

View file

@ -0,0 +1,66 @@
prefix:
libFiles: https://cdn.jsdelivr.net/npm/
# simple-icons@2.14.0 https://github.com/simple-icons/simple-icons
simpleIcons: https://cdn.jsdelivr.net/npm/simple-icons@2.14.0/icons/
libFiles:
# normalize.css@8.0.1 https://github.com/necolas/normalize.css
normalizeCSS: normalize.css@8.0.1/normalize.min.css
# fontawesome-free@5.13.0 https://fontawesome.com/
fontawesomeFreeCSS: '@fortawesome/fontawesome-free@5.13.0/css/all.min.css'
# animate.css@3.7.2 https://github.com/daneden/animate.css
animateCSS: animate.css@3.7.2/animate.min.css
# smooth-scroll@16.1.3 https://github.com/cferdinandi/smooth-scroll
smoothScrollJS: smooth-scroll@16.1.3/dist/smooth-scroll.min.js
# autocomplete.js@0.37.1 https://github.com/algolia/autocomplete.js
autocompleteJS: autocomplete.js@0.37.1/dist/autocomplete.min.js
# lunr.js@2.3.8 https://lunrjs.com/
lunrJS: lunr@2.3.8/lunr.min.js
# algoliasearch@4.2.0 https://github.com/algolia/algoliasearch-client-javascript
algoliasearchJS: algoliasearch@4.2.0/dist/algoliasearch-lite.umd.min.js
# lazysizes@5.2.2 https://github.com/aFarkas/lazysizes
lazysizesJS: lazysizes@5.2.2/lazysizes.min.js
# object-fit-images@3.2.4 https://github.com/fregante/object-fit-images
objectFitImagesJS: object-fit-images@3.2.4/dist/ofi.min.js
# twemoji@13.0.0 https://github.com/twitter/twemoji
twemojiJS: twemoji@13.0.0/dist/twemoji.min.js
# lightgallery.js@1.2.0 https://github.com/sachinchoolur/lightgallery.js
# lg-thumbnail.js@1.2.0 https://github.com/sachinchoolur/lg-thumbnail.js
# lg-zoom.js@1.2.0 https://github.com/sachinchoolur/lg-zoom.js
lightgalleryCSS: lightgallery.js@1.2.0/dist/css/lightgallery.min.css
lightgalleryJS: lightgallery.js@1.2.0/dist/js/lightgallery.min.js
lightgalleryThumbnailJS: lg-thumbnail.js@1.2.0/dist/lg-thumbnail.min.js
lightgalleryZoomJS: lg-zoom.js@1.2.0/dist/lg-zoom.min.js
# clipboard.js@2.0.6 https://github.com/zenorocha/clipboard.js
clipboardJS: clipboard@2.0.6/dist/clipboard.min.js
# sharer.js@0.4.0 https://github.com/ellisonleao/sharer.js
sharerJS: sharer.js@0.4.0/sharer.min.js
# typeit@7.0.4 https://github.com/alexmacarthur/typeit
typeitJS: typeit@7.0.4/dist/typeit.min.js
# katex@0.11.1 https://katex.org/
katexCSS: katex@0.11.1/dist/katex.min.css
katexJS: katex@0.11.1/dist/katex.min.js
katexAutoRenderJS: katex@0.11.1/dist/contrib/auto-render.min.js
katexCopyTexCSS: katex@0.11.1/dist/contrib/copy-tex.min.css
katexCopyTexJS: katex@0.11.1/dist/contrib/copy-tex.min.js
katexMhchemJS: katex@0.11.1/dist/contrib/mhchem.min.js
# mermaid@8.5.1 https://github.com/knsv/mermaid
mermaidJS: mermaid@8.5.1/dist/mermaid.min.js
# echarts@4.8.0 https://echarts.apache.org/
echartsJS: echarts@4.8.0/dist/echarts.min.js
echartsMacaronsJS: echarts@4.8.0/theme/macarons.min.js
# mapbox-gl@1.10.1 https://docs.mapbox.com/mapbox-gl-js
mapboxGLCSS: mapbox-gl@1.10.1/dist/mapbox-gl.min.css
mapboxGLJS: mapbox-gl@1.10.1/dist/mapbox-gl.min.js
# 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
# meting@2.0.1 https://github.com/metowolf/MetingJS
metingJS: meting@2.0.1/dist/Meting.min.js
# gitalk@1.6.2 https://github.com/gitalk/gitalk
gitalkCSS: gitalk@1.6.2/dist/gitalk.min.css
gitalkJS: gitalk@1.6.2/dist/gitalk.min.js
# valine@1.4.14 https://valine.js.org/
valineJS: valine@1.4.14/dist/Valine.min.js
# cookieconsent@3.1.1 https://github.com/osano/cookieconsent
cookieconsentCSS: cookieconsent@3.1.1/build/cookieconsent.min.css
cookieconsentJS: cookieconsent@3.1.1/build/cookieconsent.min.js

View file

@ -0,0 +1,150 @@
emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-apple@5.0.1/img/apple/64/'
emojiMaps:
'100': 1f4af.png
grinning: 1f600.png
smiley: 1f603.png
smile: 1f604.png
grin: 1f601.png
laughing: 1f606.png
sweat_smile: 1f605.png
rolling_on_the_floor_laughing: 1f923.png
joy: 1f602.png
slightly_smiling_face: 1f642.png
upside_down_face: 1f643.png
wink: 1f609.png
blush: 1f60a.png
innocent: 1f607.png
smiling_face_with_3_hearts: 1f970.png
heart_eyes: 1f60d.png
star-struck: 1f929.png
kissing_heart: 1f618.png
kissing: 1f617.png
relaxed: 263a-fe0f.png
kissing_closed_eyes: 1f61a.png
kissing_smiling_eyes: 1f619.png
yum: 1f60b.png
stuck_out_tongue: 1f61b.png
stuck_out_tongue_winking_eye: 1f61c.png
zany_face: 1f92a.png
stuck_out_tongue_closed_eyes: 1f61d.png
money_mouth_face: 1f911.png
hugging_face: 1f917.png
face_with_hand_over_mouth: 1f92d.png
shushing_face: 1f92b.png
thinking_face: 1f914.png
zipper_mouth_face: 1f910.png
face_with_raised_eyebrow: 1f928.png
neutral_face: 1f610.png
expressionless: 1f611.png
no_mouth: 1f636.png
smirk: 1f60f.png
unamused: 1f612.png
face_with_rolling_eyes: 1f644.png
grimacing: 1f62c.png
lying_face: 1f925.png
relieved: 1f60c.png
pensive: 1f614.png
sleepy: 1f62a.png
drooling_face: 1f924.png
sleeping: 1f634.png
mask: 1f637.png
face_with_thermometer: 1f912.png
face_with_head_bandage: 1f915.png
nauseated_face: 1f922.png
face_vomiting: 1f92e.png
sneezing_face: 1f927.png
hot_face: 1f975.png
cold_face: 1f976.png
woozy_face: 1f974.png
dizzy_face: 1f635.png
exploding_head: 1f92f.png
face_with_cowboy_hat: 1f920.png
partying_face: 1f973.png
sunglasses: 1f60e.png
nerd_face: 1f913.png
face_with_monocle: 1f9d0.png
confused: 1f615.png
worried: 1f61f.png
slightly_frowning_face: 1f641.png
white_frowning_face: 2639-fe0f.png
open_mouth: 1f62e.png
hushed: 1f62f.png
astonished: 1f632.png
flushed: 1f633.png
pleading_face: 1f97a.png
frowning: 1f626.png
anguished: 1f627.png
fearful: 1f628.png
cold_sweat: 1f630.png
disappointed_relieved: 1f625.png
cry: 1f622.png
sob: 1f62d.png
scream: 1f631.png
confounded: 1f616.png
persevere: 1f623.png
disappointed: 1f61e.png
sweat: 1f613.png
weary: 1f629.png
tired_face: 1f62b.png
yawning_face: 1f971.png
triumph: 1f624.png
rage: 1f621.png
angry: 1f620.png
face_with_symbols_on_mouth: 1f92c.png
smiling_imp: 1f608.png
imp: 1f47f.png
skull: 1f480.png
skull_and_crossbones: 2620-fe0f.png
hankey: 1f4a9.png
clown_face: 1f921.png
japanese_ogre: 1f479.png
japanese_goblin: 1f47a.png
ghost: 1f47b.png
alien: 1f47d.png
space_invader: 1f47e.png
robot_face: 1f916.png
smiley_cat: 1f63a.png
smile_cat: 1f638.png
joy_cat: 1f639.png
heart_eyes_cat: 1f63b.png
smirk_cat: 1f63c.png
kissing_cat: 1f63d.png
scream_cat: 1f640.png
crying_cat_face: 1f63f.png
pouting_cat: 1f63e.png
see_no_evil: 1f648.png
hear_no_evil: 1f649.png
speak_no_evil: 1f64a.png
kiss: 1f48b.png
love_letter: 1f48c.png
cupid: 1f498.png
gift_heart: 1f49d.png
sparkling_heart: 1f496.png
heartpulse: 1f497.png
heartbeat: 1f493.png
revolving_hearts: 1f49e.png
two_hearts: 1f495.png
heart_decoration: 1f49f.png
heavy_heart_exclamation_mark_ornament: 2763-fe0f.png
broken_heart: 1f494.png
heart: 2764-fe0f.png
orange_heart: 1f9e1.png
yellow_heart: 1f49b.png
green_heart: 1f49a.png
blue_heart: 1f499.png
purple_heart: 1f49c.png
brown_heart: 1f90e.png
black_heart: 1f5a4.png
white_heart: 1f90d.png
anger: 1f4a2.png
boom: 1f4a5.png
dizzy: 1f4ab.png
sweat_drops: 1f4a6.png
dash: 1f4a8.png
hole: 1f573-fe0f.png
bomb: 1f4a3.png
speech_balloon: 1f4ac.png
left_speech_bubble: 1f5e8-fe0f.png
right_anger_bubble: 1f5ef-fe0f.png
thought_balloon: 1f4ad.png
zzz: 1f4a4.png

View file

@ -0,0 +1,150 @@
emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-facebook@5.0.1/img/facebook/64/'
emojiMaps:
'100': 1f4af.png
grinning: 1f600.png
smiley: 1f603.png
smile: 1f604.png
grin: 1f601.png
laughing: 1f606.png
sweat_smile: 1f605.png
rolling_on_the_floor_laughing: 1f923.png
joy: 1f602.png
slightly_smiling_face: 1f642.png
upside_down_face: 1f643.png
wink: 1f609.png
blush: 1f60a.png
innocent: 1f607.png
smiling_face_with_3_hearts: 1f970.png
heart_eyes: 1f60d.png
star-struck: 1f929.png
kissing_heart: 1f618.png
kissing: 1f617.png
relaxed: 263a-fe0f.png
kissing_closed_eyes: 1f61a.png
kissing_smiling_eyes: 1f619.png
yum: 1f60b.png
stuck_out_tongue: 1f61b.png
stuck_out_tongue_winking_eye: 1f61c.png
zany_face: 1f92a.png
stuck_out_tongue_closed_eyes: 1f61d.png
money_mouth_face: 1f911.png
hugging_face: 1f917.png
face_with_hand_over_mouth: 1f92d.png
shushing_face: 1f92b.png
thinking_face: 1f914.png
zipper_mouth_face: 1f910.png
face_with_raised_eyebrow: 1f928.png
neutral_face: 1f610.png
expressionless: 1f611.png
no_mouth: 1f636.png
smirk: 1f60f.png
unamused: 1f612.png
face_with_rolling_eyes: 1f644.png
grimacing: 1f62c.png
lying_face: 1f925.png
relieved: 1f60c.png
pensive: 1f614.png
sleepy: 1f62a.png
drooling_face: 1f924.png
sleeping: 1f634.png
mask: 1f637.png
face_with_thermometer: 1f912.png
face_with_head_bandage: 1f915.png
nauseated_face: 1f922.png
face_vomiting: 1f92e.png
sneezing_face: 1f927.png
hot_face: 1f975.png
cold_face: 1f976.png
woozy_face: 1f974.png
dizzy_face: 1f635.png
exploding_head: 1f92f.png
face_with_cowboy_hat: 1f920.png
partying_face: 1f973.png
sunglasses: 1f60e.png
nerd_face: 1f913.png
face_with_monocle: 1f9d0.png
confused: 1f615.png
worried: 1f61f.png
slightly_frowning_face: 1f641.png
white_frowning_face: 2639-fe0f.png
open_mouth: 1f62e.png
hushed: 1f62f.png
astonished: 1f632.png
flushed: 1f633.png
pleading_face: 1f97a.png
frowning: 1f626.png
anguished: 1f627.png
fearful: 1f628.png
cold_sweat: 1f630.png
disappointed_relieved: 1f625.png
cry: 1f622.png
sob: 1f62d.png
scream: 1f631.png
confounded: 1f616.png
persevere: 1f623.png
disappointed: 1f61e.png
sweat: 1f613.png
weary: 1f629.png
tired_face: 1f62b.png
yawning_face: 1f971.png
triumph: 1f624.png
rage: 1f621.png
angry: 1f620.png
face_with_symbols_on_mouth: 1f92c.png
smiling_imp: 1f608.png
imp: 1f47f.png
skull: 1f480.png
skull_and_crossbones: 2620-fe0f.png
hankey: 1f4a9.png
clown_face: 1f921.png
japanese_ogre: 1f479.png
japanese_goblin: 1f47a.png
ghost: 1f47b.png
alien: 1f47d.png
space_invader: 1f47e.png
robot_face: 1f916.png
smiley_cat: 1f63a.png
smile_cat: 1f638.png
joy_cat: 1f639.png
heart_eyes_cat: 1f63b.png
smirk_cat: 1f63c.png
kissing_cat: 1f63d.png
scream_cat: 1f640.png
crying_cat_face: 1f63f.png
pouting_cat: 1f63e.png
see_no_evil: 1f648.png
hear_no_evil: 1f649.png
speak_no_evil: 1f64a.png
kiss: 1f48b.png
love_letter: 1f48c.png
cupid: 1f498.png
gift_heart: 1f49d.png
sparkling_heart: 1f496.png
heartpulse: 1f497.png
heartbeat: 1f493.png
revolving_hearts: 1f49e.png
two_hearts: 1f495.png
heart_decoration: 1f49f.png
heavy_heart_exclamation_mark_ornament: 2763-fe0f.png
broken_heart: 1f494.png
heart: 2764-fe0f.png
orange_heart: 1f9e1.png
yellow_heart: 1f49b.png
green_heart: 1f49a.png
blue_heart: 1f499.png
purple_heart: 1f49c.png
brown_heart: 1f90e.png
black_heart: 1f5a4.png
white_heart: 1f90d.png
anger: 1f4a2.png
boom: 1f4a5.png
dizzy: 1f4ab.png
sweat_drops: 1f4a6.png
dash: 1f4a8.png
hole: 1f573-fe0f.png
bomb: 1f4a3.png
speech_balloon: 1f4ac.png
left_speech_bubble: 1f5e8-fe0f.png
right_anger_bubble: 1f5ef-fe0f.png
thought_balloon: 1f4ad.png
zzz: 1f4a4.png

View file

@ -0,0 +1,150 @@
emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-google@5.0.1/img/google/64/'
emojiMaps:
'100': 1f4af.png
grinning: 1f600.png
smiley: 1f603.png
smile: 1f604.png
grin: 1f601.png
laughing: 1f606.png
sweat_smile: 1f605.png
rolling_on_the_floor_laughing: 1f923.png
joy: 1f602.png
slightly_smiling_face: 1f642.png
upside_down_face: 1f643.png
wink: 1f609.png
blush: 1f60a.png
innocent: 1f607.png
smiling_face_with_3_hearts: 1f970.png
heart_eyes: 1f60d.png
star-struck: 1f929.png
kissing_heart: 1f618.png
kissing: 1f617.png
relaxed: 263a-fe0f.png
kissing_closed_eyes: 1f61a.png
kissing_smiling_eyes: 1f619.png
yum: 1f60b.png
stuck_out_tongue: 1f61b.png
stuck_out_tongue_winking_eye: 1f61c.png
zany_face: 1f92a.png
stuck_out_tongue_closed_eyes: 1f61d.png
money_mouth_face: 1f911.png
hugging_face: 1f917.png
face_with_hand_over_mouth: 1f92d.png
shushing_face: 1f92b.png
thinking_face: 1f914.png
zipper_mouth_face: 1f910.png
face_with_raised_eyebrow: 1f928.png
neutral_face: 1f610.png
expressionless: 1f611.png
no_mouth: 1f636.png
smirk: 1f60f.png
unamused: 1f612.png
face_with_rolling_eyes: 1f644.png
grimacing: 1f62c.png
lying_face: 1f925.png
relieved: 1f60c.png
pensive: 1f614.png
sleepy: 1f62a.png
drooling_face: 1f924.png
sleeping: 1f634.png
mask: 1f637.png
face_with_thermometer: 1f912.png
face_with_head_bandage: 1f915.png
nauseated_face: 1f922.png
face_vomiting: 1f92e.png
sneezing_face: 1f927.png
hot_face: 1f975.png
cold_face: 1f976.png
woozy_face: 1f974.png
dizzy_face: 1f635.png
exploding_head: 1f92f.png
face_with_cowboy_hat: 1f920.png
partying_face: 1f973.png
sunglasses: 1f60e.png
nerd_face: 1f913.png
face_with_monocle: 1f9d0.png
confused: 1f615.png
worried: 1f61f.png
slightly_frowning_face: 1f641.png
white_frowning_face: 2639-fe0f.png
open_mouth: 1f62e.png
hushed: 1f62f.png
astonished: 1f632.png
flushed: 1f633.png
pleading_face: 1f97a.png
frowning: 1f626.png
anguished: 1f627.png
fearful: 1f628.png
cold_sweat: 1f630.png
disappointed_relieved: 1f625.png
cry: 1f622.png
sob: 1f62d.png
scream: 1f631.png
confounded: 1f616.png
persevere: 1f623.png
disappointed: 1f61e.png
sweat: 1f613.png
weary: 1f629.png
tired_face: 1f62b.png
yawning_face: 1f971.png
triumph: 1f624.png
rage: 1f621.png
angry: 1f620.png
face_with_symbols_on_mouth: 1f92c.png
smiling_imp: 1f608.png
imp: 1f47f.png
skull: 1f480.png
skull_and_crossbones: 2620-fe0f.png
hankey: 1f4a9.png
clown_face: 1f921.png
japanese_ogre: 1f479.png
japanese_goblin: 1f47a.png
ghost: 1f47b.png
alien: 1f47d.png
space_invader: 1f47e.png
robot_face: 1f916.png
smiley_cat: 1f63a.png
smile_cat: 1f638.png
joy_cat: 1f639.png
heart_eyes_cat: 1f63b.png
smirk_cat: 1f63c.png
kissing_cat: 1f63d.png
scream_cat: 1f640.png
crying_cat_face: 1f63f.png
pouting_cat: 1f63e.png
see_no_evil: 1f648.png
hear_no_evil: 1f649.png
speak_no_evil: 1f64a.png
kiss: 1f48b.png
love_letter: 1f48c.png
cupid: 1f498.png
gift_heart: 1f49d.png
sparkling_heart: 1f496.png
heartpulse: 1f497.png
heartbeat: 1f493.png
revolving_hearts: 1f49e.png
two_hearts: 1f495.png
heart_decoration: 1f49f.png
heavy_heart_exclamation_mark_ornament: 2763-fe0f.png
broken_heart: 1f494.png
heart: 2764-fe0f.png
orange_heart: 1f9e1.png
yellow_heart: 1f49b.png
green_heart: 1f49a.png
blue_heart: 1f499.png
purple_heart: 1f49c.png
brown_heart: 1f90e.png
black_heart: 1f5a4.png
white_heart: 1f90d.png
anger: 1f4a2.png
boom: 1f4a5.png
dizzy: 1f4ab.png
sweat_drops: 1f4a6.png
dash: 1f4a8.png
hole: 1f573-fe0f.png
bomb: 1f4a3.png
speech_balloon: 1f4ac.png
left_speech_bubble: 1f5e8-fe0f.png
right_anger_bubble: 1f5ef-fe0f.png
thought_balloon: 1f4ad.png
zzz: 1f4a4.png

View file

@ -0,0 +1,150 @@
emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-twitter@5.0.1/img/twitter/64/'
emojiMaps:
'100': 1f4af.png
grinning: 1f600.png
smiley: 1f603.png
smile: 1f604.png
grin: 1f601.png
laughing: 1f606.png
sweat_smile: 1f605.png
rolling_on_the_floor_laughing: 1f923.png
joy: 1f602.png
slightly_smiling_face: 1f642.png
upside_down_face: 1f643.png
wink: 1f609.png
blush: 1f60a.png
innocent: 1f607.png
smiling_face_with_3_hearts: 1f970.png
heart_eyes: 1f60d.png
star-struck: 1f929.png
kissing_heart: 1f618.png
kissing: 1f617.png
relaxed: 263a-fe0f.png
kissing_closed_eyes: 1f61a.png
kissing_smiling_eyes: 1f619.png
yum: 1f60b.png
stuck_out_tongue: 1f61b.png
stuck_out_tongue_winking_eye: 1f61c.png
zany_face: 1f92a.png
stuck_out_tongue_closed_eyes: 1f61d.png
money_mouth_face: 1f911.png
hugging_face: 1f917.png
face_with_hand_over_mouth: 1f92d.png
shushing_face: 1f92b.png
thinking_face: 1f914.png
zipper_mouth_face: 1f910.png
face_with_raised_eyebrow: 1f928.png
neutral_face: 1f610.png
expressionless: 1f611.png
no_mouth: 1f636.png
smirk: 1f60f.png
unamused: 1f612.png
face_with_rolling_eyes: 1f644.png
grimacing: 1f62c.png
lying_face: 1f925.png
relieved: 1f60c.png
pensive: 1f614.png
sleepy: 1f62a.png
drooling_face: 1f924.png
sleeping: 1f634.png
mask: 1f637.png
face_with_thermometer: 1f912.png
face_with_head_bandage: 1f915.png
nauseated_face: 1f922.png
face_vomiting: 1f92e.png
sneezing_face: 1f927.png
hot_face: 1f975.png
cold_face: 1f976.png
woozy_face: 1f974.png
dizzy_face: 1f635.png
exploding_head: 1f92f.png
face_with_cowboy_hat: 1f920.png
partying_face: 1f973.png
sunglasses: 1f60e.png
nerd_face: 1f913.png
face_with_monocle: 1f9d0.png
confused: 1f615.png
worried: 1f61f.png
slightly_frowning_face: 1f641.png
white_frowning_face: 2639-fe0f.png
open_mouth: 1f62e.png
hushed: 1f62f.png
astonished: 1f632.png
flushed: 1f633.png
pleading_face: 1f97a.png
frowning: 1f626.png
anguished: 1f627.png
fearful: 1f628.png
cold_sweat: 1f630.png
disappointed_relieved: 1f625.png
cry: 1f622.png
sob: 1f62d.png
scream: 1f631.png
confounded: 1f616.png
persevere: 1f623.png
disappointed: 1f61e.png
sweat: 1f613.png
weary: 1f629.png
tired_face: 1f62b.png
yawning_face: 1f971.png
triumph: 1f624.png
rage: 1f621.png
angry: 1f620.png
face_with_symbols_on_mouth: 1f92c.png
smiling_imp: 1f608.png
imp: 1f47f.png
skull: 1f480.png
skull_and_crossbones: 2620-fe0f.png
hankey: 1f4a9.png
clown_face: 1f921.png
japanese_ogre: 1f479.png
japanese_goblin: 1f47a.png
ghost: 1f47b.png
alien: 1f47d.png
space_invader: 1f47e.png
robot_face: 1f916.png
smiley_cat: 1f63a.png
smile_cat: 1f638.png
joy_cat: 1f639.png
heart_eyes_cat: 1f63b.png
smirk_cat: 1f63c.png
kissing_cat: 1f63d.png
scream_cat: 1f640.png
crying_cat_face: 1f63f.png
pouting_cat: 1f63e.png
see_no_evil: 1f648.png
hear_no_evil: 1f649.png
speak_no_evil: 1f64a.png
kiss: 1f48b.png
love_letter: 1f48c.png
cupid: 1f498.png
gift_heart: 1f49d.png
sparkling_heart: 1f496.png
heartpulse: 1f497.png
heartbeat: 1f493.png
revolving_hearts: 1f49e.png
two_hearts: 1f495.png
heart_decoration: 1f49f.png
heavy_heart_exclamation_mark_ornament: 2763-fe0f.png
broken_heart: 1f494.png
heart: 2764-fe0f.png
orange_heart: 1f9e1.png
yellow_heart: 1f49b.png
green_heart: 1f49a.png
blue_heart: 1f499.png
purple_heart: 1f49c.png
brown_heart: 1f90e.png
black_heart: 1f5a4.png
white_heart: 1f90d.png
anger: 1f4a2.png
boom: 1f4a5.png
dizzy: 1f4ab.png
sweat_drops: 1f4a6.png
dash: 1f4a8.png
hole: 1f573-fe0f.png
bomb: 1f4a3.png
speech_balloon: 1f4ac.png
left_speech_bubble: 1f5e8-fe0f.png
right_anger_bubble: 1f5ef-fe0f.png
thought_balloon: 1f4ad.png
zzz: 1f4a4.png

View file

@ -0,0 +1,22 @@
theme:
- html5shiv
- Object.values
- Promise
- fetch
- Element.prototype.after
smooth-scroll:
- Element.prototype.closest
- requestAnimationFrame
- CustomEvent
algoliasearch:
- Promise
- Object.entries
- Object.assign
TypeIt:
- Array.prototype.fill
- Array.prototype.find
- Array.from
- IntersectionObserver
- Math.sign
- Object.assign
- Promise

View file

@ -0,0 +1,511 @@
# 001: Github
github:
Weight: 1
Prefix: https://github.com/
Title: GitHub
Icon:
Class: fab fa-github-alt fa-fw
# 002: LinkedIn
linkedin:
Weight: 2
Prefix: https://linkedin.com/in/
Title: LinkedIn
Icon:
Class: fab fa-linkedin fa-fw
# 003: Twitter
twitter:
Weight: 3
Prefix: https://twitter.com/
Title: Twitter
Icon:
Class: fab fa-twitter fa-fw
# 004: Instagram
instagram:
Weight: 4
Prefix: https://www.instagram.com/
Title: Instagram
Icon:
Class: fab fa-instagram fa-fw
# 005: facebook
facebook:
Weight: 5
Prefix: https://facebook.com/
Title: facebook
Icon:
Class: fab fa-facebook fa-fw
# 006: Telegram
telegram:
Weight: 6
Prefix: https://t.me/
Title: Telegram
Icon:
Class: fab fa-telegram-plane fa-fw
# 007: Medium
medium:
Weight: 7
Prefix: https://medium.com/
Title: Medium
Icon:
Class: fab fa-medium fa-fw
# 008: GitLab
gitlab:
Weight: 8
Prefix: https://gitlab.com/
Title: GitLab
Icon:
Class: fab fa-gitlab fa-fw
# 009: YouTube Legacy
youtubelegacy:
Weight: 9
Prefix: https://www.youtube.com/user/
Title: YouTube
Icon:
Class: fab fa-youtube fa-fw
# 010: YouTube Custom
youtubecustom:
Weight: 10
Prefix: https://www.youtube.com/c/
Title: YouTube
Icon:
Class: fab fa-youtube fa-fw
# 011: YouTube Channel
youtubechannel:
Weight: 11
Prefix: https://www.youtube.com/channel/
Title: YouTube
Icon:
Class: fab fa-youtube fa-fw
# 012: Tumblr
tumblr:
Weight: 12
Template: https://%v.tumblr.com/
Title: Tumblr
Icon:
Class: fab fa-tumblr fa-fw
# 013: Quora
quora:
Weight: 13
Prefix: https://www.quora.com/profile/
Title: Quora
Icon:
Class: fab fa-quora fa-fw
# 014: Keybase
keybase:
Weight: 14
Prefix: https://keybase.io/
Title: Keybase
Icon:
Class: fab fa-keybase fa-fw
# 015: Pinterest
pinterest:
Weight: 15
Prefix: https://www.pinterest.com/
Title: Pinterest
Icon:
Class: fab fa-pinterest fa-fw
# 016: Reddit
reddit:
Weight: 16
Prefix: https://www.reddit.com/user/
Title: Reddit
Icon:
Class: fab fa-reddit fa-fw
# 017: CodePen
codepen:
Weight: 17
Prefix: https://codepen.io/
Title: CodePen
Icon:
Class: fab fa-codepen fa-fw
# 018: freeCodeCamp
freecodecamp:
Weight: 18
Prefix: https://freecodecamp.org/
Title: freeCodeCamp
Icon:
Class: fab fa-free-code-camp fa-fw
# 019: Bitbucket
bitbucket:
Weight: 19
Prefix: https://bitbucket.org/
Title: Bitbucket
Icon:
Class: fab fa-bitbucket fa-fw
# 020: Stack Overflow
stackoverflow:
Weight: 20
Prefix: https://stackoverflow.com/users/
Title: Stack Overflow
Icon:
Class: fab fa-codepen fa-fw
# 021: 微博
weibo:
Weight: 21
Prefix: https://weibo.com/
Title: 微博
Icon:
Class: fab fa-weibo fa-fw
# 022: OK.RU
odnoklassniki:
Weight: 22
Prefix: https://ok.ru/
Title: OK.RU
Icon:
Class: fab fa-odnoklassniki fa-fw
# 023: VK
vk:
Weight: 23
Prefix: https://vk.com/
Title: VK
Icon:
Class: fab fa-vk fa-fw
# 024: Flickr
flickr:
Weight: 24
Prefix: https://www.flickr.com/photos/
Title: Flickr
Icon:
Class: fab fa-flickr fa-fw
# 025: Xing
xing:
Weight: 25
Prefix: https://www.xing.com/profile/
Title: Xing
Icon:
Class: fab fa-xing fa-fw
# 026: Snapchat
snapchat:
Weight: 26
Prefix: https://www.snapchat.com/add/
Title: Snapchat
Icon:
Class: fab fa-snapchat fa-fw
# 027: SoundCloud
soundcloud:
Weight: 27
Prefix: https://soundcloud.com/
Title: SoundCloud
Icon:
Class: fab fa-soundcloud fa-fw
# 028: Spotify
spotify:
Weight: 28
Prefix: https://open.spotify.com/user/
Title: Spotify
Icon:
Class: fab fa-spotify fa-fw
# 029: Bandcamp
bandcamp:
Weight: 29
Template: https://%v.bandcamp.com/
Title: Bandcamp
Icon:
Class: fab fa-bandcamp fa-fw
# 030: PayPal
paypal:
Weight: 30
Prefix: https://paypal.me/
Title: PayPal
Icon:
Class: fab fa-paypal fa-fw
# 031: 500px
fivehundredpx:
Weight: 31
Prefix: https://500px.com/
Title: 500px
Icon:
Class: fab fa-500px fa-fw
# 032: Mix
mix:
Weight: 32
Prefix: https://mix.com/
Title: Mix
Icon:
Class: fab fa-mix fa-fw
# 033: Goodreads
goodreads:
Weight: 33
Prefix: https://www.goodreads.com/user/show/
Title: Goodreads
Icon:
Class: fab fa-goodreads fa-fw
# 034: Last.fm
lastfm:
Weight: 34
Prefix: https://www.last.fm/user/
Title: Last.fm
Icon:
Class: fab fa-lastfm fa-fw
# 035: Foursquare
foursquare:
Weight: 35
Prefix: https://foursquare.com/
Title: Foursquare
Icon:
Class: fab fa-foursquare fa-fw
# 036: Hacker News
hackernews:
Weight: 36
Template: https://news.ycombinator.com/user?id=%v
Title: Hacker News
Icon:
Class: fab fa-hacker-news fa-fw
# 037: Kickstarter
kickstarter:
Weight: 37
Prefix: https://kickstarter.com/profile/
Title: Kickstarter
Icon:
Class: fab fa-kickstarter fa-fw
# 038: Patreon
patreon:
Weight: 38
Prefix: https://patreon.com/
Title: Patreon
Icon:
Class: fab fa-patreon fa-fw
# 039: Steam
steam:
Weight: 39
Prefix: https://steamcommunity.com/id/
Title: Steam
Icon:
Class: fab fa-steam fa-fw
# 040: Twitch
twitch:
Weight: 40
Prefix: https://www.twitch.tv/
Title: Twitch
Icon:
Class: fab fa-twitch fa-fw
# 041: Strava
strava:
Weight: 41
Prefix: https://www.strava.com/athletes/
Title: Strava
Icon:
Class: fab fa-strava fa-fw
# 042: Skype
skype:
Weight: 42
Template: "skype:"
Title: Skype
Icon:
Class: fab fa-skype fa-fw
# 043: WhatsApp
whatsapp:
Weight: 43
Prefix: https://wa.me/
Title: WhatsApp
Icon:
Class: fab fa-whatsapp fa-fw
# 044: 知乎
zhihu:
Weight: 44
Prefix: https://www.zhihu.com/people/
Title: 知乎
Icon:
Simpleicons: zhihu
# 045: 豆瓣
douban:
Weight: 45
Prefix: https://www.douban.com/people/
Title: 豆瓣
Icon:
Simpleicons: douban
# 046: Angellist
angellist:
Weight: 46
Prefix: https://angel.co/
Title: Angellist
Icon:
Class: fab fa-angellist fa-fw
# 047: SlideShare
slideshare:
Weight: 47
Prefix: https://slideshare.com/
Title: SlideShare
Icon:
Class: fab fa-slideshare fa-fw
# 048: JSFiddle
jsfiddle:
Weight: 48
Prefix: https://jsfiddle.com/
Title: JSFiddle
Icon:
Class: fab fa-jsfiddle fa-fw
# 049: DeviantArt
deviantart:
Weight: 49
Template: https://%v.deviantart.com/
Title: DeviantArt
Icon:
Class: fab fa-deviantart fa-fw
# 050: Behance
behance:
Weight: 50
Prefix: https://behance.net/
Title: Behance
Icon:
Class: fab fa-behance fa-fw
# 051: Dribbble
dribbble:
Weight: 51
Prefix: https://dribbble.com/
Title: Dribbble
Icon:
Class: fab fa-dribbble fa-fw
# 052: WordPress
wordpress:
Weight: 52
Template: https://%v.wordpress.com/
Title: WordPress
Icon:
Class: fab fa-wordpress fa-fw
# 053: Vine
vine:
Weight: 53
Prefix: https://vine.co/
Title: Vine
Icon:
Class: fab fa-vine fa-fw
# 054: Google Scholar
googlescholar:
Weight: 54
Template: https://scholar.google.com/citations?%v
Title: Google Scholar
Icon:
Simpleicons: googlescholar
# 055: ResearchGate
researchgate:
Weight: 55
Prefix: https://www.researchgate.net/profile/
Title: ResearchGate
Icon:
Class: fab fa-researchgate fa-fw
# 056: Mastodon
mastodon:
Weight: 56
Prefix: https://mastodon.social/
Title: Mastodon
Icon:
Class: fab fa-mastodon fa-fw
# 057: Thingiverse
thingiverse:
Weight: 57
Prefix: https://www.thingiverse.com/
Title: Thingiverse
Icon:
Src: svg/icons/thingiverse.svg
# 058: Dev.To
devto:
Weight: 58
Prefix: https://dev.to/
Title: Dev.To
Icon:
Class: fab fa-dev fa-fw
# 059: Gitea
gitea:
Weight: 59
Title: Gitea
Icon:
Simpleicons: gitea
# 060: XMPP
xmpp:
Weight: 60
Template: xmpp:%v
Title: XMPP
Icon:
Simpleicons: xmpp
# 061: Matrix
matrix:
Weight: 61
Prefix: https://matrix.to/#/
Title: Matrix
Icon:
Simpleicons: matrix
# 062: bilibili
bilibili:
Weight: 62
Prefix: https://space.bilibili.com/
Title: bilibili
Icon:
Src: svg/icons/bilibili.svg
# 063: Email
email:
Weight: 63
Template: mailto:%v
Title: Email
Icon:
Class: far fa-envelope fa-fw
# 064: RSS
rss:
Weight: 64
Url: /index.xml
Title: RSS
Newtab: true
Icon:
Class: fas fa-rss fa-fw

3
themes/CodeIT/assets/js/theme.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,26 @@
normalize.css@8.0.1 https://github.com/necolas/normalize.css
fontawesome-free@5.13.0 https://fontawesome.com/
simple-icons@2.14.0 https://github.com/simple-icons/simple-icons
animate.css@3.7.2 https://github.com/daneden/animate.css
smooth-scroll@16.1.3 https://github.com/cferdinandi/smooth-scroll
autocomplete.js@0.37.1 https://github.com/algolia/autocomplete.js
lunr.js@2.3.8 https://lunrjs.com/
algoliasearch@4.2.0 https://github.com/algolia/algoliasearch-client-javascript
lazysizes@5.2.2 https://github.com/aFarkas/lazysizes
object-fit-images@3.2.4 https://github.com/fregante/object-fit-images
twemoji@13.0.0 https://github.com/twitter/twemoji
lightgallery.js@1.2.0 https://github.com/sachinchoolur/lightgallery.js
lg-thumbnail.js@1.2.0 https://github.com/sachinchoolur/lg-thumbnail.js
lg-zoom.js@1.2.0 https://github.com/sachinchoolur/lg-zoom.js
clipboard.js@2.0.6 https://github.com/zenorocha/clipboard.js
sharer.js@0.4.0 https://github.com/ellisonleao/sharer.js
typeit@7.0.4 https://github.com/alexmacarthur/typeit
katex@0.11.1 https://katex.org/
mermaid@8.5.1 https://github.com/knsv/mermaid
echarts@4.8.0 https://echarts.apache.org/
mapbox-gl@1.10.1 https://github.com/mapbox/mapbox-gl-js
aplayer@1.10.1 https://github.com/MoePlayer/APlayer
meting@2.0.1 https://github.com/metowolf/MetingJS
gitalk@1.6.2 https://github.com/gitalk/gitalk
valine@1.4.14 https://valine.js.org/
cookieconsent@3.1.1 https://github.com/osano/cookieconsent

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,136 @@
[theme="dark"] .aplayer {
background: #212121;
&.aplayer-withlist {
.aplayer-info {
border-bottom-color: #5c5c5c;
}
}
&.aplayer-fixed {
.aplayer-list {
border-color: #5c5c5c;
}
}
.aplayer-body {
background-color: #212121;
}
.aplayer-info {
border-top-color: #212121;
}
.aplayer-info {
.aplayer-music {
.aplayer-title {
color: #fff;
}
.aplayer-author {
color: #fff;
}
}
.aplayer-controller {
.aplayer-time {
color: #eee;
.aplayer-icon {
path {
fill: #eee;
}
}
}
}
}
.aplayer-list {
background-color: #212121;
&::-webkit-scrollbar-thumb {
background-color: #999;
}
&::-webkit-scrollbar-thumb:hover {
background-color: #bbb;
}
li {
color: #fff;
border-top-color: #666;
&:hover {
background: #4e4e4e;
}
&.aplayer-list-light {
background: #6c6c6c;
}
.aplayer-list-index {
color: #ddd;
}
.aplayer-list-author {
color: #ddd;
}
}
}
.aplayer-lrc {
text-shadow: -1px -1px 0 #666;
&:before {
background: -moz-linear-gradient(
top,
rgba(33, 33, 33, 1) 0%,
rgba(33, 33, 33, 0) 100%
);
background: -webkit-linear-gradient(
top,
rgba(33, 33, 33, 1) 0%,
rgba(33, 33, 33, 0) 100%
);
background: linear-gradient(
to bottom,
rgba(33, 33, 33, 1) 0%,
rgba(33, 33, 33, 0) 100%
);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#212121', endColorstr='#00212121',GradientType=0 );
}
&:after {
background: -moz-linear-gradient(
top,
rgba(33, 33, 33, 0) 0%,
rgba(33, 33, 33, 0.8) 100%
);
background: -webkit-linear-gradient(
top,
rgba(33, 33, 33, 0) 0%,
rgba(33, 33, 33, 0.8) 100%
);
background: linear-gradient(
to bottom,
rgba(33, 33, 33, 0) 0%,
rgba(33, 33, 33, 0.8) 100%
);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00212121', endColorstr='#cc212121',GradientType=0 );
}
p {
color: #fff;
}
}
.aplayer-miniswitcher {
background: #484848;
.aplayer-icon {
path {
fill: #eee;
}
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,6 @@
.cc-window{opacity:1;-webkit-transition:opacity 1s ease;transition:opacity 1s ease}.cc-window.cc-invisible{opacity:0}.cc-animate.cc-revoke{-webkit-transition:transform 1s ease;-webkit-transition:-webkit-transform 1s ease;transition:-webkit-transform 1s ease;transition:transform 1s ease;transition:transform 1s ease,-webkit-transform 1s ease}.cc-animate.cc-revoke.cc-top{-webkit-transform:translateY(-2em);transform:translateY(-2em)}.cc-animate.cc-revoke.cc-bottom{-webkit-transform:translateY(2em);transform:translateY(2em)}.cc-animate.cc-revoke.cc-active.cc-top{-webkit-transform:translateY(0);transform:translateY(0)}.cc-animate.cc-revoke.cc-active.cc-bottom{-webkit-transform:translateY(0);transform:translateY(0)}.cc-revoke:hover{-webkit-transform:translateY(0);transform:translateY(0)}.cc-grower{max-height:0;overflow:hidden;-webkit-transition:max-height 1s;transition:max-height 1s}
.cc-revoke,.cc-window{position:fixed;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:Helvetica,Calibri,Arial,sans-serif;font-size:16px;line-height:1.5em;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;z-index:9999}.cc-window.cc-static{position:static}.cc-window.cc-floating{padding:2em;max-width:24em;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.cc-window.cc-banner{padding:1em 1.8em;width:100%;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.cc-revoke{padding:.5em}.cc-revoke:hover{text-decoration:underline}.cc-header{font-size:18px;font-weight:700}.cc-btn,.cc-close,.cc-link,.cc-revoke{cursor:pointer}.cc-link{opacity:.8;display:inline-block;padding:.2em;text-decoration:underline}.cc-link:hover{opacity:1}.cc-link:active,.cc-link:visited{color:initial}.cc-btn{display:block;padding:.4em .8em;font-size:.9em;font-weight:700;border-width:2px;border-style:solid;text-align:center;white-space:nowrap}.cc-highlight .cc-btn:first-child{background-color:transparent;border-color:transparent}.cc-highlight .cc-btn:first-child:focus,.cc-highlight .cc-btn:first-child:hover{background-color:transparent;text-decoration:underline}.cc-close{display:block;position:absolute;top:.5em;right:.5em;font-size:1.6em;opacity:.9;line-height:.75}.cc-close:focus,.cc-close:hover{opacity:1}
.cc-revoke.cc-top{top:0;left:3em;border-bottom-left-radius:.5em;border-bottom-right-radius:.5em}.cc-revoke.cc-bottom{bottom:0;left:3em;border-top-left-radius:.5em;border-top-right-radius:.5em}.cc-revoke.cc-left{left:3em;right:unset}.cc-revoke.cc-right{right:3em;left:unset}.cc-top{top:1em}.cc-left{left:1em}.cc-right{right:1em}.cc-bottom{bottom:1em}.cc-floating>.cc-link{margin-bottom:1em}.cc-floating .cc-message{display:block;margin-bottom:1em}.cc-window.cc-floating .cc-compliance{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto}.cc-window.cc-banner{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.cc-banner.cc-top{left:0;right:0;top:0}.cc-banner.cc-bottom{left:0;right:0;bottom:0}.cc-banner .cc-message{display:block;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;max-width:100%;margin-right:1em}.cc-compliance{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:justify;align-content:space-between}.cc-floating .cc-compliance>.cc-btn{-webkit-box-flex:1;-ms-flex:1;flex:1}.cc-btn+.cc-btn{margin-left:.5em}
@media print{.cc-revoke,.cc-window{display:none}}@media screen and (max-width:900px){.cc-btn{white-space:normal}}@media screen and (max-width:414px) and (orientation:portrait),screen and (max-width:736px) and (orientation:landscape){.cc-window.cc-top{top:0}.cc-window.cc-bottom{bottom:0}.cc-window.cc-banner,.cc-window.cc-floating,.cc-window.cc-left,.cc-window.cc-right{left:0;right:0}.cc-window.cc-banner{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.cc-window.cc-banner .cc-compliance{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto}.cc-window.cc-floating{max-width:none}.cc-window .cc-message{margin-bottom:1em}.cc-window.cc-banner{-webkit-box-align:unset;-ms-flex-align:unset;align-items:unset}.cc-window.cc-banner .cc-message{margin-right:0}}
.cc-floating.cc-theme-classic{padding:1.2em;border-radius:5px}.cc-floating.cc-type-info.cc-theme-classic .cc-compliance{text-align:center;display:inline;-webkit-box-flex:0;-ms-flex:none;flex:none}.cc-theme-classic .cc-btn{border-radius:5px}.cc-theme-classic .cc-btn:last-child{min-width:140px}.cc-floating.cc-type-info.cc-theme-classic .cc-btn{display:inline-block}
.cc-theme-edgeless.cc-window{padding:0}.cc-floating.cc-theme-edgeless .cc-message{margin:2em;margin-bottom:1.5em}.cc-banner.cc-theme-edgeless .cc-btn{margin:0;padding:.8em 1.8em;height:100%}.cc-banner.cc-theme-edgeless .cc-message{margin-left:1em}.cc-floating.cc-theme-edgeless .cc-btn+.cc-btn{margin-left:0}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,240 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
(function (root, factory) {
if (typeof define === "function" && define.amd) {
// AMD. Register as an anonymous module.
define(["exports", "echarts"], factory);
} else if (
typeof exports === "object" &&
typeof exports.nodeName !== "string"
) {
// CommonJS
factory(exports, require("echarts"));
} else {
// Browser globals
factory({}, root.echarts);
}
})(this, function (exports, echarts) {
var log = function (msg) {
if (typeof console !== "undefined") {
console && console.error && console.error(msg);
}
};
if (!echarts) {
log("ECharts is not Loaded");
return;
}
var colorPalette = [
"#2ec7c9",
"#b6a2de",
"#5ab1ef",
"#ffb980",
"#d87a80",
"#8d98b3",
"#e5cf0d",
"#97b552",
"#95706d",
"#dc69aa",
"#07a2a4",
"#9a7fd1",
"#588dd5",
"#f5994e",
"#c05050",
"#59678c",
"#c9ab00",
"#7eb00a",
"#6f5553",
"#c14089",
];
var theme = {
color: colorPalette,
title: {
textStyle: {
fontWeight: "normal",
color: "#008acd",
},
},
visualMap: {
itemWidth: 15,
color: ["#5ab1ef", "#e0ffff"],
},
toolbox: {
iconStyle: {
normal: {
borderColor: colorPalette[0],
},
},
},
tooltip: {
backgroundColor: "rgba(50,50,50,0.5)",
axisPointer: {
type: "line",
lineStyle: {
color: "#008acd",
},
crossStyle: {
color: "#008acd",
},
shadowStyle: {
color: "rgba(200,200,200,0.2)",
},
},
},
dataZoom: {
dataBackgroundColor: "#efefff",
fillerColor: "rgba(182,162,222,0.2)",
handleColor: "#008acd",
},
grid: {
borderColor: "#eee",
},
categoryAxis: {
axisLine: {
lineStyle: {
color: "#008acd",
},
},
splitLine: {
lineStyle: {
color: ["#eee"],
},
},
},
valueAxis: {
axisLine: {
lineStyle: {
color: "#008acd",
},
},
splitArea: {
show: true,
areaStyle: {
color: ["rgba(250,250,250,0.1)", "rgba(200,200,200,0.1)"],
},
},
splitLine: {
lineStyle: {
color: ["#eee"],
},
},
},
timeline: {
lineStyle: {
color: "#008acd",
},
controlStyle: {
color: "#008acd",
borderColor: "#008acd",
},
symbol: "emptyCircle",
symbolSize: 3,
},
line: {
smooth: true,
symbol: "emptyCircle",
symbolSize: 3,
},
candlestick: {
itemStyle: {
color: "#d87a80",
color0: "#2ec7c9",
},
lineStyle: {
width: 1,
color: "#d87a80",
color0: "#2ec7c9",
},
areaStyle: {
color: "#2ec7c9",
color0: "#b6a2de",
},
},
scatter: {
symbol: "circle",
symbolSize: 4,
},
map: {
itemStyle: {
color: "#ddd",
},
areaStyle: {
color: "#fe994e",
},
label: {
color: "#d87a80",
},
},
graph: {
itemStyle: {
color: "#d87a80",
},
linkStyle: {
color: "#2ec7c9",
},
},
gauge: {
axisLine: {
lineStyle: {
color: [
[0.2, "#2ec7c9"],
[0.8, "#5ab1ef"],
[1, "#d87a80"],
],
width: 10,
},
},
axisTick: {
splitNumber: 10,
length: 15,
lineStyle: {
color: "auto",
},
},
splitLine: {
length: 22,
lineStyle: {
color: "auto",
},
},
pointer: {
width: 5,
},
},
};
echarts.registerTheme("macarons", theme);
});

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n),a=function(e,t,r){for(var n=r,o=0,a=e.length;n<t.length;){var i=t[n];if(o<=0&&t.slice(n,n+a)===e)return n;"\\"===i?n++:"{"===i?o++:"}"===i&&o--,n++}return-1},i=function(e,t,r,n){for(var o=[],i=0;i<e.length;i++)if("text"===e[i].type){var l=e[i].data,d=!0,s=0,f=void 0;for(-1!==(f=l.indexOf(t))&&(s=f,o.push({type:"text",data:l.slice(0,s)}),d=!1);;){if(d){if(-1===(f=l.indexOf(t,s)))break;o.push({type:"text",data:l.slice(s,f)}),s=f}else{if(-1===(f=a(r,l,s+t.length)))break;o.push({type:"math",data:l.slice(s+t.length,f),rawData:l.slice(s,f+r.length),display:n}),s=f+r.length}d=!d}o.push({type:"text",data:l.slice(s)})}else o.push(e[i]);return o},l=function(e,t){for(var r=function(e,t){for(var r=[{type:"text",data:e}],n=0;n<t.length;n++){var o=t[n];r=i(r,o.left,o.right,o.display||!1)}return r}(e,t.delimiters),n=document.createDocumentFragment(),a=0;a<r.length;a++)if("text"===r[a].type)n.appendChild(document.createTextNode(r[a].data));else{var l=document.createElement("span"),d=r[a].data;t.displayMode=r[a].display;try{t.preProcess&&(d=t.preProcess(d)),o.a.render(d,l,t)}catch(e){if(!(e instanceof o.a.ParseError))throw e;t.errorCallback("KaTeX auto-render: Failed to parse `"+r[a].data+"` with ",e),n.appendChild(document.createTextNode(r[a].rawData));continue}n.appendChild(l)}return n};t.default=function(e,t){if(!e)throw new Error("No element provided to render");var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);r.delimiters=r.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\[",right:"\\]",display:!0}],r.ignoredTags=r.ignoredTags||["script","noscript","style","textarea","pre","code"],r.ignoredClasses=r.ignoredClasses||[],r.errorCallback=r.errorCallback||console.error,r.macros=r.macros||{},function e(t,r){for(var n=0;n<t.childNodes.length;n++){var o=t.childNodes[n];if(3===o.nodeType){var a=l(o.textContent,r);n+=a.childNodes.length-1,t.replaceChild(a,o)}else 1===o.nodeType&&function(){var t=" "+o.className+" ";-1===r.ignoredTags.indexOf(o.nodeName.toLowerCase())&&r.ignoredClasses.every(function(e){return-1===t.indexOf(" "+e+" ")})&&e(o,r)}()}}(e,r)}}]).default});

View file

@ -0,0 +1 @@
.katex,.katex-display{user-select:all;-moz-user-select:all;-webkit-user-select:all;-ms-user-select:all}

View file

@ -0,0 +1 @@
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){},function(e,t,n){"use strict";n.r(t);n(0);var r={inline:["$","$"],display:["$$","$$"]},o=function(e,t){void 0===t&&(t=r);for(var n=e.querySelectorAll(".katex-mathml + .katex-html"),o=0;o<n.length;o++){var l=n[o];l.remove?l.remove(null):l.parentNode.removeChild(l)}for(var i=e.querySelectorAll(".katex-mathml"),a=0;a<i.length;a++){var u=i[a],f=u.querySelector("annotation");f&&(u.replaceWith?u.replaceWith(f):u.parentNode.replaceChild(f,u),f.innerHTML=t.inline[0]+f.innerHTML+t.inline[1])}for(var c=e.querySelectorAll(".katex-display annotation"),d=0;d<c.length;d++){var p=c[d];p.innerHTML=t.display[0]+p.innerHTML.substr(t.inline[0].length,p.innerHTML.length-t.inline[0].length-t.inline[1].length)+t.display[1]}return e};document.addEventListener("copy",function(e){var t=window.getSelection();if(!t.isCollapsed){var n=t.getRangeAt(0).cloneContents();if(n.querySelector(".katex-mathml")){for(var r=[],l=0;l<n.childNodes.length;l++)r.push(n.childNodes[l].outerHTML);e.clipboardData.setData("text/html",r.join("")),e.clipboardData.setData("text/plain",o(n).textContent),e.preventDefault()}}})}]).default});

File diff suppressed because one or more lines are too long

1
themes/CodeIT/assets/lib/katex/katex.min.js vendored Executable file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,449 @@
/*!
* 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");
};
});

View file

@ -0,0 +1,349 @@
/*!
* 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");
};
});

View file

@ -0,0 +1,418 @@
/*!
* 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");
};
});

View file

@ -0,0 +1,496 @@
/*!
* 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");
};
});

View file

@ -0,0 +1,706 @@
/*!
* 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");
};
});

View file

@ -0,0 +1,617 @@
/*!
* 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");
};
});

View file

@ -0,0 +1,786 @@
/*!
* 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");
};
});

View file

@ -0,0 +1,673 @@
/*!
* 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");
};
});

View file

@ -0,0 +1,740 @@
/*!
* 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");
};
});

View file

@ -0,0 +1,195 @@
/*!
* 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-Z--0-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");
};
});

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,492 @@
/*!
* 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."
);
}
/* register specific locale function */
lunr.nl = function () {
this.pipeline.reset();
this.pipeline.add(
lunr.nl.trimmer,
lunr.nl.stopWordFilter,
lunr.nl.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.nl.stemmer);
}
};
/* lunr trimmer function */
lunr.nl.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.nl.trimmer = lunr.trimmerSupport.generateTrimmer(
lunr.nl.wordCharacters
);
lunr.Pipeline.registerFunction(lunr.nl.trimmer, "trimmer-nl");
/* lunr stemmer function */
lunr.nl.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.nl.stemmer, "stemmer-nl");
lunr.nl.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.nl.stopWordFilter, "stopWordFilter-nl");
};
});

View file

@ -0,0 +1,303 @@
/*!
* Lunr languages, `Norwegian` 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.no = function () {
this.pipeline.reset();
this.pipeline.add(
lunr.no.trimmer,
lunr.no.stopWordFilter,
lunr.no.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.no.stemmer);
}
};
/* lunr trimmer function */
lunr.no.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.no.trimmer = lunr.trimmerSupport.generateTrimmer(
lunr.no.wordCharacters
);
lunr.Pipeline.registerFunction(lunr.no.trimmer, "trimmer-no");
/* lunr stemmer function */
lunr.no.stemmer = (function () {
/* create the wrapped stemmer object */
var Among = lunr.stemmerSupport.Among,
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
st = new (function NorwegianStemmer() {
var a_0 = [
new Among("a", -1, 1),
new Among("e", -1, 1),
new Among("ede", 1, 1),
new Among("ande", 1, 1),
new Among("ende", 1, 1),
new Among("ane", 1, 1),
new Among("ene", 1, 1),
new Among("hetene", 6, 1),
new Among("erte", 1, 3),
new Among("en", -1, 1),
new Among("heten", 9, 1),
new Among("ar", -1, 1),
new Among("er", -1, 1),
new Among("heter", 12, 1),
new Among("s", -1, 2),
new Among("as", 14, 1),
new Among("es", 14, 1),
new Among("edes", 16, 1),
new Among("endes", 16, 1),
new Among("enes", 16, 1),
new Among("hetenes", 19, 1),
new Among("ens", 14, 1),
new Among("hetens", 21, 1),
new Among("ers", 14, 1),
new Among("ets", 14, 1),
new Among("et", -1, 1),
new Among("het", 25, 1),
new Among("ert", -1, 3),
new Among("ast", -1, 1),
],
a_1 = [new Among("dt", -1, -1), new Among("vt", -1, -1)],
a_2 = [
new Among("leg", -1, 1),
new Among("eleg", 0, 1),
new Among("ig", -1, 1),
new Among("eig", 2, 1),
new Among("lig", 2, 1),
new Among("elig", 4, 1),
new Among("els", -1, 1),
new Among("lov", -1, 1),
new Among("elov", 7, 1),
new Among("slov", 7, 1),
new Among("hetslov", 9, 1),
],
g_v = [
17,
65,
16,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
48,
0,
128,
],
g_s_ending = [119, 125, 149, 1],
I_x,
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,
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;
}
if (v_1 >= sbp.limit) return;
sbp.cursor = v_1 + 1;
}
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, 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_0, 29);
sbp.limit_backward = v_1;
if (among_var) {
sbp.bra = sbp.cursor;
switch (among_var) {
case 1:
sbp.slice_del();
break;
case 2:
v_2 = sbp.limit - sbp.cursor;
if (sbp.in_grouping_b(g_s_ending, 98, 122)) sbp.slice_del();
else {
sbp.cursor = sbp.limit - v_2;
if (
sbp.eq_s_b(1, "k") &&
sbp.out_grouping_b(g_v, 97, 248)
)
sbp.slice_del();
}
break;
case 3:
sbp.slice_from("er");
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, 2)) {
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;
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_2, 11);
if (among_var) {
sbp.bra = sbp.cursor;
sbp.limit_backward = v_1;
if (among_var == 1) 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();
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.no.stemmer, "stemmer-no");
lunr.no.stopWordFilter = lunr.generateStopWordFilter(
"alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(
" "
)
);
lunr.Pipeline.registerFunction(lunr.no.stopWordFilter, "stopWordFilter-no");
};
});

View file

@ -0,0 +1,671 @@
/*!
* Lunr languages, `Portuguese` 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.pt = function () {
this.pipeline.reset();
this.pipeline.add(
lunr.pt.trimmer,
lunr.pt.stopWordFilter,
lunr.pt.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.pt.stemmer);
}
};
/* lunr trimmer function */
lunr.pt.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.pt.trimmer = lunr.trimmerSupport.generateTrimmer(
lunr.pt.wordCharacters
);
lunr.Pipeline.registerFunction(lunr.pt.trimmer, "trimmer-pt");
/* lunr stemmer function */
lunr.pt.stemmer = (function () {
/* create the wrapped stemmer object */
var Among = lunr.stemmerSupport.Among,
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
st = new (function PortugueseStemmer() {
var a_0 = [
new Among("", -1, 3),
new Among("\u00E3", 0, 1),
new Among("\u00F5", 0, 2),
],
a_1 = [
new Among("", -1, 3),
new Among("a~", 0, 1),
new Among("o~", 0, 2),
],
a_2 = [
new Among("ic", -1, -1),
new Among("ad", -1, -1),
new Among("os", -1, -1),
new Among("iv", -1, 1),
],
a_3 = [
new Among("ante", -1, 1),
new Among("avel", -1, 1),
new Among("\u00EDvel", -1, 1),
],
a_4 = [
new Among("ic", -1, 1),
new Among("abil", -1, 1),
new Among("iv", -1, 1),
],
a_5 = [
new Among("ica", -1, 1),
new Among("\u00E2ncia", -1, 1),
new Among("\u00EAncia", -1, 4),
new Among("ira", -1, 9),
new Among("adora", -1, 1),
new Among("osa", -1, 1),
new Among("ista", -1, 1),
new Among("iva", -1, 8),
new Among("eza", -1, 1),
new Among("log\u00EDa", -1, 2),
new Among("idade", -1, 7),
new Among("ante", -1, 1),
new Among("mente", -1, 6),
new Among("amente", 12, 5),
new Among("\u00E1vel", -1, 1),
new Among("\u00EDvel", -1, 1),
new Among("uci\u00F3n", -1, 3),
new Among("ico", -1, 1),
new Among("ismo", -1, 1),
new Among("oso", -1, 1),
new Among("amento", -1, 1),
new Among("imento", -1, 1),
new Among("ivo", -1, 8),
new Among("a\u00E7a~o", -1, 1),
new Among("ador", -1, 1),
new Among("icas", -1, 1),
new Among("\u00EAncias", -1, 4),
new Among("iras", -1, 9),
new Among("adoras", -1, 1),
new Among("osas", -1, 1),
new Among("istas", -1, 1),
new Among("ivas", -1, 8),
new Among("ezas", -1, 1),
new Among("log\u00EDas", -1, 2),
new Among("idades", -1, 7),
new Among("uciones", -1, 3),
new Among("adores", -1, 1),
new Among("antes", -1, 1),
new Among("a\u00E7o~es", -1, 1),
new Among("icos", -1, 1),
new Among("ismos", -1, 1),
new Among("osos", -1, 1),
new Among("amentos", -1, 1),
new Among("imentos", -1, 1),
new Among("ivos", -1, 8),
],
a_6 = [
new Among("ada", -1, 1),
new Among("ida", -1, 1),
new Among("ia", -1, 1),
new Among("aria", 2, 1),
new Among("eria", 2, 1),
new Among("iria", 2, 1),
new Among("ara", -1, 1),
new Among("era", -1, 1),
new Among("ira", -1, 1),
new Among("ava", -1, 1),
new Among("asse", -1, 1),
new Among("esse", -1, 1),
new Among("isse", -1, 1),
new Among("aste", -1, 1),
new Among("este", -1, 1),
new Among("iste", -1, 1),
new Among("ei", -1, 1),
new Among("arei", 16, 1),
new Among("erei", 16, 1),
new Among("irei", 16, 1),
new Among("am", -1, 1),
new Among("iam", 20, 1),
new Among("ariam", 21, 1),
new Among("eriam", 21, 1),
new Among("iriam", 21, 1),
new Among("aram", 20, 1),
new Among("eram", 20, 1),
new Among("iram", 20, 1),
new Among("avam", 20, 1),
new Among("em", -1, 1),
new Among("arem", 29, 1),
new Among("erem", 29, 1),
new Among("irem", 29, 1),
new Among("assem", 29, 1),
new Among("essem", 29, 1),
new Among("issem", 29, 1),
new Among("ado", -1, 1),
new Among("ido", -1, 1),
new Among("ando", -1, 1),
new Among("endo", -1, 1),
new Among("indo", -1, 1),
new Among("ara~o", -1, 1),
new Among("era~o", -1, 1),
new Among("ira~o", -1, 1),
new Among("ar", -1, 1),
new Among("er", -1, 1),
new Among("ir", -1, 1),
new Among("as", -1, 1),
new Among("adas", 47, 1),
new Among("idas", 47, 1),
new Among("ias", 47, 1),
new Among("arias", 50, 1),
new Among("erias", 50, 1),
new Among("irias", 50, 1),
new Among("aras", 47, 1),
new Among("eras", 47, 1),
new Among("iras", 47, 1),
new Among("avas", 47, 1),
new Among("es", -1, 1),
new Among("ardes", 58, 1),
new Among("erdes", 58, 1),
new Among("irdes", 58, 1),
new Among("ares", 58, 1),
new Among("eres", 58, 1),
new Among("ires", 58, 1),
new Among("asses", 58, 1),
new Among("esses", 58, 1),
new Among("isses", 58, 1),
new Among("astes", 58, 1),
new Among("estes", 58, 1),
new Among("istes", 58, 1),
new Among("is", -1, 1),
new Among("ais", 71, 1),
new Among("eis", 71, 1),
new Among("areis", 73, 1),
new Among("ereis", 73, 1),
new Among("ireis", 73, 1),
new Among("\u00E1reis", 73, 1),
new Among("\u00E9reis", 73, 1),
new Among("\u00EDreis", 73, 1),
new Among("\u00E1sseis", 73, 1),
new Among("\u00E9sseis", 73, 1),
new Among("\u00EDsseis", 73, 1),
new Among("\u00E1veis", 73, 1),
new Among("\u00EDeis", 73, 1),
new Among("ar\u00EDeis", 84, 1),
new Among("er\u00EDeis", 84, 1),
new Among("ir\u00EDeis", 84, 1),
new Among("ados", -1, 1),
new Among("idos", -1, 1),
new Among("amos", -1, 1),
new Among("\u00E1ramos", 90, 1),
new Among("\u00E9ramos", 90, 1),
new Among("\u00EDramos", 90, 1),
new Among("\u00E1vamos", 90, 1),
new Among("\u00EDamos", 90, 1),
new Among("ar\u00EDamos", 95, 1),
new Among("er\u00EDamos", 95, 1),
new Among("ir\u00EDamos", 95, 1),
new Among("emos", -1, 1),
new Among("aremos", 99, 1),
new Among("eremos", 99, 1),
new Among("iremos", 99, 1),
new Among("\u00E1ssemos", 99, 1),
new Among("\u00EAssemos", 99, 1),
new Among("\u00EDssemos", 99, 1),
new Among("imos", -1, 1),
new Among("armos", -1, 1),
new Among("ermos", -1, 1),
new Among("irmos", -1, 1),
new Among("\u00E1mos", -1, 1),
new Among("ar\u00E1s", -1, 1),
new Among("er\u00E1s", -1, 1),
new Among("ir\u00E1s", -1, 1),
new Among("eu", -1, 1),
new Among("iu", -1, 1),
new Among("ou", -1, 1),
new Among("ar\u00E1", -1, 1),
new Among("er\u00E1", -1, 1),
new Among("ir\u00E1", -1, 1),
],
a_7 = [
new Among("a", -1, 1),
new Among("i", -1, 1),
new Among("o", -1, 1),
new Among("os", -1, 1),
new Among("\u00E1", -1, 1),
new Among("\u00ED", -1, 1),
new Among("\u00F3", -1, 1),
],
a_8 = [
new Among("e", -1, 1),
new Among("\u00E7", -1, 2),
new Among("\u00E9", -1, 1),
new Among("\u00EA", -1, 1),
],
g_v = [
17,
65,
16,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
3,
19,
12,
2,
],
I_p2,
I_p1,
I_pV,
sbp = new SnowballProgram();
this.setCurrent = function (word) {
sbp.setCurrent(word);
};
this.getCurrent = function () {
return sbp.getCurrent();
};
function r_prelude() {
var among_var;
while (true) {
sbp.bra = sbp.cursor;
among_var = sbp.find_among(a_0, 3);
if (among_var) {
sbp.ket = sbp.cursor;
switch (among_var) {
case 1:
sbp.slice_from("a~");
continue;
case 2:
sbp.slice_from("o~");
continue;
case 3:
if (sbp.cursor >= sbp.limit) break;
sbp.cursor++;
continue;
}
}
break;
}
}
function habr2() {
if (sbp.out_grouping(g_v, 97, 250)) {
while (!sbp.in_grouping(g_v, 97, 250)) {
if (sbp.cursor >= sbp.limit) return true;
sbp.cursor++;
}
return false;
}
return true;
}
function habr3() {
if (sbp.in_grouping(g_v, 97, 250)) {
while (!sbp.out_grouping(g_v, 97, 250)) {
if (sbp.cursor >= sbp.limit) return false;
sbp.cursor++;
}
}
I_pV = sbp.cursor;
return true;
}
function habr4() {
var v_1 = sbp.cursor,
v_2,
v_3;
if (sbp.in_grouping(g_v, 97, 250)) {
v_2 = sbp.cursor;
if (habr2()) {
sbp.cursor = v_2;
if (habr3()) return;
} else I_pV = sbp.cursor;
}
sbp.cursor = v_1;
if (sbp.out_grouping(g_v, 97, 250)) {
v_3 = sbp.cursor;
if (habr2()) {
sbp.cursor = v_3;
if (!sbp.in_grouping(g_v, 97, 250) || sbp.cursor >= sbp.limit)
return;
sbp.cursor++;
}
I_pV = sbp.cursor;
}
}
function habr5() {
while (!sbp.in_grouping(g_v, 97, 250)) {
if (sbp.cursor >= sbp.limit) return false;
sbp.cursor++;
}
while (!sbp.out_grouping(g_v, 97, 250)) {
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) {
sbp.ket = sbp.cursor;
switch (among_var) {
case 1:
sbp.slice_from("\u00E3");
continue;
case 2:
sbp.slice_from("\u00F5");
continue;
case 3:
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_standard_suffix() {
var among_var;
sbp.ket = sbp.cursor;
among_var = sbp.find_among_b(a_5, 45);
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_from("log");
break;
case 3:
if (!r_R2()) return false;
sbp.slice_from("u");
break;
case 4:
if (!r_R2()) return false;
sbp.slice_from("ente");
break;
case 5:
if (!r_R1()) return false;
sbp.slice_del();
sbp.ket = sbp.cursor;
among_var = sbp.find_among_b(a_2, 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 6:
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;
if (among_var == 1) if (r_R2()) sbp.slice_del();
}
break;
case 7:
if (!r_R2()) return false;
sbp.slice_del();
sbp.ket = sbp.cursor;
among_var = sbp.find_among_b(a_4, 3);
if (among_var) {
sbp.bra = sbp.cursor;
if (among_var == 1) if (r_R2()) sbp.slice_del();
}
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();
}
break;
case 9:
if (!r_RV() || !sbp.eq_s_b(1, "e")) return false;
sbp.slice_from("ir");
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_6, 120);
if (among_var) {
sbp.bra = sbp.cursor;
if (among_var == 1) sbp.slice_del();
sbp.limit_backward = v_1;
return true;
}
sbp.limit_backward = v_1;
}
return false;
}
function r_residual_suffix() {
var among_var;
sbp.ket = sbp.cursor;
among_var = sbp.find_among_b(a_7, 7);
if (among_var) {
sbp.bra = sbp.cursor;
if (among_var == 1) if (r_RV()) sbp.slice_del();
}
}
function habr6(c1, c2) {
if (sbp.eq_s_b(1, c1)) {
sbp.bra = sbp.cursor;
var v_1 = sbp.limit - sbp.cursor;
if (sbp.eq_s_b(1, c2)) {
sbp.cursor = sbp.limit - v_1;
if (r_RV()) sbp.slice_del();
return false;
}
}
return true;
}
function r_residual_form() {
var among_var, v_1, v_2, v_3;
sbp.ket = sbp.cursor;
among_var = sbp.find_among_b(a_8, 4);
if (among_var) {
sbp.bra = sbp.cursor;
switch (among_var) {
case 1:
if (r_RV()) {
sbp.slice_del();
sbp.ket = sbp.cursor;
v_1 = sbp.limit - sbp.cursor;
if (habr6("u", "g")) habr6("i", "c");
}
break;
case 2:
sbp.slice_from("c");
break;
}
}
}
function habr1() {
if (!r_standard_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, "i")) {
sbp.bra = sbp.cursor;
if (sbp.eq_s_b(1, "c")) {
sbp.cursor = sbp.limit;
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;
habr1();
sbp.cursor = sbp.limit;
r_residual_form();
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.pt.stemmer, "stemmer-pt");
lunr.pt.stopWordFilter = lunr.generateStopWordFilter(
"a ao aos aquela aquelas aquele aqueles aquilo as até com como da das de dela delas dele deles depois do dos e ela elas ele eles em entre era eram essa essas esse esses esta estamos estas estava estavam este esteja estejam estejamos estes esteve estive estivemos estiver estivera estiveram estiverem estivermos estivesse estivessem estivéramos estivéssemos estou está estávamos estão eu foi fomos for fora foram forem formos fosse fossem fui fôramos fôssemos haja hajam hajamos havemos hei houve houvemos houver houvera houveram houverei houverem houveremos houveria houveriam houvermos houverá houverão houveríamos houvesse houvessem houvéramos houvéssemos há hão isso isto já lhe lhes mais mas me mesmo meu meus minha minhas muito na nas nem no nos nossa nossas nosso nossos num numa não nós o os ou para pela pelas pelo pelos por qual quando que quem se seja sejam sejamos sem serei seremos seria seriam será serão seríamos seu seus somos sou sua suas são só também te tem temos tenha tenham tenhamos tenho terei teremos teria teriam terá terão teríamos teu teus teve tinha tinham tive tivemos tiver tivera tiveram tiverem tivermos tivesse tivessem tivéramos tivéssemos tu tua tuas tém tínhamos um uma você vocês vos à às éramos".split(
" "
)
);
lunr.Pipeline.registerFunction(lunr.pt.stopWordFilter, "stopWordFilter-pt");
};
});

View file

@ -0,0 +1,694 @@
/*!
* Lunr languages, `Romanian` 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.ro = function () {
this.pipeline.reset();
this.pipeline.add(
lunr.ro.trimmer,
lunr.ro.stopWordFilter,
lunr.ro.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.ro.stemmer);
}
};
/* lunr trimmer function */
lunr.ro.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.ro.trimmer = lunr.trimmerSupport.generateTrimmer(
lunr.ro.wordCharacters
);
lunr.Pipeline.registerFunction(lunr.ro.trimmer, "trimmer-ro");
/* lunr stemmer function */
lunr.ro.stemmer = (function () {
/* create the wrapped stemmer object */
var Among = lunr.stemmerSupport.Among,
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
st = new (function RomanianStemmer() {
var a_0 = [
new Among("", -1, 3),
new Among("I", 0, 1),
new Among("U", 0, 2),
],
a_1 = [
new Among("ea", -1, 3),
new Among("a\u0163ia", -1, 7),
new Among("aua", -1, 2),
new Among("iua", -1, 4),
new Among("a\u0163ie", -1, 7),
new Among("ele", -1, 3),
new Among("ile", -1, 5),
new Among("iile", 6, 4),
new Among("iei", -1, 4),
new Among("atei", -1, 6),
new Among("ii", -1, 4),
new Among("ului", -1, 1),
new Among("ul", -1, 1),
new Among("elor", -1, 3),
new Among("ilor", -1, 4),
new Among("iilor", 14, 4),
],
a_2 = [
new Among("icala", -1, 4),
new Among("iciva", -1, 4),
new Among("ativa", -1, 5),
new Among("itiva", -1, 6),
new Among("icale", -1, 4),
new Among("a\u0163iune", -1, 5),
new Among("i\u0163iune", -1, 6),
new Among("atoare", -1, 5),
new Among("itoare", -1, 6),
new Among("\u0103toare", -1, 5),
new Among("icitate", -1, 4),
new Among("abilitate", -1, 1),
new Among("ibilitate", -1, 2),
new Among("ivitate", -1, 3),
new Among("icive", -1, 4),
new Among("ative", -1, 5),
new Among("itive", -1, 6),
new Among("icali", -1, 4),
new Among("atori", -1, 5),
new Among("icatori", 18, 4),
new Among("itori", -1, 6),
new Among("\u0103tori", -1, 5),
new Among("icitati", -1, 4),
new Among("abilitati", -1, 1),
new Among("ivitati", -1, 3),
new Among("icivi", -1, 4),
new Among("ativi", -1, 5),
new Among("itivi", -1, 6),
new Among("icit\u0103i", -1, 4),
new Among("abilit\u0103i", -1, 1),
new Among("ivit\u0103i", -1, 3),
new Among("icit\u0103\u0163i", -1, 4),
new Among("abilit\u0103\u0163i", -1, 1),
new Among("ivit\u0103\u0163i", -1, 3),
new Among("ical", -1, 4),
new Among("ator", -1, 5),
new Among("icator", 35, 4),
new Among("itor", -1, 6),
new Among("\u0103tor", -1, 5),
new Among("iciv", -1, 4),
new Among("ativ", -1, 5),
new Among("itiv", -1, 6),
new Among("ical\u0103", -1, 4),
new Among("iciv\u0103", -1, 4),
new Among("ativ\u0103", -1, 5),
new Among("itiv\u0103", -1, 6),
],
a_3 = [
new Among("ica", -1, 1),
new Among("abila", -1, 1),
new Among("ibila", -1, 1),
new Among("oasa", -1, 1),
new Among("ata", -1, 1),
new Among("ita", -1, 1),
new Among("anta", -1, 1),
new Among("ista", -1, 3),
new Among("uta", -1, 1),
new Among("iva", -1, 1),
new Among("ic", -1, 1),
new Among("ice", -1, 1),
new Among("abile", -1, 1),
new Among("ibile", -1, 1),
new Among("isme", -1, 3),
new Among("iune", -1, 2),
new Among("oase", -1, 1),
new Among("ate", -1, 1),
new Among("itate", 17, 1),
new Among("ite", -1, 1),
new Among("ante", -1, 1),
new Among("iste", -1, 3),
new Among("ute", -1, 1),
new Among("ive", -1, 1),
new Among("ici", -1, 1),
new Among("abili", -1, 1),
new Among("ibili", -1, 1),
new Among("iuni", -1, 2),
new Among("atori", -1, 1),
new Among("osi", -1, 1),
new Among("ati", -1, 1),
new Among("itati", 30, 1),
new Among("iti", -1, 1),
new Among("anti", -1, 1),
new Among("isti", -1, 3),
new Among("uti", -1, 1),
new Among("i\u015Fti", -1, 3),
new Among("ivi", -1, 1),
new Among("it\u0103i", -1, 1),
new Among("o\u015Fi", -1, 1),
new Among("it\u0103\u0163i", -1, 1),
new Among("abil", -1, 1),
new Among("ibil", -1, 1),
new Among("ism", -1, 3),
new Among("ator", -1, 1),
new Among("os", -1, 1),
new Among("at", -1, 1),
new Among("it", -1, 1),
new Among("ant", -1, 1),
new Among("ist", -1, 3),
new Among("ut", -1, 1),
new Among("iv", -1, 1),
new Among("ic\u0103", -1, 1),
new Among("abil\u0103", -1, 1),
new Among("ibil\u0103", -1, 1),
new Among("oas\u0103", -1, 1),
new Among("at\u0103", -1, 1),
new Among("it\u0103", -1, 1),
new Among("ant\u0103", -1, 1),
new Among("ist\u0103", -1, 3),
new Among("ut\u0103", -1, 1),
new Among("iv\u0103", -1, 1),
],
a_4 = [
new Among("ea", -1, 1),
new Among("ia", -1, 1),
new Among("esc", -1, 1),
new Among("\u0103sc", -1, 1),
new Among("ind", -1, 1),
new Among("\u00E2nd", -1, 1),
new Among("are", -1, 1),
new Among("ere", -1, 1),
new Among("ire", -1, 1),
new Among("\u00E2re", -1, 1),
new Among("se", -1, 2),
new Among("ase", 10, 1),
new Among("sese", 10, 2),
new Among("ise", 10, 1),
new Among("use", 10, 1),
new Among("\u00E2se", 10, 1),
new Among("e\u015Fte", -1, 1),
new Among("\u0103\u015Fte", -1, 1),
new Among("eze", -1, 1),
new Among("ai", -1, 1),
new Among("eai", 19, 1),
new Among("iai", 19, 1),
new Among("sei", -1, 2),
new Among("e\u015Fti", -1, 1),
new Among("\u0103\u015Fti", -1, 1),
new Among("ui", -1, 1),
new Among("ezi", -1, 1),
new Among("\u00E2i", -1, 1),
new Among("a\u015Fi", -1, 1),
new Among("se\u015Fi", -1, 2),
new Among("ase\u015Fi", 29, 1),
new Among("sese\u015Fi", 29, 2),
new Among("ise\u015Fi", 29, 1),
new Among("use\u015Fi", 29, 1),
new Among("\u00E2se\u015Fi", 29, 1),
new Among("i\u015Fi", -1, 1),
new Among("u\u015Fi", -1, 1),
new Among("\u00E2\u015Fi", -1, 1),
new Among("a\u0163i", -1, 2),
new Among("ea\u0163i", 38, 1),
new Among("ia\u0163i", 38, 1),
new Among("e\u0163i", -1, 2),
new Among("i\u0163i", -1, 2),
new Among("\u00E2\u0163i", -1, 2),
new Among("ar\u0103\u0163i", -1, 1),
new Among("ser\u0103\u0163i", -1, 2),
new Among("aser\u0103\u0163i", 45, 1),
new Among("seser\u0103\u0163i", 45, 2),
new Among("iser\u0103\u0163i", 45, 1),
new Among("user\u0103\u0163i", 45, 1),
new Among("\u00E2ser\u0103\u0163i", 45, 1),
new Among("ir\u0103\u0163i", -1, 1),
new Among("ur\u0103\u0163i", -1, 1),
new Among("\u00E2r\u0103\u0163i", -1, 1),
new Among("am", -1, 1),
new Among("eam", 54, 1),
new Among("iam", 54, 1),
new Among("em", -1, 2),
new Among("asem", 57, 1),
new Among("sesem", 57, 2),
new Among("isem", 57, 1),
new Among("usem", 57, 1),
new Among("\u00E2sem", 57, 1),
new Among("im", -1, 2),
new Among("\u00E2m", -1, 2),
new Among("\u0103m", -1, 2),
new Among("ar\u0103m", 65, 1),
new Among("ser\u0103m", 65, 2),
new Among("aser\u0103m", 67, 1),
new Among("seser\u0103m", 67, 2),
new Among("iser\u0103m", 67, 1),
new Among("user\u0103m", 67, 1),
new Among("\u00E2ser\u0103m", 67, 1),
new Among("ir\u0103m", 65, 1),
new Among("ur\u0103m", 65, 1),
new Among("\u00E2r\u0103m", 65, 1),
new Among("au", -1, 1),
new Among("eau", 76, 1),
new Among("iau", 76, 1),
new Among("indu", -1, 1),
new Among("\u00E2ndu", -1, 1),
new Among("ez", -1, 1),
new Among("easc\u0103", -1, 1),
new Among("ar\u0103", -1, 1),
new Among("ser\u0103", -1, 2),
new Among("aser\u0103", 84, 1),
new Among("seser\u0103", 84, 2),
new Among("iser\u0103", 84, 1),
new Among("user\u0103", 84, 1),
new Among("\u00E2ser\u0103", 84, 1),
new Among("ir\u0103", -1, 1),
new Among("ur\u0103", -1, 1),
new Among("\u00E2r\u0103", -1, 1),
new Among("eaz\u0103", -1, 1),
],
a_5 = [
new Among("a", -1, 1),
new Among("e", -1, 1),
new Among("ie", 1, 1),
new Among("i", -1, 1),
new Among("\u0103", -1, 1),
],
g_v = [
17,
65,
16,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
32,
0,
0,
4,
],
B_standard_suffix_removed,
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) {
if (sbp.eq_s(1, c1)) {
sbp.ket = sbp.cursor;
if (sbp.in_grouping(g_v, 97, 259)) sbp.slice_from(c2);
}
}
function r_prelude() {
var v_1, v_2;
while (true) {
v_1 = sbp.cursor;
if (sbp.in_grouping(g_v, 97, 259)) {
v_2 = sbp.cursor;
sbp.bra = v_2;
habr1("u", "U");
sbp.cursor = v_2;
habr1("i", "I");
}
sbp.cursor = v_1;
if (sbp.cursor >= sbp.limit) {
break;
}
sbp.cursor++;
}
}
function habr2() {
if (sbp.out_grouping(g_v, 97, 259)) {
while (!sbp.in_grouping(g_v, 97, 259)) {
if (sbp.cursor >= sbp.limit) return true;
sbp.cursor++;
}
return false;
}
return true;
}
function habr3() {
if (sbp.in_grouping(g_v, 97, 259)) {
while (!sbp.out_grouping(g_v, 97, 259)) {
if (sbp.cursor >= sbp.limit) return true;
sbp.cursor++;
}
}
return false;
}
function habr4() {
var v_1 = sbp.cursor,
v_2,
v_3;
if (sbp.in_grouping(g_v, 97, 259)) {
v_2 = sbp.cursor;
if (habr2()) {
sbp.cursor = v_2;
if (!habr3()) {
I_pV = sbp.cursor;
return;
}
} else {
I_pV = sbp.cursor;
return;
}
}
sbp.cursor = v_1;
if (sbp.out_grouping(g_v, 97, 259)) {
v_3 = sbp.cursor;
if (habr2()) {
sbp.cursor = v_3;
if (sbp.in_grouping(g_v, 97, 259) && sbp.cursor < sbp.limit)
sbp.cursor++;
}
I_pV = sbp.cursor;
}
}
function habr5() {
while (!sbp.in_grouping(g_v, 97, 259)) {
if (sbp.cursor >= sbp.limit) return false;
sbp.cursor++;
}
while (!sbp.out_grouping(g_v, 97, 259)) {
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_0, 3);
if (among_var) {
sbp.ket = sbp.cursor;
switch (among_var) {
case 1:
sbp.slice_from("i");
continue;
case 2:
sbp.slice_from("u");
continue;
case 3:
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_step_0() {
var among_var, v_1;
sbp.ket = sbp.cursor;
among_var = sbp.find_among_b(a_1, 16);
if (among_var) {
sbp.bra = sbp.cursor;
if (r_R1()) {
switch (among_var) {
case 1:
sbp.slice_del();
break;
case 2:
sbp.slice_from("a");
break;
case 3:
sbp.slice_from("e");
break;
case 4:
sbp.slice_from("i");
break;
case 5:
v_1 = sbp.limit - sbp.cursor;
if (!sbp.eq_s_b(2, "ab")) {
sbp.cursor = sbp.limit - v_1;
sbp.slice_from("i");
}
break;
case 6:
sbp.slice_from("at");
break;
case 7:
sbp.slice_from("a\u0163i");
break;
}
}
}
}
function r_combo_suffix() {
var among_var,
v_1 = sbp.limit - sbp.cursor;
sbp.ket = sbp.cursor;
among_var = sbp.find_among_b(a_2, 46);
if (among_var) {
sbp.bra = sbp.cursor;
if (r_R1()) {
switch (among_var) {
case 1:
sbp.slice_from("abil");
break;
case 2:
sbp.slice_from("ibil");
break;
case 3:
sbp.slice_from("iv");
break;
case 4:
sbp.slice_from("ic");
break;
case 5:
sbp.slice_from("at");
break;
case 6:
sbp.slice_from("it");
break;
}
B_standard_suffix_removed = true;
sbp.cursor = sbp.limit - v_1;
return true;
}
}
return false;
}
function r_standard_suffix() {
var among_var, v_1;
B_standard_suffix_removed = false;
while (true) {
v_1 = sbp.limit - sbp.cursor;
if (!r_combo_suffix()) {
sbp.cursor = sbp.limit - v_1;
break;
}
}
sbp.ket = sbp.cursor;
among_var = sbp.find_among_b(a_3, 62);
if (among_var) {
sbp.bra = sbp.cursor;
if (r_R2()) {
switch (among_var) {
case 1:
sbp.slice_del();
break;
case 2:
if (sbp.eq_s_b(1, "\u0163")) {
sbp.bra = sbp.cursor;
sbp.slice_from("t");
}
break;
case 3:
sbp.slice_from("ist");
break;
}
B_standard_suffix_removed = true;
}
}
}
function r_verb_suffix() {
var among_var, v_1, v_2;
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_4, 94);
if (among_var) {
sbp.bra = sbp.cursor;
switch (among_var) {
case 1:
v_2 = sbp.limit - sbp.cursor;
if (!sbp.out_grouping_b(g_v, 97, 259)) {
sbp.cursor = sbp.limit - v_2;
if (!sbp.eq_s_b(1, "u")) break;
}
case 2:
sbp.slice_del();
break;
}
}
sbp.limit_backward = v_1;
}
}
function r_vowel_suffix() {
var among_var;
sbp.ket = sbp.cursor;
among_var = sbp.find_among_b(a_5, 5);
if (among_var) {
sbp.bra = sbp.cursor;
if (r_RV() && among_var == 1) 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_step_0();
sbp.cursor = sbp.limit;
r_standard_suffix();
sbp.cursor = sbp.limit;
if (!B_standard_suffix_removed) {
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.ro.stemmer, "stemmer-ro");
lunr.ro.stopWordFilter = lunr.generateStopWordFilter(
"acea aceasta această aceea acei aceia acel acela acele acelea acest acesta aceste acestea aceşti aceştia acolo acord acum ai aia aibă aici al ale alea altceva altcineva am ar are asemenea asta astea astăzi asupra au avea avem aveţi azi aş aşadar aţi bine bucur bună ca care caut ce cel ceva chiar cinci cine cineva contra cu cum cumva curând curînd când cât câte câtva câţi cînd cît cîte cîtva cîţi că căci cărei căror cărui către da dacă dar datorită dată dau de deci deja deoarece departe deşi din dinaintea dintr- dintre doi doilea două drept după dă ea ei el ele eram este eu eşti face fata fi fie fiecare fii fim fiu fiţi frumos fără graţie halbă iar ieri la le li lor lui lângă lîngă mai mea mei mele mereu meu mi mie mine mult multă mulţi mulţumesc mâine mîine mă ne nevoie nici nicăieri nimeni nimeri nimic nişte noastre noastră noi noroc nostru nouă noştri nu opt ori oricare orice oricine oricum oricând oricât oricînd oricît oriunde patra patru patrulea pe pentru peste pic poate pot prea prima primul prin puţin puţina puţină până pînă rog sa sale sau se spate spre sub sunt suntem sunteţi sută sînt sîntem sînteţi să săi său ta tale te timp tine toate toată tot totuşi toţi trei treia treilea tu tăi tău un una unde undeva unei uneia unele uneori unii unor unora unu unui unuia unul vi voastre voastră voi vostru vouă voştri vreme vreo vreun vă zece zero zi zice îi îl îmi împotriva în înainte înaintea încotro încât încît între întrucât întrucît îţi ăla ălea ăsta ăstea ăştia şapte şase şi ştiu ţi ţie".split(
" "
)
);
lunr.Pipeline.registerFunction(lunr.ro.stopWordFilter, "stopWordFilter-ro");
};
});

View file

@ -0,0 +1,431 @@
/*!
* Lunr languages, `Russian` 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.ru = function () {
this.pipeline.reset();
this.pipeline.add(
lunr.ru.trimmer,
lunr.ru.stopWordFilter,
lunr.ru.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.ru.stemmer);
}
};
/* lunr trimmer function */
lunr.ru.wordCharacters =
"\u0400-\u0484\u0487-\u052F\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F";
lunr.ru.trimmer = lunr.trimmerSupport.generateTrimmer(
lunr.ru.wordCharacters
);
lunr.Pipeline.registerFunction(lunr.ru.trimmer, "trimmer-ru");
/* lunr stemmer function */
lunr.ru.stemmer = (function () {
/* create the wrapped stemmer object */
var Among = lunr.stemmerSupport.Among,
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
st = new (function RussianStemmer() {
var a_0 = [
new Among("\u0432", -1, 1),
new Among("\u0438\u0432", 0, 2),
new Among("\u044B\u0432", 0, 2),
new Among("\u0432\u0448\u0438", -1, 1),
new Among("\u0438\u0432\u0448\u0438", 3, 2),
new Among("\u044B\u0432\u0448\u0438", 3, 2),
new Among("\u0432\u0448\u0438\u0441\u044C", -1, 1),
new Among("\u0438\u0432\u0448\u0438\u0441\u044C", 6, 2),
new Among("\u044B\u0432\u0448\u0438\u0441\u044C", 6, 2),
],
a_1 = [
new Among("\u0435\u0435", -1, 1),
new Among("\u0438\u0435", -1, 1),
new Among("\u043E\u0435", -1, 1),
new Among("\u044B\u0435", -1, 1),
new Among("\u0438\u043C\u0438", -1, 1),
new Among("\u044B\u043C\u0438", -1, 1),
new Among("\u0435\u0439", -1, 1),
new Among("\u0438\u0439", -1, 1),
new Among("\u043E\u0439", -1, 1),
new Among("\u044B\u0439", -1, 1),
new Among("\u0435\u043C", -1, 1),
new Among("\u0438\u043C", -1, 1),
new Among("\u043E\u043C", -1, 1),
new Among("\u044B\u043C", -1, 1),
new Among("\u0435\u0433\u043E", -1, 1),
new Among("\u043E\u0433\u043E", -1, 1),
new Among("\u0435\u043C\u0443", -1, 1),
new Among("\u043E\u043C\u0443", -1, 1),
new Among("\u0438\u0445", -1, 1),
new Among("\u044B\u0445", -1, 1),
new Among("\u0435\u044E", -1, 1),
new Among("\u043E\u044E", -1, 1),
new Among("\u0443\u044E", -1, 1),
new Among("\u044E\u044E", -1, 1),
new Among("\u0430\u044F", -1, 1),
new Among("\u044F\u044F", -1, 1),
],
a_2 = [
new Among("\u0435\u043C", -1, 1),
new Among("\u043D\u043D", -1, 1),
new Among("\u0432\u0448", -1, 1),
new Among("\u0438\u0432\u0448", 2, 2),
new Among("\u044B\u0432\u0448", 2, 2),
new Among("\u0449", -1, 1),
new Among("\u044E\u0449", 5, 1),
new Among("\u0443\u044E\u0449", 6, 2),
],
a_3 = [
new Among("\u0441\u044C", -1, 1),
new Among("\u0441\u044F", -1, 1),
],
a_4 = [
new Among("\u043B\u0430", -1, 1),
new Among("\u0438\u043B\u0430", 0, 2),
new Among("\u044B\u043B\u0430", 0, 2),
new Among("\u043D\u0430", -1, 1),
new Among("\u0435\u043D\u0430", 3, 2),
new Among("\u0435\u0442\u0435", -1, 1),
new Among("\u0438\u0442\u0435", -1, 2),
new Among("\u0439\u0442\u0435", -1, 1),
new Among("\u0435\u0439\u0442\u0435", 7, 2),
new Among("\u0443\u0439\u0442\u0435", 7, 2),
new Among("\u043B\u0438", -1, 1),
new Among("\u0438\u043B\u0438", 10, 2),
new Among("\u044B\u043B\u0438", 10, 2),
new Among("\u0439", -1, 1),
new Among("\u0435\u0439", 13, 2),
new Among("\u0443\u0439", 13, 2),
new Among("\u043B", -1, 1),
new Among("\u0438\u043B", 16, 2),
new Among("\u044B\u043B", 16, 2),
new Among("\u0435\u043C", -1, 1),
new Among("\u0438\u043C", -1, 2),
new Among("\u044B\u043C", -1, 2),
new Among("\u043D", -1, 1),
new Among("\u0435\u043D", 22, 2),
new Among("\u043B\u043E", -1, 1),
new Among("\u0438\u043B\u043E", 24, 2),
new Among("\u044B\u043B\u043E", 24, 2),
new Among("\u043D\u043E", -1, 1),
new Among("\u0435\u043D\u043E", 27, 2),
new Among("\u043D\u043D\u043E", 27, 1),
new Among("\u0435\u0442", -1, 1),
new Among("\u0443\u0435\u0442", 30, 2),
new Among("\u0438\u0442", -1, 2),
new Among("\u044B\u0442", -1, 2),
new Among("\u044E\u0442", -1, 1),
new Among("\u0443\u044E\u0442", 34, 2),
new Among("\u044F\u0442", -1, 2),
new Among("\u043D\u044B", -1, 1),
new Among("\u0435\u043D\u044B", 37, 2),
new Among("\u0442\u044C", -1, 1),
new Among("\u0438\u0442\u044C", 39, 2),
new Among("\u044B\u0442\u044C", 39, 2),
new Among("\u0435\u0448\u044C", -1, 1),
new Among("\u0438\u0448\u044C", -1, 2),
new Among("\u044E", -1, 2),
new Among("\u0443\u044E", 44, 2),
],
a_5 = [
new Among("\u0430", -1, 1),
new Among("\u0435\u0432", -1, 1),
new Among("\u043E\u0432", -1, 1),
new Among("\u0435", -1, 1),
new Among("\u0438\u0435", 3, 1),
new Among("\u044C\u0435", 3, 1),
new Among("\u0438", -1, 1),
new Among("\u0435\u0438", 6, 1),
new Among("\u0438\u0438", 6, 1),
new Among("\u0430\u043C\u0438", 6, 1),
new Among("\u044F\u043C\u0438", 6, 1),
new Among("\u0438\u044F\u043C\u0438", 10, 1),
new Among("\u0439", -1, 1),
new Among("\u0435\u0439", 12, 1),
new Among("\u0438\u0435\u0439", 13, 1),
new Among("\u0438\u0439", 12, 1),
new Among("\u043E\u0439", 12, 1),
new Among("\u0430\u043C", -1, 1),
new Among("\u0435\u043C", -1, 1),
new Among("\u0438\u0435\u043C", 18, 1),
new Among("\u043E\u043C", -1, 1),
new Among("\u044F\u043C", -1, 1),
new Among("\u0438\u044F\u043C", 21, 1),
new Among("\u043E", -1, 1),
new Among("\u0443", -1, 1),
new Among("\u0430\u0445", -1, 1),
new Among("\u044F\u0445", -1, 1),
new Among("\u0438\u044F\u0445", 26, 1),
new Among("\u044B", -1, 1),
new Among("\u044C", -1, 1),
new Among("\u044E", -1, 1),
new Among("\u0438\u044E", 30, 1),
new Among("\u044C\u044E", 30, 1),
new Among("\u044F", -1, 1),
new Among("\u0438\u044F", 33, 1),
new Among("\u044C\u044F", 33, 1),
],
a_6 = [
new Among("\u043E\u0441\u0442", -1, 1),
new Among("\u043E\u0441\u0442\u044C", -1, 1),
],
a_7 = [
new Among("\u0435\u0439\u0448\u0435", -1, 1),
new Among("\u043D", -1, 2),
new Among("\u0435\u0439\u0448", -1, 1),
new Among("\u044C", -1, 3),
],
g_v = [33, 65, 8, 232],
I_p2,
I_pV,
sbp = new SnowballProgram();
this.setCurrent = function (word) {
sbp.setCurrent(word);
};
this.getCurrent = function () {
return sbp.getCurrent();
};
function habr3() {
while (!sbp.in_grouping(g_v, 1072, 1103)) {
if (sbp.cursor >= sbp.limit) return false;
sbp.cursor++;
}
return true;
}
function habr4() {
while (!sbp.out_grouping(g_v, 1072, 1103)) {
if (sbp.cursor >= sbp.limit) return false;
sbp.cursor++;
}
return true;
}
function r_mark_regions() {
I_pV = sbp.limit;
I_p2 = I_pV;
if (habr3()) {
I_pV = sbp.cursor;
if (habr4()) if (habr3()) if (habr4()) I_p2 = sbp.cursor;
}
}
function r_R2() {
return I_p2 <= sbp.cursor;
}
function habr2(a, n) {
var among_var, v_1;
sbp.ket = sbp.cursor;
among_var = sbp.find_among_b(a, n);
if (among_var) {
sbp.bra = sbp.cursor;
switch (among_var) {
case 1:
v_1 = sbp.limit - sbp.cursor;
if (!sbp.eq_s_b(1, "\u0430")) {
sbp.cursor = sbp.limit - v_1;
if (!sbp.eq_s_b(1, "\u044F")) return false;
}
case 2:
sbp.slice_del();
break;
}
return true;
}
return false;
}
function r_perfective_gerund() {
return habr2(a_0, 9);
}
function habr1(a, n) {
var among_var;
sbp.ket = sbp.cursor;
among_var = sbp.find_among_b(a, n);
if (among_var) {
sbp.bra = sbp.cursor;
if (among_var == 1) sbp.slice_del();
return true;
}
return false;
}
function r_adjective() {
return habr1(a_1, 26);
}
function r_adjectival() {
var among_var;
if (r_adjective()) {
habr2(a_2, 8);
return true;
}
return false;
}
function r_reflexive() {
return habr1(a_3, 2);
}
function r_verb() {
return habr2(a_4, 46);
}
function r_noun() {
habr1(a_5, 36);
}
function r_derivational() {
var among_var;
sbp.ket = sbp.cursor;
among_var = sbp.find_among_b(a_6, 2);
if (among_var) {
sbp.bra = sbp.cursor;
if (r_R2() && among_var == 1) sbp.slice_del();
}
}
function r_tidy_up() {
var among_var;
sbp.ket = sbp.cursor;
among_var = sbp.find_among_b(a_7, 4);
if (among_var) {
sbp.bra = sbp.cursor;
switch (among_var) {
case 1:
sbp.slice_del();
sbp.ket = sbp.cursor;
if (!sbp.eq_s_b(1, "\u043D")) break;
sbp.bra = sbp.cursor;
case 2:
if (!sbp.eq_s_b(1, "\u043D")) break;
case 3:
sbp.slice_del();
break;
}
}
}
this.stem = function () {
r_mark_regions();
sbp.cursor = sbp.limit;
if (sbp.cursor < I_pV) return false;
sbp.limit_backward = I_pV;
if (!r_perfective_gerund()) {
sbp.cursor = sbp.limit;
if (!r_reflexive()) sbp.cursor = sbp.limit;
if (!r_adjectival()) {
sbp.cursor = sbp.limit;
if (!r_verb()) {
sbp.cursor = sbp.limit;
r_noun();
}
}
}
sbp.cursor = sbp.limit;
sbp.ket = sbp.cursor;
if (sbp.eq_s_b(1, "\u0438")) {
sbp.bra = sbp.cursor;
sbp.slice_del();
} else sbp.cursor = sbp.limit;
r_derivational();
sbp.cursor = sbp.limit;
r_tidy_up();
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.ru.stemmer, "stemmer-ru");
lunr.ru.stopWordFilter = lunr.generateStopWordFilter(
"алло без близко более больше будем будет будете будешь будто буду будут будь бы бывает бывь был была были было быть в важная важное важные важный вам вами вас ваш ваша ваше ваши вверх вдали вдруг ведь везде весь вниз внизу во вокруг вон восемнадцатый восемнадцать восемь восьмой вот впрочем времени время все всегда всего всем всеми всему всех всею всю всюду вся всё второй вы г где говорил говорит год года году да давно даже далеко дальше даром два двадцатый двадцать две двенадцатый двенадцать двух девятнадцатый девятнадцать девятый девять действительно дел день десятый десять для до довольно долго должно другая другие других друго другое другой е его ее ей ему если есть еще ещё ею её ж же жизнь за занят занята занято заняты затем зато зачем здесь значит и из или им именно иметь ими имя иногда их к каждая каждое каждые каждый кажется как какая какой кем когда кого ком кому конечно которая которого которой которые который которых кроме кругом кто куда лет ли лишь лучше люди м мало между меля менее меньше меня миллионов мимо мира мне много многочисленная многочисленное многочисленные многочисленный мной мною мог могут мож может можно можхо мои мой мор мочь моя моё мы на наверху над надо назад наиболее наконец нам нами нас начала наш наша наше наши не него недавно недалеко нее ней нельзя нем немного нему непрерывно нередко несколько нет нею неё ни нибудь ниже низко никогда никуда ними них ничего но ну нужно нх о об оба обычно один одиннадцатый одиннадцать однажды однако одного одной около он она они оно опять особенно от отовсюду отсюда очень первый перед по под пожалуйста позже пока пор пора после посреди потом потому почему почти прекрасно при про просто против процентов пятнадцатый пятнадцать пятый пять раз разве рано раньше рядом с сам сама сами самим самими самих само самого самой самом самому саму свое своего своей свои своих свою сеаой себе себя сегодня седьмой сейчас семнадцатый семнадцать семь сих сказал сказала сказать сколько слишком сначала снова со собой собою совсем спасибо стал суть т та так такая также такие такое такой там твой твоя твоё те тебе тебя тем теми теперь тех то тобой тобою тогда того тоже только том тому тот тою третий три тринадцатый тринадцать ту туда тут ты тысяч у уж уже уметь хорошо хотеть хоть хотя хочешь часто чаще чего человек чем чему через четвертый четыре четырнадцатый четырнадцать что чтоб чтобы чуть шестнадцатый шестнадцать шестой шесть эта эти этим этими этих это этого этой этом этому этот эту я а".split(
" "
)
);
lunr.Pipeline.registerFunction(lunr.ru.stopWordFilter, "stopWordFilter-ru");
};
});

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,311 @@
/*!
* 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) {
/* provides utilities for the included stemmers */
lunr.stemmerSupport = {
Among: function (s, substring_i, result, method) {
this.toCharArray = function (s) {
var sLength = s.length,
charArr = new Array(sLength);
for (var i = 0; i < sLength; i++) charArr[i] = s.charCodeAt(i);
return charArr;
};
if ((!s && s != "") || (!substring_i && substring_i != 0) || !result)
throw (
"Bad Among initialisation: s:" +
s +
", substring_i: " +
substring_i +
", result: " +
result
);
this.s_size = s.length;
this.s = this.toCharArray(s);
this.substring_i = substring_i;
this.result = result;
this.method = method;
},
SnowballProgram: function () {
var current;
return {
bra: 0,
ket: 0,
limit: 0,
cursor: 0,
limit_backward: 0,
setCurrent: function (word) {
current = word;
this.cursor = 0;
this.limit = word.length;
this.limit_backward = 0;
this.bra = this.cursor;
this.ket = this.limit;
},
getCurrent: function () {
var result = current;
current = null;
return result;
},
in_grouping: function (s, min, max) {
if (this.cursor < this.limit) {
var ch = current.charCodeAt(this.cursor);
if (ch <= max && ch >= min) {
ch -= min;
if (s[ch >> 3] & (0x1 << (ch & 0x7))) {
this.cursor++;
return true;
}
}
}
return false;
},
in_grouping_b: function (s, min, max) {
if (this.cursor > this.limit_backward) {
var ch = current.charCodeAt(this.cursor - 1);
if (ch <= max && ch >= min) {
ch -= min;
if (s[ch >> 3] & (0x1 << (ch & 0x7))) {
this.cursor--;
return true;
}
}
}
return false;
},
out_grouping: function (s, min, max) {
if (this.cursor < this.limit) {
var ch = current.charCodeAt(this.cursor);
if (ch > max || ch < min) {
this.cursor++;
return true;
}
ch -= min;
if (!(s[ch >> 3] & (0x1 << (ch & 0x7)))) {
this.cursor++;
return true;
}
}
return false;
},
out_grouping_b: function (s, min, max) {
if (this.cursor > this.limit_backward) {
var ch = current.charCodeAt(this.cursor - 1);
if (ch > max || ch < min) {
this.cursor--;
return true;
}
ch -= min;
if (!(s[ch >> 3] & (0x1 << (ch & 0x7)))) {
this.cursor--;
return true;
}
}
return false;
},
eq_s: function (s_size, s) {
if (this.limit - this.cursor < s_size) return false;
for (var i = 0; i < s_size; i++)
if (current.charCodeAt(this.cursor + i) != s.charCodeAt(i))
return false;
this.cursor += s_size;
return true;
},
eq_s_b: function (s_size, s) {
if (this.cursor - this.limit_backward < s_size) return false;
for (var i = 0; i < s_size; i++)
if (
current.charCodeAt(this.cursor - s_size + i) != s.charCodeAt(i)
)
return false;
this.cursor -= s_size;
return true;
},
find_among: function (v, v_size) {
var i = 0,
j = v_size,
c = this.cursor,
l = this.limit,
common_i = 0,
common_j = 0,
first_key_inspected = false;
while (true) {
var k = i + ((j - i) >> 1),
diff = 0,
common = common_i < common_j ? common_i : common_j,
w = v[k];
for (var i2 = common; i2 < w.s_size; i2++) {
if (c + common == l) {
diff = -1;
break;
}
diff = current.charCodeAt(c + common) - w.s[i2];
if (diff) break;
common++;
}
if (diff < 0) {
j = k;
common_j = common;
} else {
i = k;
common_i = common;
}
if (j - i <= 1) {
if (i > 0 || j == i || first_key_inspected) break;
first_key_inspected = true;
}
}
while (true) {
var w = v[i];
if (common_i >= w.s_size) {
this.cursor = c + w.s_size;
if (!w.method) return w.result;
var res = w.method();
this.cursor = c + w.s_size;
if (res) return w.result;
}
i = w.substring_i;
if (i < 0) return 0;
}
},
find_among_b: function (v, v_size) {
var i = 0,
j = v_size,
c = this.cursor,
lb = this.limit_backward,
common_i = 0,
common_j = 0,
first_key_inspected = false;
while (true) {
var k = i + ((j - i) >> 1),
diff = 0,
common = common_i < common_j ? common_i : common_j,
w = v[k];
for (var i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
if (c - common == lb) {
diff = -1;
break;
}
diff = current.charCodeAt(c - 1 - common) - w.s[i2];
if (diff) break;
common++;
}
if (diff < 0) {
j = k;
common_j = common;
} else {
i = k;
common_i = common;
}
if (j - i <= 1) {
if (i > 0 || j == i || first_key_inspected) break;
first_key_inspected = true;
}
}
while (true) {
var w = v[i];
if (common_i >= w.s_size) {
this.cursor = c - w.s_size;
if (!w.method) return w.result;
var res = w.method();
this.cursor = c - w.s_size;
if (res) return w.result;
}
i = w.substring_i;
if (i < 0) return 0;
}
},
replace_s: function (c_bra, c_ket, s) {
var adjustment = s.length - (c_ket - c_bra),
left = current.substring(0, c_bra),
right = current.substring(c_ket);
current = left + s + right;
this.limit += adjustment;
if (this.cursor >= c_ket) this.cursor += adjustment;
else if (this.cursor > c_bra) this.cursor = c_bra;
return adjustment;
},
slice_check: function () {
if (
this.bra < 0 ||
this.bra > this.ket ||
this.ket > this.limit ||
this.limit > current.length
)
throw "faulty slice operation";
},
slice_from: function (s) {
this.slice_check();
this.replace_s(this.bra, this.ket, s);
},
slice_del: function () {
this.slice_from("");
},
insert: function (c_bra, c_ket, s) {
var adjustment = this.replace_s(c_bra, c_ket, s);
if (c_bra <= this.bra) this.bra += adjustment;
if (c_bra <= this.ket) this.ket += adjustment;
},
slice_to: function () {
this.slice_check();
return current.substring(this.bra, this.ket);
},
eq_v_b: function (s) {
return this.eq_s_b(s.length, s);
},
};
},
};
lunr.trimmerSupport = {
generateTrimmer: function (wordCharacters) {
var startRegex = new RegExp("^[^" + wordCharacters + "]+");
var endRegex = new RegExp("[^" + wordCharacters + "]+$");
return function (token) {
// for lunr version 2
if (typeof token.update === "function") {
return token.update(function (s) {
return s.replace(startRegex, "").replace(endRegex, "");
});
} else {
// for lunr version 1
return token.replace(startRegex, "").replace(endRegex, "");
}
};
},
};
};
});

View file

@ -0,0 +1,311 @@
/*!
* Lunr languages, `Swedish` 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.sv = function () {
this.pipeline.reset();
this.pipeline.add(
lunr.sv.trimmer,
lunr.sv.stopWordFilter,
lunr.sv.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.sv.stemmer);
}
};
/* lunr trimmer function */
lunr.sv.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.sv.trimmer = lunr.trimmerSupport.generateTrimmer(
lunr.sv.wordCharacters
);
lunr.Pipeline.registerFunction(lunr.sv.trimmer, "trimmer-sv");
/* lunr stemmer function */
lunr.sv.stemmer = (function () {
/* create the wrapped stemmer object */
var Among = lunr.stemmerSupport.Among,
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
st = new (function SwedishStemmer() {
var a_0 = [
new Among("a", -1, 1),
new Among("arna", 0, 1),
new Among("erna", 0, 1),
new Among("heterna", 2, 1),
new Among("orna", 0, 1),
new Among("ad", -1, 1),
new Among("e", -1, 1),
new Among("ade", 6, 1),
new Among("ande", 6, 1),
new Among("arne", 6, 1),
new Among("are", 6, 1),
new Among("aste", 6, 1),
new Among("en", -1, 1),
new Among("anden", 12, 1),
new Among("aren", 12, 1),
new Among("heten", 12, 1),
new Among("ern", -1, 1),
new Among("ar", -1, 1),
new Among("er", -1, 1),
new Among("heter", 18, 1),
new Among("or", -1, 1),
new Among("s", -1, 2),
new Among("as", 21, 1),
new Among("arnas", 22, 1),
new Among("ernas", 22, 1),
new Among("ornas", 22, 1),
new Among("es", 21, 1),
new Among("ades", 26, 1),
new Among("andes", 26, 1),
new Among("ens", 21, 1),
new Among("arens", 29, 1),
new Among("hetens", 29, 1),
new Among("erns", 21, 1),
new Among("at", -1, 1),
new Among("andet", -1, 1),
new Among("het", -1, 1),
new Among("ast", -1, 1),
],
a_1 = [
new Among("dd", -1, -1),
new Among("gd", -1, -1),
new Among("nn", -1, -1),
new Among("dt", -1, -1),
new Among("gt", -1, -1),
new Among("kt", -1, -1),
new Among("tt", -1, -1),
],
a_2 = [
new Among("ig", -1, 1),
new Among("lig", 0, 1),
new Among("els", -1, 1),
new Among("fullt", -1, 3),
new Among("l\u00F6st", -1, 2),
],
g_v = [
17,
65,
16,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
0,
32,
],
g_s_ending = [119, 127, 149],
I_x,
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,
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, 246)) {
sbp.cursor = v_1;
break;
}
sbp.cursor = v_1;
if (sbp.cursor >= sbp.limit) return;
sbp.cursor++;
}
while (!sbp.out_grouping(g_v, 97, 246)) {
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_2 = sbp.limit_backward;
if (sbp.cursor >= I_p1) {
sbp.limit_backward = I_p1;
sbp.cursor = sbp.limit;
sbp.ket = sbp.cursor;
among_var = sbp.find_among_b(a_0, 37);
sbp.limit_backward = v_2;
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, 98, 121)) sbp.slice_del();
break;
}
}
}
}
function r_consonant_pair() {
var v_1 = sbp.limit_backward;
if (sbp.cursor >= I_p1) {
sbp.limit_backward = I_p1;
sbp.cursor = sbp.limit;
if (sbp.find_among_b(a_1, 7)) {
sbp.cursor = sbp.limit;
sbp.ket = sbp.cursor;
if (sbp.cursor > sbp.limit_backward) {
sbp.bra = --sbp.cursor;
sbp.slice_del();
}
}
sbp.limit_backward = v_1;
}
}
function r_other_suffix() {
var among_var, v_2;
if (sbp.cursor >= I_p1) {
v_2 = sbp.limit_backward;
sbp.limit_backward = I_p1;
sbp.cursor = sbp.limit;
sbp.ket = sbp.cursor;
among_var = sbp.find_among_b(a_2, 5);
if (among_var) {
sbp.bra = sbp.cursor;
switch (among_var) {
case 1:
sbp.slice_del();
break;
case 2:
sbp.slice_from("l\u00F6s");
break;
case 3:
sbp.slice_from("full");
break;
}
}
sbp.limit_backward = v_2;
}
}
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();
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.sv.stemmer, "stemmer-sv");
lunr.sv.stopWordFilter = lunr.generateStopWordFilter(
"alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du där då efter ej eller en er era ert ett från för ha hade han hans har henne hennes hon honom hur här i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu när någon något några och om oss på samma sedan sig sin sina sitta själv skulle som så sådan sådana sådant till under upp ut utan vad var vara varför varit varje vars vart vem vi vid vilka vilkas vilken vilket vår våra vårt än är åt över".split(
" "
)
);
lunr.Pipeline.registerFunction(lunr.sv.stopWordFilter, "stopWordFilter-sv");
};
});

View file

@ -0,0 +1,109 @@
/*!
* Lunr languages, `Thai` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2017, Keerati Thiwanruk
* 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."
);
}
/*
Thai tokenization is the same to Japanense, which does not take into account spaces.
So, it uses the same logic to assign tokenization function due to different Lunr versions.
*/
var isLunr2 = lunr.version[0] == "2";
/* register specific locale function */
lunr.th = function () {
this.pipeline.reset();
this.pipeline.add(
/*lunr.th.stopWordFilter,*/
lunr.th.trimmer
);
if (isLunr2) {
// for lunr version 2.0.0
this.tokenizer = lunr.th.tokenizer;
} else {
if (lunr.tokenizer) {
// for lunr version 0.6.0
lunr.tokenizer = lunr.th.tokenizer;
}
if (this.tokenizerFn) {
// for lunr version 0.7.0 -> 1.0.0
this.tokenizerFn = lunr.th.tokenizer;
}
}
};
/* lunr trimmer function */
lunr.th.wordCharacters = "[\u0e00-\u0e7f]";
lunr.th.trimmer = lunr.trimmerSupport.generateTrimmer(
lunr.th.wordCharacters
);
lunr.Pipeline.registerFunction(lunr.th.trimmer, "trimmer-th");
var segmenter = lunr.wordcut;
segmenter.init();
lunr.th.tokenizer = function (obj) {
//console.log(obj);
if (!arguments.length || obj == null || obj == undefined) return [];
if (Array.isArray(obj))
return obj.map(function (t) {
return isLunr2 ? new lunr.Token(t) : t;
});
var str = obj.toString().replace(/^\s+/, "");
return segmenter.cut(str).split("|");
};
};
});

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,90 @@
/*!
* Lunr languages, `Vietnamese` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2017, Keerati Thiwanruk
* 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.vi = function () {
this.pipeline.reset();
this.pipeline.add(lunr.vi.stopWordFilter, lunr.vi.trimmer);
};
/* lunr trimmer function */
lunr.vi.wordCharacters =
"[" +
"A-Za-z" +
"\u0300\u0350" + // dấu huyền
"\u0301\u0351" + // dấu sắc
"\u0309" + // dấu hỏi
"\u0323" + // dấu nặng
"\u0303\u0343" + // dấu ngã
"\u00C2\u00E2" + // Â
"\u00CA\u00EA" + // Ê
"\u00D4\u00F4" + // Ô
"\u0102-\u0103" + // Ă
"\u0110-\u0111" + // Đ
"\u01A0-\u01A1" + // Ơ
"\u01AF-\u01B0" + // Ư
"]";
lunr.vi.trimmer = lunr.trimmerSupport.generateTrimmer(
lunr.vi.wordCharacters
);
lunr.Pipeline.registerFunction(lunr.vi.trimmer, "trimmer-vi");
lunr.vi.stopWordFilter = lunr.generateStopWordFilter(
"là cái nhưng mà".split(" ")
);
};
});

View file

@ -0,0 +1,156 @@
/*!
* Lunr languages, `Chinese` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2019, Felix Lian (repairearth)
* http://www.mozilla.org/MPL/
*/
/*!
* based on
* Snowball zhvaScript 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."
);
}
/*
Chinese 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.zh = function () {
this.pipeline.reset();
this.pipeline.add(
lunr.zh.trimmer,
lunr.zh.stopWordFilter,
lunr.zh.stemmer
);
// change the tokenizer for Chinese one
if (isLunr2) {
// for lunr version 2.0.0
this.tokenizer = lunr.zh.tokenizer;
} else {
if (lunr.tokenizer) {
// for lunr version 0.6.0
lunr.tokenizer = lunr.zh.tokenizer;
}
if (this.tokenizerFn) {
// for lunr version 0.7.0 -> 1.0.0
this.tokenizerFn = lunr.zh.tokenizer;
}
}
};
lunr.zh.tokenizer = function (obj) {
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();
});
var str = obj.toString().trim().toLowerCase();
var tokens = [];
lunr.segmentit &&
lunr.segmentit.doSegment(str).forEach(function (seg) {
tokens = tokens.concat(seg.w.split(" "));
});
tokens = tokens.filter(function (token) {
return !!token;
});
var fromIndex = 0;
return tokens.map(function (token, index) {
if (isLunr2) {
var start = str.indexOf(token, fromIndex);
var tokenMetadata = {};
tokenMetadata["position"] = [start, token.length];
tokenMetadata["index"] = index;
fromIndex = start;
return new lunr.Token(token, tokenMetadata);
} else {
return token;
}
});
};
/* lunr trimmer function */
lunr.zh.wordCharacters = "\\w\u4e00-\u9fa5";
lunr.zh.trimmer = lunr.trimmerSupport.generateTrimmer(
lunr.zh.wordCharacters
);
lunr.Pipeline.registerFunction(lunr.zh.trimmer, "trimmer-zh");
/* lunr stemmer function */
lunr.zh.stemmer = (function () {
/* TODO Chinese stemmer */
return function (word) {
return word;
};
})();
lunr.Pipeline.registerFunction(lunr.zh.stemmer, "stemmer-zh");
/* lunr stop word filter. see https://www.ranks.nl/stopwords/chinese-stopwords */
lunr.zh.stopWordFilter = lunr.generateStopWordFilter(
"的 一 不 在 人 有 是 为 以 于 上 他 而 后 之 来 及 了 因 下 可 到 由 这 与 也 此 但 并 个 其 已 无 小 我 们 起 最 再 今 去 好 只 又 或 很 亦 某 把 那 你 乃 它 吧 被 比 别 趁 当 从 到 得 打 凡 儿 尔 该 各 给 跟 和 何 还 即 几 既 看 据 距 靠 啦 了 另 么 每 们 嘛 拿 哪 那 您 凭 且 却 让 仍 啥 如 若 使 谁 虽 随 同 所 她 哇 嗡 往 哪 些 向 沿 哟 用 于 咱 则 怎 曾 至 致 着 诸 自".split(
" "
)
);
lunr.Pipeline.registerFunction(lunr.zh.stopWordFilter, "stopWordFilter-zh");
};
});

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,305 @@
/**
* Create a new [Mapbox GL JS plugin](https://www.mapbox.com/blog/build-mapbox-gl-js-plugins/) that
* modifies the layers of the map style to use the 'text-field' that matches the browser language.
* @constructor
* @param {object} options - Options to configure the plugin.
* @param {string[]} [options.supportedLanguages] - List of supported languages
* @param {Function} [options.languageTransform] - Custom style transformation to apply
* @param {RegExp} [options.languageField=/^\{name/] - RegExp to match if a text-field is a language field
* @param {Function} [options.getLanguageField] - Given a language choose the field in the vector tiles
* @param {string} [options.languageSource] - Name of the source that contains the different languages.
* @param {string} [options.defaultLanguage] - Name of the default language to initialize style after loading.
* @param {string[]} [options.excludedLayerIds] - Name of the layers that should be excluded from translation.
*/
function MapboxLanguage(options) {
options = Object.assign({}, options);
if (!(this instanceof MapboxLanguage)) {
throw new Error("MapboxLanguage needs to be called with the new keyword");
}
this.setLanguage = this.setLanguage.bind(this);
this._initialStyleUpdate = this._initialStyleUpdate.bind(this);
this._defaultLanguage = options.defaultLanguage;
this._isLanguageField = options.languageField || /^\{name/;
this._getLanguageField =
options.getLanguageField ||
function nameField(language) {
return language === "mul" ? "{name}" : "{name_" + language + "}";
};
this._languageSource = options.languageSource || null;
this._languageTransform =
options.languageTransform ||
function (style, language) {
if (language === "ar") {
return noSpacing(style);
} else {
return standardSpacing(style);
}
};
this._excludedLayerIds = options.excludedLayerIds || [];
this.supportedLanguages = options.supportedLanguages || [
"ar",
"en",
"es",
"fr",
"de",
"ja",
"ko",
"mul",
"pt",
"ru",
"zh",
];
}
function standardSpacing(style) {
var changedLayers = style.layers.map(function (layer) {
if (!(layer.layout || {})["text-field"]) return layer;
var spacing = 0;
if (layer["source-layer"] === "state_label") {
spacing = 0.15;
}
if (layer["source-layer"] === "marine_label") {
if (/-lg/.test(layer.id)) {
spacing = 0.25;
}
if (/-md/.test(layer.id)) {
spacing = 0.15;
}
if (/-sm/.test(layer.id)) {
spacing = 0.1;
}
}
if (layer["source-layer"] === "place_label") {
if (/-suburb/.test(layer.id)) {
spacing = 0.15;
}
if (/-neighbour/.test(layer.id)) {
spacing = 0.1;
}
if (/-islet/.test(layer.id)) {
spacing = 0.01;
}
}
if (layer["source-layer"] === "airport_label") {
spacing = 0.01;
}
if (layer["source-layer"] === "rail_station_label") {
spacing = 0.01;
}
if (layer["source-layer"] === "poi_label") {
if (/-scalerank/.test(layer.id)) {
spacing = 0.01;
}
}
if (layer["source-layer"] === "road_label") {
if (/-label-/.test(layer.id)) {
spacing = 0.01;
}
if (/-shields/.test(layer.id)) {
spacing = 0.05;
}
}
return Object.assign({}, layer, {
layout: Object.assign({}, layer.layout, {
"text-letter-spacing": spacing,
}),
});
});
return Object.assign({}, style, {
layers: changedLayers,
});
}
function noSpacing(style) {
var changedLayers = style.layers.map(function (layer) {
if (!(layer.layout || {})["text-field"]) return layer;
var spacing = 0;
return Object.assign({}, layer, {
layout: Object.assign({}, layer.layout, {
"text-letter-spacing": spacing,
}),
});
});
return Object.assign({}, style, {
layers: changedLayers,
});
}
function isNameStringField(isLangField, property) {
return typeof property === "string" && isLangField.test(property);
}
function isNameFunctionField(isLangField, property) {
return (
property.stops &&
property.stops.filter(function (stop) {
return isLangField.test(stop[1]);
}).length > 0
);
}
function adaptPropertyLanguage(isLangField, property, languageFieldName) {
if (isNameStringField(isLangField, property)) return languageFieldName;
if (isNameFunctionField(isLangField, property)) {
var newStops = property.stops.map(function (stop) {
if (isLangField.test(stop[1])) {
return [stop[0], languageFieldName];
}
return stop;
});
return Object.assign({}, property, {
stops: newStops,
});
}
return property;
}
function changeLayerTextProperty(
isLangField,
layer,
languageFieldName,
excludedLayerIds
) {
if (
layer.layout &&
layer.layout["text-field"] &&
excludedLayerIds.indexOf(layer.id) === -1
) {
return Object.assign({}, layer, {
layout: Object.assign({}, layer.layout, {
"text-field": adaptPropertyLanguage(
isLangField,
layer.layout["text-field"],
languageFieldName
),
}),
});
}
return layer;
}
function findStreetsSource(style) {
var sources = Object.keys(style.sources).filter(function (sourceName) {
var source = style.sources[sourceName];
return /mapbox-streets-v\d/.test(source.url);
});
return sources[0];
}
/**
* Explicitly change the language for a style.
* @param {object} style - Mapbox GL style to modify
* @param {string} language - The language iso code
* @returns {object} the modified style
*/
MapboxLanguage.prototype.setLanguage = function (style, language) {
if (this.supportedLanguages.indexOf(language) < 0)
throw new Error("Language " + language + " is not supported");
var streetsSource = this._languageSource || findStreetsSource(style);
if (!streetsSource) return style;
var field = this._getLanguageField(language);
var isLangField = this._isLanguageField;
var excludedLayerIds = this._excludedLayerIds;
var changedLayers = style.layers.map(function (layer) {
if (layer.source === streetsSource)
return changeLayerTextProperty(
isLangField,
layer,
field,
excludedLayerIds
);
return layer;
});
var languageStyle = Object.assign({}, style, {
layers: changedLayers,
});
return this._languageTransform(languageStyle, language);
};
MapboxLanguage.prototype._initialStyleUpdate = function () {
var style = this._map.getStyle();
var language =
this._defaultLanguage || browserLanguage(this.supportedLanguages);
// We only update the style once
this._map.off("styledata", this._initialStyleUpdate);
this._map.setStyle(this.setLanguage(style, language));
};
function browserLanguage(supportedLanguages) {
var language = navigator.languages
? navigator.languages[0]
: navigator.language || navigator.userLanguage;
var parts = language.split("-");
var languageCode = language;
if (parts.length > 1) {
languageCode = parts[0];
}
if (supportedLanguages.indexOf(languageCode) > -1) {
return languageCode;
}
return null;
}
MapboxLanguage.prototype.onAdd = function (map) {
this._map = map;
this._map.on("styledata", this._initialStyleUpdate);
this._container = document.createElement("div");
return this._container;
};
MapboxLanguage.prototype.onRemove = function () {
this._map.off("styledata", this._initialStyleUpdate);
this._map = undefined;
};
function ie11Polyfill() {
if (typeof Object.assign != "function") {
// Must be writable: true, enumerable: false, configurable: true
Object.defineProperty(Object, "assign", {
// eslint-disable-next-line no-unused-vars
value: function assign(target, varArgs) {
// .length of function is 2
// eslint-disable-next-line strict
"use strict";
if (target === null) {
// TypeError if undefined or null
throw new TypeError("Cannot convert undefined or null to object");
}
var to = Object(target);
for (var index = 1; index < arguments.length; index++) {
var nextSource = arguments[index];
if (nextSource !== null) {
// Skip over if undefined or null
for (var nextKey in nextSource) {
// Avoid bugs when hasOwnProperty is shadowed
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
to[nextKey] = nextSource[nextKey];
}
}
}
}
return to;
},
writable: true,
configurable: true,
});
}
}
if (typeof module !== "undefined" && typeof module.exports !== "undefined") {
module.exports = MapboxLanguage;
} else {
ie11Polyfill();
window.MapboxLanguage = MapboxLanguage;
}

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show more