mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-24 05:05:20 -04:00
#137 generator broken for pronouns with pronunciation
This commit is contained in:
parent
5442b5c885
commit
32041d4768
@ -171,10 +171,12 @@
|
|||||||
<Icon v="info-circle"/>
|
<Icon v="info-circle"/>
|
||||||
<T>home.generator.alt</T>
|
<T>home.generator.alt</T>
|
||||||
</p>
|
</p>
|
||||||
|
<!-- TODO #136
|
||||||
<p class="small" v-if="config.pronunciation.enabled">
|
<p class="small" v-if="config.pronunciation.enabled">
|
||||||
<Icon v="info-circle"/>
|
<Icon v="info-circle"/>
|
||||||
<T>home.generator.pronunciation</T>
|
<T>home.generator.pronunciation</T>
|
||||||
</p>
|
</p>
|
||||||
|
-->
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer" v-if="link">
|
<div class="card-footer" v-if="link">
|
||||||
<LinkInput :link="link"/>
|
<LinkInput :link="link"/>
|
||||||
@ -258,7 +260,10 @@
|
|||||||
const base = this.pronouns[this.selectedPronoun.morphemes[MORPHEMES[0]]];
|
const base = this.pronouns[this.selectedPronoun.morphemes[MORPHEMES[0]]];
|
||||||
|
|
||||||
return base
|
return base
|
||||||
? Compressor.compress(this.selectedPronoun.toArray(), base.toArray()).join(',')
|
? Compressor.compress(
|
||||||
|
this.selectedPronoun.toArray().map(x => x.split('|')[0]),
|
||||||
|
base.toArray().map(x => x.split('|')[0])
|
||||||
|
).join(',')
|
||||||
: this.selectedPronoun.toString();
|
: this.selectedPronoun.toString();
|
||||||
},
|
},
|
||||||
link() {
|
link() {
|
||||||
|
@ -390,11 +390,12 @@ export class Pronoun {
|
|||||||
|
|
||||||
toArray() {
|
toArray() {
|
||||||
const elements = Object.values(this.morphemes).map(s => escape(s));
|
const elements = Object.values(this.morphemes).map(s => escape(s));
|
||||||
Object.values(this.pronunciations).forEach((p, i) => {
|
// TODO #136
|
||||||
if (p) {
|
// Object.values(this.pronunciations).forEach((p, i) => {
|
||||||
elements[i] += '|' + escape(p);
|
// if (p) {
|
||||||
}
|
// elements[i] += '|' + escape(p);
|
||||||
});
|
// }
|
||||||
|
// });
|
||||||
if (config.pronouns.plurals) {
|
if (config.pronouns.plurals) {
|
||||||
elements.push(this.plural.map(p => p ? 1 : 0).join(''));
|
elements.push(this.plural.map(p => p ? 1 : 0).join(''));
|
||||||
if (config.pronouns.honorifics) {
|
if (config.pronouns.honorifics) {
|
||||||
|
@ -5,6 +5,8 @@ export default class Compressor {
|
|||||||
const baseFirst = base[0];
|
const baseFirst = base[0];
|
||||||
const baseRest = base.slice(1);
|
const baseRest = base.slice(1);
|
||||||
|
|
||||||
|
console.log(data, base);
|
||||||
|
|
||||||
if (dataFirst !== baseFirst || dataRest.length !== baseRest.length) {
|
if (dataFirst !== baseFirst || dataRest.length !== baseRest.length) {
|
||||||
throw 'Cannot compress data, format does not match the base';
|
throw 'Cannot compress data, format does not match the base';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user