Skip to content

Commit

Permalink
Merge branch 'incr-3.3.x' into qa
Browse files Browse the repository at this point in the history
  • Loading branch information
Bridget Almas committed Jan 19, 2021
2 parents 160626a + 2e40919 commit 5cb91a2
Show file tree
Hide file tree
Showing 13 changed files with 10,712 additions and 5,106 deletions.
15,747 changes: 10,655 additions & 5,092 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
@@ -1,6 +1,6 @@
/* @license
Papa Parse
v5.3.0
v5.2.0
https://github.com/mholt/PapaParse
License: MIT
*/
Expand All @@ -13,11 +13,9 @@ License: MIT
*/

/*!
* vuex v3.6.0
* vuex v3.5.1
* (c) 2020 Evan You
* @license MIT
*/

/*! For license information please see alpheios-res-client.min.js.LICENSE.txt */

/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
2 changes: 1 addition & 1 deletion packages/components/dist/style/style-components.min.css

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion packages/data-models/dist/alpheios-data-models.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion packages/data-models/dist/alpheios-data-models.node.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/data-models/dist/alpheios-data-models.node.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/data-models/dist/alpheios-data-models.node.min.js

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion packages/data-models/src/lemma.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,24 @@ class Lemma {
return false
}

const lm = LMF.getLanguageModel(this.languageID)
// Check if words are the same
const areSameWords = normalize
? LMF.getLanguageModel(this.languageID).compareWords(this.word, lemma.word, true,
? lm.compareWords(this.word, lemma.word, true,
{ normalizeTrailingDigit: true })
: this.word === lemma.word

// if they have differing trailing digits, they cannot be the same
const thisHasTrailingDigit = lm.hasTrailingDigit(this.word)
const otherHasTrailingDigit = lm.hasTrailingDigit(lemma.word)
if (thisHasTrailingDigit && otherHasTrailingDigit) {
const thisTrailingDigit = this.word.match(/\d+$/)[0]
const otherTrailingDigit = lemma.word.match(/\d+$/)[0]
if (thisTrailingDigit !== otherTrailingDigit) {
return false
}
}

return areSameWords
}

Expand Down
9 changes: 9 additions & 0 deletions packages/data-models/tests/lemma.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,21 @@ describe('lemma.test.js', () => {
let lemma2 = new Lemma('fooword', Constants.LANG_LATIN)
let lemma3 = new Lemma('fooword', Constants.LANG_LATIN)
let lemma4 = new Lemma('barword', Constants.LANG_LATIN)
let lemma5 = new Lemma('fooword1', Constants.LANG_LATIN)
let lemma6 = new Lemma('fooword1', Constants.LANG_LATIN)
let lemma7 = new Lemma('fooword2', Constants.LANG_LATIN)
lemma1.addFeature(new Feature(Feature.types.part, Constants.POFS_VERB, Constants.LANG_LATIN))
lemma2.addFeature(new Feature(Feature.types.part, Constants.POFS_VERB, Constants.LANG_LATIN))
lemma3.addFeature(new Feature(Feature.types.part, Constants.POFS_NOUN, Constants.LANG_LATIN))
lemma5.addFeature(new Feature(Feature.types.part, Constants.POFS_NOUN, Constants.LANG_LATIN))
lemma6.addFeature(new Feature(Feature.types.part, Constants.POFS_NOUN, Constants.LANG_LATIN))
lemma7.addFeature(new Feature(Feature.types.part, Constants.POFS_NOUN, Constants.LANG_LATIN))
expect(lemma1.isFullHomonym(lemma2)).toBeTruthy()
expect(lemma1.isFullHomonym(lemma3)).toBeFalsy()
expect(lemma1.isFullHomonym(lemma4)).toBeFalsy()
expect(lemma3.isFullHomonym(lemma5, {normalize: true})).toBeTruthy()
expect(lemma5.isFullHomonym(lemma6, {normalize: true})).toBeTruthy()
expect(lemma5.isFullHomonym(lemma7, {normalize: true})).toBeFalsy()
})

it('10 Lemma - displayWord - formats Lemma word and removes digits from the end of the word', () => {
Expand Down

0 comments on commit 5cb91a2

Please sign in to comment.