Skip to content

Commit

Permalink
Merge pull request #660 from alpheios-project/i622-infl-browser-pronoun
Browse files Browse the repository at this point in the history
Fix for inflection browser - Greek demonstrative and interrogative pronoun tables
  • Loading branch information
irina060981 authored Nov 16, 2021
2 parents 91d8f6f + d5ffe4d commit b009ed5
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/components/dist/alpheios-components.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/components/dist/alpheios-components.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/components/dist/alpheios-components.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
},
{
"viewID": "greek_lemma_gender_pronoun_view",
"form": "τούτω", "title": "Demonstrative Pronoun Declension"
"form": "οὗτος", "title": "Demonstrative Pronoun Declension"
},
{
"viewID": "greek_gender_pronoun_view",
Expand All @@ -315,7 +315,7 @@
},
{
"viewID": "greek_gender_pronoun_interr_view",
"form": "τίνε", "title": "Interrogative Pronoun Declension"
"form": "τίς", "title": "Interrogative Pronoun Declension"
},
{
"viewID": "greek_gender_pronoun_view",
Expand Down
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))

})
})

0 comments on commit b009ed5

Please sign in to comment.