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"/>
|
||||
<T>home.generator.alt</T>
|
||||
</p>
|
||||
<!-- TODO #136
|
||||
<p class="small" v-if="config.pronunciation.enabled">
|
||||
<Icon v="info-circle"/>
|
||||
<T>home.generator.pronunciation</T>
|
||||
</p>
|
||||
-->
|
||||
</div>
|
||||
<div class="card-footer" v-if="link">
|
||||
<LinkInput :link="link"/>
|
||||
@ -258,7 +260,10 @@
|
||||
const base = this.pronouns[this.selectedPronoun.morphemes[MORPHEMES[0]]];
|
||||
|
||||
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();
|
||||
},
|
||||
link() {
|
||||
|
@ -390,11 +390,12 @@ export class Pronoun {
|
||||
|
||||
toArray() {
|
||||
const elements = Object.values(this.morphemes).map(s => escape(s));
|
||||
Object.values(this.pronunciations).forEach((p, i) => {
|
||||
if (p) {
|
||||
elements[i] += '|' + escape(p);
|
||||
}
|
||||
});
|
||||
// TODO #136
|
||||
// Object.values(this.pronunciations).forEach((p, i) => {
|
||||
// if (p) {
|
||||
// elements[i] += '|' + escape(p);
|
||||
// }
|
||||
// });
|
||||
if (config.pronouns.plurals) {
|
||||
elements.push(this.plural.map(p => p ? 1 : 0).join(''));
|
||||
if (config.pronouns.honorifics) {
|
||||
|
@ -5,6 +5,8 @@ export default class Compressor {
|
||||
const baseFirst = base[0];
|
||||
const baseRest = base.slice(1);
|
||||
|
||||
console.log(data, base);
|
||||
|
||||
if (dataFirst !== baseFirst || dataRest.length !== baseRest.length) {
|
||||
throw 'Cannot compress data, format does not match the base';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user