Skip to content

Commit

Permalink
Merge branch 'master' into add-recommend-dict-description
Browse files Browse the repository at this point in the history
  • Loading branch information
khaitruong922 authored Sep 2, 2024
2 parents 905edf9 + 3b3fd67 commit 641648b
Show file tree
Hide file tree
Showing 17 changed files with 193 additions and 25 deletions.
File renamed without changes.
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/3-language-feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: Language specific issue
about: Report a language-specific issue or feature request
title: '[REPLACE ME WITH YOUR REQUESTED LANGUAGE]: '
labels: 'area/linguistics'
assignees: ''

---

File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Performance Benchmarks

permissions:
contents: read
on:
push:
branches: [master]
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
# supported CodeQL languages.
#
name: "CodeQL"

permissions:
contents: read
on:
push:
branches: [ "master" ]
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/publish-edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ jobs:
environment: cd
outputs:
result: ${{ steps.webStorePublish.outcome }}
permissions:
actions: write
steps:
- uses: robinraju/release-downloader@a96f54c1b5f5e09e47d9504526e96febd949d4c2 # pin@v1.11
with:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ jobs:
runs-on: ubuntu-latest
permissions:
actions: write
contents: write
steps:
- name: Dispatch publish-chrome
uses: aurelien-baudet/workflow-dispatch@3133c5d135c7dbe4be4f9793872b6ef331b53bc7 # pin@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
with:
results_file: results.sarif
results_format: sarif
Expand Down
15 changes: 15 additions & 0 deletions benches/japanese-language-transformer.bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ describe('japanese language transformer', () => {
'食べられる',
'食べられる',
'食べさせる',
'食べさす',
'食べさせられる',
'食べろ',
'食べない',
Expand All @@ -60,6 +61,7 @@ describe('japanese language transformer', () => {
'食べられない',
'食べられない',
'食べさせない',
'食べささない',
'食べさせられない',
'食べ',
'食べれば',
Expand All @@ -85,6 +87,9 @@ describe('japanese language transformer', () => {
'食べてる',
'食べとる',
'食べてしまう',
'食べん',
'食べんかった',
'食べんばかり',
];

const inflectionCombinations = [
Expand All @@ -103,6 +108,7 @@ describe('japanese language transformer', () => {
'こられる',
'こられる',
'こさせる',
'こさす',
'こさせられる',
'こい',
'こない',
Expand All @@ -113,6 +119,7 @@ describe('japanese language transformer', () => {
'こられない',
'こられない',
'こさせない',
'こささない',
'こさせられない',
'くるな',
'きまして',
Expand Down Expand Up @@ -141,6 +148,9 @@ describe('japanese language transformer', () => {
'きてる',
'きとる',
'きてしまう',
'こん',
'こんかった',
'こんばかり',
];

const suruInflections = [
Expand All @@ -154,6 +164,7 @@ describe('japanese language transformer', () => {
'せられる',
'される',
'させる',
'さす',
'せさせる',
'させられる',
'せさせられる',
Expand All @@ -167,6 +178,7 @@ describe('japanese language transformer', () => {
'されない',
'させない',
'せさせない',
'ささない',
'させられない',
'せさせられない',
'するな',
Expand Down Expand Up @@ -195,6 +207,9 @@ describe('japanese language transformer', () => {
'してる',
'しとる',
'してしまう',
'せん',
'せんかった',
'せんばかり',
];

const kansaibenInflections = [
Expand Down
2 changes: 1 addition & 1 deletion ext/js/background/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ export class Backend {
let apiKey = options.anki.apiKey;
if (apiKey === '') { apiKey = null; }
this._anki.server = options.anki.server;
this._anki.enabled = options.anki.enable && enabled;
this._anki.enabled = options.anki.enable;
this._anki.apiKey = apiKey;

this._mecab.setEnabled(options.parsing.enableMecabParser && enabled);
Expand Down
100 changes: 86 additions & 14 deletions ext/js/language/ja/japanese-transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const conditions = {
},
],
isDictionaryForm: true,
subConditions: ['v5d', 'v5m'],
subConditions: ['v5d', 'v5m', 'v5s'],
},
'v5d': {
name: 'Godan verb, dictionary form',
Expand All @@ -92,6 +92,10 @@ const conditions = {
name: 'Godan verb, polite (masu) form',
isDictionaryForm: false,
},
'v5s': {
name: 'Godan verb, short causative form',
isDictionaryForm: false,
},
'vk': {
name: 'Kuru verb',
i18n: [
Expand Down Expand Up @@ -697,9 +701,9 @@ export const japaneseTransforms = {
},
'-n': {
name: '-n',
description: '1. Negative form of verbs; a sound change of ぬ.\n' +
'2. (As …んばかり) Shows an action or condition is on the verge of occurring, or an excessive/extreme degree.\n' +
'Usage: Attach ん to the irrealis form (mizenkei) of verbs.',
description: 'Negative form of verbs; a sound change of ぬ.\n' +
'Usage: Attach ん to the irrealis form (mizenkei) of verbs.\n' +
'する becomes せん',
i18n: [
{
language: 'ja',
Expand Down Expand Up @@ -728,7 +732,9 @@ export const japaneseTransforms = {
},
'-n past': {
name: '-n',
description: 'Past negative form of verbs; a sound change of ぬ.\n',
description: 'Past negative form of verbs; a sound change of ぬ.\n' +
'Usage: Attach んかった to the irrealis form (mizenkei) of verbs.\n' +
'する becomes せんかった',
i18n: [
{
language: 'ja',
Expand Down Expand Up @@ -756,6 +762,37 @@ export const japaneseTransforms = {
suffixInflection('ませんかった', 'ません', [], ['v']),
],
},
'-nbakari': {
name: '-nbakari',
description: 'Shows an action or condition is on the verge of occurring, or an excessive/extreme degree.\n' +
'Usage: Attach んばかり to the irrealis form (mizenkei) of verbs.\n' +
'する becomes せんばかり',
i18n: [
{
language: 'ja',
name: '~ん',
description: '今にもそうなりそうな、しかし辛うじてそうなっていないようなさまを指す表現',
},
],
rules: [
suffixInflection('んばかり', 'る', [], ['v1']),
suffixInflection('かんばかり', 'く', [], ['v5']),
suffixInflection('がんばかり', 'ぐ', [], ['v5']),
suffixInflection('さんばかり', 'す', [], ['v5']),
suffixInflection('たんばかり', 'つ', [], ['v5']),
suffixInflection('なんばかり', 'ぬ', [], ['v5']),
suffixInflection('ばんばかり', 'ぶ', [], ['v5']),
suffixInflection('まんばかり', 'む', [], ['v5']),
suffixInflection('らんばかり', 'る', [], ['v5']),
suffixInflection('わんばかり', 'う', [], ['v5']),
suffixInflection('ぜんばかり', 'ずる', [], ['vz']),
suffixInflection('せんばかり', 'する', [], ['vs']),
suffixInflection('為んばかり', '為る', [], ['vs']),
suffixInflection('こんばかり', 'くる', [], ['vk']),
suffixInflection('来んばかり', '来る', [], ['vk']),
suffixInflection('來んばかり', '來る', [], ['vk']),
],
},
'-mu': {
name: '-mu',
description: 'Archaic.\n' +
Expand Down Expand Up @@ -898,6 +935,41 @@ export const japaneseTransforms = {
suffixInflection('來させる', '來る', ['v1'], ['vk']),
],
},
'short causative': {
name: 'short causative',
description: 'Contraction of the causative form.\n' +
'Describes the intention to make someone do something.\n' +
'Usage: Attach す to the irrealis form (mizenkei) of godan verbs.\n' +
'Attach さす to the dictionary form (shuushikei) of ichidan verbs.\n' +
'する becomes さす, くる becomes こさす.\n' +
'It itself conjugates as an godan verb.',
i18n: [
{
language: 'ja',
name: '使役形の短縮形',
description: 'だれかにある行為をさせる意を表わす時の言い方。例、「食べさす」の「さす」。',
},
],
rules: [
suffixInflection('さす', 'る', ['v5s'], ['v1']),
suffixInflection('かす', 'く', ['v5s'], ['v5']),
suffixInflection('がす', 'ぐ', ['v5s'], ['v5']),
suffixInflection('さす', 'す', ['v5s'], ['v5']),
suffixInflection('たす', 'つ', ['v5s'], ['v5']),
suffixInflection('なす', 'ぬ', ['v5s'], ['v5']),
suffixInflection('ばす', 'ぶ', ['v5s'], ['v5']),
suffixInflection('ます', 'む', ['v5s'], ['v5']),
suffixInflection('らす', 'る', ['v5s'], ['v5']),
suffixInflection('わす', 'う', ['v5s'], ['v5']),
suffixInflection('じさす', 'ずる', ['v5s'], ['vz']),
suffixInflection('ぜさす', 'ずる', ['v5s'], ['vz']),
suffixInflection('さす', 'する', ['v5s'], ['vs']),
suffixInflection('為す', '為る', ['v5s'], ['vs']),
suffixInflection('こさす', 'くる', ['v5s'], ['vk']),
suffixInflection('来さす', '来る', ['v5s'], ['vk']),
suffixInflection('來さす', '來る', ['v5s'], ['vk']),
],
},
'imperative': {
name: 'imperative',
description: '1. To give orders.\n' +
Expand Down Expand Up @@ -1132,15 +1204,15 @@ export const japaneseTransforms = {
],
rules: [
suffixInflection('ます', 'る', ['v1'], ['v1']),
suffixInflection('います', 'う', ['v5m'], ['v5d']),
suffixInflection('きます', 'く', ['v5m'], ['v5d']),
suffixInflection('ぎます', 'ぐ', ['v5m'], ['v5d']),
suffixInflection('します', 'す', ['v5m'], ['v5d']),
suffixInflection('ちます', 'つ', ['v5m'], ['v5d']),
suffixInflection('にます', 'ぬ', ['v5m'], ['v5d']),
suffixInflection('びます', 'ぶ', ['v5m'], ['v5d']),
suffixInflection('みます', 'む', ['v5m'], ['v5d']),
suffixInflection('ります', 'る', ['v5m'], ['v5d']),
suffixInflection('います', 'う', ['v5m'], ['v5d', 'v5s']),
suffixInflection('きます', 'く', ['v5m'], ['v5d', 'v5s']),
suffixInflection('ぎます', 'ぐ', ['v5m'], ['v5d', 'v5s']),
suffixInflection('します', 'す', ['v5m'], ['v5d', 'v5s']),
suffixInflection('ちます', 'つ', ['v5m'], ['v5d', 'v5s']),
suffixInflection('にます', 'ぬ', ['v5m'], ['v5d', 'v5s']),
suffixInflection('びます', 'ぶ', ['v5m'], ['v5d', 'v5s']),
suffixInflection('みます', 'む', ['v5m'], ['v5d', 'v5s']),
suffixInflection('ります', 'る', ['v5m'], ['v5d', 'v5s']),
suffixInflection('じます', 'ずる', ['vz'], ['vz']),
suffixInflection('します', 'する', ['vs'], ['vs']),
suffixInflection('為ます', '為る', ['vs'], ['vs']),
Expand Down
6 changes: 6 additions & 0 deletions ext/js/language/language-descriptors.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ const languageDescriptors = [
removeAlphabeticDiacritics,
},
},
{
iso: 'hi',
iso639_3: 'hin',
name: 'Hindi',
exampleText: 'पढ़ने के लिए',
},
{
iso: 'hu',
iso639_3: 'hun',
Expand Down
6 changes: 3 additions & 3 deletions ext/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -3225,15 +3225,15 @@ <h5>or click here to upload</h5>
<td>List of definitions for the term, except the dictionary tag is omitted.</td>
</tr>
<tr>
<td><code class="anki-field-marker">{glossary}</code></td>
<td><code class="anki-field-marker">{glossary-first}</code></td>
<td>First definition for the term.</td>
</tr>
<tr>
<td><code class="anki-field-marker">{glossary-brief}</code></td>
<td><code class="anki-field-marker">{glossary-first-brief}</code></td>
<td>First definition for the term in a more compact format.</td>
</tr>
<tr>
<td><code class="anki-field-marker">{glossary-no-dictionary}</code></td>
<td><code class="anki-field-marker">{glossary-first-no-dictionary}</code></td>
<td>First definition for the term, except the dictionary tag is omitted.</td>
</tr>
<tr>
Expand Down
Loading

0 comments on commit 641648b

Please sign in to comment.