-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #660 from alpheios-project/i622-infl-browser-pronoun
Fix for inflection browser - Greek demonstrative and interrogative pronoun tables
- Loading branch information
Showing
5 changed files
with
106 additions
and
6 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
packages/inflection-tables/tests/inflection-browser/inflection-browser.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/* eslint-env jest */ | ||
/* eslint-disable no-unused-vars */ | ||
|
||
import { shallowMount, mount, createLocalVue } from '@vue/test-utils' | ||
|
||
import { Constants } from 'alpheios-data-models' | ||
|
||
import ViewSetFactory from '@views/lib/view-set-factory.js' | ||
import GreekViewSet from '@views/lang/greek/greek-view-set.js' | ||
|
||
import GreekLanguageDataset from '@lib/lang/greek/greek-language-dataset' | ||
|
||
|
||
describe('inflection-browser.test.js', () => { | ||
|
||
console.error = function () {} | ||
console.log = function () {} | ||
console.warn = function () {} | ||
|
||
beforeEach(() => { | ||
jest.spyOn(console, 'error') | ||
jest.spyOn(console, 'log') | ||
jest.spyOn(console, 'warn') | ||
}) | ||
|
||
function timeout (ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)) | ||
} | ||
|
||
it.skip('1 InflectionsBrowser - render a view', () => { | ||
/* | ||
const standardFormData = { | ||
form: 'ἀλλήλᾱ', | ||
langID: Constants.LANG_GREEK, | ||
title: 'Reciprocal Pronoun Declension', | ||
viewID: 'greek_gender_pronoun_view' | ||
} | ||
*/ | ||
|
||
const standardFormData = { | ||
form: 'τούτω', | ||
langID: Constants.LANG_GREEK, | ||
title: 'Demonstrative Pronoun Declension', | ||
viewID: 'greek_lemma_gender_pronoun_view' | ||
} | ||
|
||
// const view = ViewSetFactory.getStandardForm(standardFormData) | ||
|
||
const options = standardFormData | ||
|
||
// view.getStandardFormInstance | ||
|
||
const view = GreekViewSet.getViewByID(options.viewID) | ||
console.info('view - ', view) | ||
const homonym = view.createStandardFormHomonym(options) | ||
|
||
console.info('homonym - ', homonym.lexemes[0].inflections.map(infl => infl.constraints)) | ||
|
||
const inflections = view.getRelatedInflections(homonym.inflections) | ||
|
||
console.info('inflections - ', inflections.map(infl => infl.constraints)) | ||
|
||
const suffixBased = inflections.some(i => i.constraints.suffixBased) | ||
const formBased = inflections.some(i => i.constraints.fullFormBased) | ||
|
||
console.info('suffixBased - ', suffixBased) | ||
console.info('formBased - ', formBased) | ||
// const inflectionData = view.getInflectionsData(homonym, { findMatches: false }) | ||
|
||
const inflSet = view.dataset.createInflectionSet(view.mainPartOfSpeech, inflections, options) | ||
|
||
console.info(inflSet.types) | ||
// GreekLanguageDataset.createInflectionSet | ||
// createInflectionSet (pofsValue, inflections, options) { | ||
|
||
// console.info(inflectionData) | ||
}) | ||
|
||
it.skip('1 InflectionsBrowser - render a view', () => { | ||
const options1 = { | ||
form: 'ἀλλήλᾱ', | ||
langID: Constants.LANG_GREEK, | ||
title: 'Reciprocal Pronoun Declension', | ||
viewID: 'greek_gender_pronoun_view' | ||
} | ||
|
||
const options = { | ||
form: 'οὗτος', | ||
langID: Constants.LANG_GREEK, | ||
title: 'Demonstrative Pronoun Declension', | ||
viewID: 'greek_lemma_gender_pronoun_view' | ||
} | ||
|
||
const view = GreekViewSet.getViewByID(options.viewID) | ||
const homonym = view.createStandardFormHomonym(options) | ||
|
||
console.info('homonym - ', homonym.lexemes[0].inflections.map(infl => infl.constraints)) | ||
|
||
}) | ||
}) |