[pl][nouns] abbreviations
This commit is contained in:
parent
8eb89b623d
commit
771e545e29
|
@ -0,0 +1,40 @@
|
|||
<template>
|
||||
<span>
|
||||
<abbr v-if="abbr" :title="meaning">{{abbr}}</abbr><template v-if="abbr"> </template><slot v-bind:abbr="abbr" v-bind:meaning="meaning" v-bind:word="word"></slot>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { abbreviations } from '../src/data';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
v: {required: true},
|
||||
},
|
||||
data() {
|
||||
for (let abbr in abbreviations) {
|
||||
if (!abbreviations.hasOwnProperty(abbr)) { continue; }
|
||||
if (this.v.startsWith(abbr + ' ')) {
|
||||
return {
|
||||
abbr,
|
||||
meaning: abbreviations[abbr],
|
||||
word: this.v.substring(abbr.length + 1),
|
||||
};
|
||||
}
|
||||
}
|
||||
return {
|
||||
abbr: null,
|
||||
meaning: null,
|
||||
word: this.v,
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "assets/variables";
|
||||
|
||||
abbr {
|
||||
text-decoration-color: $text-muted;
|
||||
}
|
||||
</style>
|
|
@ -2,14 +2,18 @@
|
|||
<div>
|
||||
<ul class="list-singular">
|
||||
<li v-for="w in noun[gender]">
|
||||
<Declension v-if="gender === 'neutr' && config.nouns.declension" :word="w" tooltip/>
|
||||
<Spelling v-else :text="w"/>
|
||||
<Abbreviation :v="w" v-slot="{word}">
|
||||
<Declension v-if="gender === 'neutr' && config.nouns.declension" :word="word" tooltip/>
|
||||
<Spelling v-else :text="word"/>
|
||||
</Abbreviation>
|
||||
</li>
|
||||
</ul>
|
||||
<ul v-if="config.nouns.plurals" class="list-plural">
|
||||
<li v-for="w in noun[gender + 'Pl']">
|
||||
<Declension v-if="gender === 'neutr' && config.nouns.declension" :word="w" plural :singularOptions="noun.neutr" tooltip/>
|
||||
<Spelling v-else :text="w"/>
|
||||
<Abbreviation :v="w" v-slot="{word}">
|
||||
<Declension v-if="gender === 'neutr' && config.nouns.declension" :word="word" plural :singularOptions="noun.neutr" tooltip/>
|
||||
<Spelling v-else :text="word"/>
|
||||
</Abbreviation>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -115,6 +115,11 @@
|
|||
</template>
|
||||
</button>
|
||||
<p class="small text-muted mt-1"><T>nouns.submit.moderation</T></p>
|
||||
<ul v-if="Object.keys(abbreviations).length > 0" class="small text-muted">
|
||||
<li v-for="(meaning, abbr) in abbreviations">
|
||||
{{abbr}} – {{meaning}}
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</section>
|
||||
<section v-else class="text-center">
|
||||
|
@ -125,7 +130,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { nounTemplates } from '../src/data';
|
||||
import { nounTemplates, abbreviations } from '../src/data';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
@ -145,6 +150,7 @@
|
|||
templates: nounTemplates,
|
||||
templateBase: '',
|
||||
templateVisible: false,
|
||||
abbreviations,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -0,0 +1,7 @@
|
|||
abbreviation meaning
|
||||
zbior. formy zbiorowe
|
||||
met. metonimia
|
||||
duk. dukaizm/dukatyw
|
||||
zdrob. zdrobniałe
|
||||
mn. mnogie (w liczbie pojedynczej)
|
||||
skr. skrót
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -0,0 +1 @@
|
|||
abbreviation meaning
|
|
|
@ -62,3 +62,10 @@ export const nounDeclensionTemplates = buildList(function* () {
|
|||
yield new NounDeclension(d);
|
||||
}
|
||||
});
|
||||
|
||||
import abbreviationsRaw from '../data/nouns/abbr.tsv';
|
||||
export const abbreviations = buildDict(function* () {
|
||||
for (let a of abbreviationsRaw) {
|
||||
yield [a.abbreviation, a.meaning];
|
||||
}
|
||||
});
|
||||
|
|
Reference in New Issue