2021-01-17 11:43:21 -08:00
|
|
|
<template>
|
|
|
|
<div>
|
2021-01-17 12:44:22 -08:00
|
|
|
<NounsNav/>
|
|
|
|
|
2021-01-17 13:05:06 -08:00
|
|
|
<h2>
|
2021-01-17 11:43:21 -08:00
|
|
|
<Icon v="ghost"/>
|
|
|
|
<T>nouns.dukajNouns.header</T>
|
2021-01-17 13:05:06 -08:00
|
|
|
</h2>
|
2021-01-17 11:43:21 -08:00
|
|
|
|
|
|
|
<div class="d-flex flex-column flex-md-row">
|
|
|
|
<div>
|
|
|
|
<T>nouns.dukajNouns.info</T>
|
|
|
|
<p><Share :title="$t('nouns.dukajNouns.header')"/></p>
|
|
|
|
</div>
|
|
|
|
<figure>
|
|
|
|
<img src="/img/dukaizmy.png" :alt="$t('nouns.dukajNouns.flag.alt')"/>
|
|
|
|
<figcaption><T>nouns.dukajNouns.flag.caption</T></figcaption>
|
|
|
|
</figure>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<details open class="border mb-3">
|
|
|
|
<summary class="bg-light p-3">
|
|
|
|
<h4 class="h5 d-inline"><T>nouns.examples</T></h4>
|
|
|
|
</summary>
|
|
|
|
<div class="border-top table-responsive">
|
|
|
|
<table class="table table-striped table-hover table-fixed-3">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="text-nowrap">
|
|
|
|
<Icon v="mars"/>
|
|
|
|
<T>nouns.masculine</T>
|
|
|
|
</th>
|
|
|
|
<th class="text-nowrap">
|
|
|
|
<Icon v="venus"/>
|
|
|
|
<T>nouns.feminine</T>
|
|
|
|
</th>
|
|
|
|
<th class="text-nowrap">
|
|
|
|
<Icon v="neuter"/>
|
|
|
|
<T>nouns.dukajNouns.label</T>
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr v-for="noun in dukajNouns" :key="noun.id">
|
|
|
|
<td>
|
|
|
|
<ul class="list-singular">
|
|
|
|
<li v-for="w in noun.masc">{{ w }}</li>
|
|
|
|
</ul>
|
|
|
|
<ul class="list-plural">
|
|
|
|
<li v-for="w in noun.mascPl">{{ w }}</li>
|
|
|
|
</ul>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<ul class="list-singular">
|
|
|
|
<li v-for="w in noun.fem">{{ w }}</li>
|
|
|
|
</ul>
|
|
|
|
<ul class="list-plural">
|
|
|
|
<li v-for="w in noun.femPl">{{ w }}</li>
|
|
|
|
</ul>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<ul class="list-singular">
|
|
|
|
<li v-for="w in noun.neutr">
|
2021-08-03 10:25:48 -07:00
|
|
|
<Declension :word="w" :template="noun.declension"/>
|
2021-01-17 11:43:21 -08:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<ul class="list-plural">
|
|
|
|
<li v-for="w in noun.neutrPl">
|
2021-08-03 10:25:48 -07:00
|
|
|
<Declension :word="w" plural :singularOptions="noun.neutr" :template="noun.declension"/>
|
2021-01-17 11:43:21 -08:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</details>
|
|
|
|
|
|
|
|
<details open class="border mb-3">
|
|
|
|
<summary class="bg-light p-3">
|
|
|
|
<h4 class="h5 d-inline"><T>nouns.dukajNouns.extended.header</T></h4>
|
|
|
|
</summary>
|
|
|
|
<div class="border-top">
|
|
|
|
<div class="d-flex flex-column flex-md-row">
|
|
|
|
<div class="p-3">
|
|
|
|
<h5>⋅ <T>nouns.singular</T></h5>
|
|
|
|
<Declension word="" :template="dukajExtendedDeclension" open/>
|
|
|
|
</div>
|
|
|
|
<div class="p-3">
|
|
|
|
<h5>⁖ <T>nouns.plural</T></h5>
|
|
|
|
<Declension word="" :template="dukajExtendedDeclension" open plural/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</details>
|
2021-03-24 11:29:25 -07:00
|
|
|
|
2021-08-03 10:25:48 -07:00
|
|
|
<details open class="border mb-3">
|
|
|
|
<summary class="bg-light p-3">
|
|
|
|
<h4 class="h5 d-inline">Generator</h4>
|
|
|
|
</summary>
|
|
|
|
<div class="border-top p-3">
|
|
|
|
<p>
|
|
|
|
Końcówki dukatywów są tak regularne, że zamiast pełnego słownika
|
|
|
|
powinien wystarczyć nawet automatyczny generator.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
Wpisz poniżej dowolny rzeczownik określający osobę,
|
|
|
|
<strong>w rodzaju męskim liczby pojedynczej</strong>:
|
|
|
|
</p>
|
|
|
|
<div class="form-group">
|
|
|
|
<input v-model="generatorWord" class="form-control" placeholder="Wpisz rzeczownik w rodzaju męskim liczby pojedynczej"/>
|
|
|
|
</div>
|
|
|
|
<table v-if="generatorResult" class="table table-fixed-3">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="text-nowrap">
|
|
|
|
<Icon v="mars"/>
|
|
|
|
<T>nouns.masculine</T>
|
|
|
|
</th>
|
|
|
|
<th class="text-nowrap">
|
|
|
|
<Icon v="venus"/>
|
|
|
|
<T>nouns.feminine</T>
|
|
|
|
</th>
|
|
|
|
<th class="text-nowrap">
|
|
|
|
<Icon v="neuter"/>
|
|
|
|
<T>nouns.dukajNouns.label</T>
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<ul class="list-singular">
|
|
|
|
<li v-for="w in generatorResult.masc">{{ w }}</li>
|
|
|
|
</ul>
|
|
|
|
<ul class="list-plural">
|
|
|
|
<li v-for="w in generatorResult.mascPl">{{ w }}</li>
|
|
|
|
</ul>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<ul class="list-singular">
|
|
|
|
<li v-for="w in generatorResult.fem">{{ w }}</li>
|
|
|
|
</ul>
|
|
|
|
<ul class="list-plural">
|
|
|
|
<li v-for="w in generatorResult.femPl">{{ w }}</li>
|
|
|
|
</ul>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<ul class="list-singular">
|
|
|
|
<li v-for="w in generatorResult.neutr">
|
|
|
|
<Declension :word="w" :template="generatorResult.declension"/>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<ul class="list-plural">
|
|
|
|
<li v-for="w in generatorResult.neutrPl">
|
|
|
|
<Declension :word="w" :template="generatorResult.declension" plural/>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<div v-else class="alert alert-warning">
|
|
|
|
<p class="mb-0">Niestety, podane słowo nie pasuje do żadnego naszego szablonu</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</details>
|
|
|
|
|
2021-03-24 11:29:25 -07:00
|
|
|
<section v-if="sources && Object.keys(sources).length">
|
|
|
|
<Literature :sources="sources"/>
|
|
|
|
</section>
|
2021-01-17 11:43:21 -08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-03-24 11:29:25 -07:00
|
|
|
import {Noun, NounDeclension, SourceLibrary} from "../../../src/classes";
|
2021-01-17 11:43:21 -08:00
|
|
|
import {head} from "../../../src/helpers";
|
2021-01-17 12:44:22 -08:00
|
|
|
import NounsNav from "./NounsNav";
|
2021-08-03 10:25:48 -07:00
|
|
|
import templates from './dukatywy.tsv';
|
|
|
|
|
|
|
|
const dukajDeclension = new NounDeclension({
|
|
|
|
M: 'u', D: 'u', C: 'u', B: 'u', N: 'um', Msc: 'um', W: 'u',
|
|
|
|
M_pl: 'y', D_pl: 'ych', C_pl: 'ym', B_pl: 'ych', N_pl: 'ymi', Msc_pl: 'ych', W_pl: 'y',
|
|
|
|
});
|
|
|
|
const dukajAdjectiveDeclension = new NounDeclension({
|
|
|
|
M: 'u', D: 'enu', C: 'ewu', B: 'enu', N: 'um', Msc: 'um', W: 'u',
|
|
|
|
M_pl: 'y', D_pl: 'ych', C_pl: 'ym', B_pl: 'ych', N_pl: 'ymi', Msc_pl: 'ych', W_pl: 'y',
|
|
|
|
});
|
2021-08-03 11:02:59 -07:00
|
|
|
const dukajIDeclension = new NounDeclension({
|
|
|
|
M: 'u', D: 'u', C: 'u', B: 'u', N: 'um', Msc: 'um', W: 'u',
|
|
|
|
M_pl: 'i', D_pl: 'ich', C_pl: 'im', B_pl: 'ich', N_pl: 'imi', Msc_pl: 'ich', W_pl: 'i',
|
|
|
|
});
|
2021-01-17 11:43:21 -08:00
|
|
|
|
|
|
|
export default {
|
2021-01-17 12:44:22 -08:00
|
|
|
components: { NounsNav },
|
2021-01-17 11:43:21 -08:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
dukajNouns: [
|
|
|
|
new Noun({
|
|
|
|
id: 'astronauta',
|
|
|
|
masc: 'astronauta', fem: 'astronautka', neutr: 'astronautu',
|
|
|
|
mascPl: 'astronauci', femPl: 'astronautki', neutrPl: 'astronauty',
|
2021-08-03 10:25:48 -07:00
|
|
|
declension: dukajDeclension,
|
2021-01-17 11:43:21 -08:00
|
|
|
}),
|
|
|
|
new Noun({
|
|
|
|
id: 'Europejczyk',
|
2021-04-19 23:19:06 -07:00
|
|
|
masc: 'Europejczyk', fem: 'Europejka', neutr: 'Europejku',
|
|
|
|
mascPl: 'Europejczycy', femPl: 'Europejki', neutrPl: 'Europejki',
|
2021-08-03 10:25:48 -07:00
|
|
|
declension: dukajDeclension,
|
2021-01-17 11:43:21 -08:00
|
|
|
}),
|
|
|
|
new Noun({
|
|
|
|
id: 'przyjaciel',
|
2021-04-19 23:19:06 -07:00
|
|
|
masc: 'przyjaciel', fem: 'przyjaciółka', neutr: 'przyjaciołu',
|
|
|
|
mascPl: 'przyjaciele', femPl: 'przyjaciółki', neutrPl: 'przyjacioły',
|
2021-08-03 10:25:48 -07:00
|
|
|
declension: dukajDeclension,
|
2021-01-17 11:43:21 -08:00
|
|
|
}),
|
|
|
|
new Noun({
|
|
|
|
id: 'twórca',
|
|
|
|
masc: 'twórca', fem: 'twórczyni', neutr: 'twórcu',
|
|
|
|
mascPl: 'twórcy', femPl: 'twórczynie', neutrPl: 'twórcy',
|
2021-08-03 10:25:48 -07:00
|
|
|
declension: dukajDeclension,
|
|
|
|
}),
|
|
|
|
new Noun({
|
|
|
|
id: 'radny',
|
|
|
|
masc: 'radny', fem: 'radna', neutr: 'radnu',
|
|
|
|
mascPl: 'radni', femPl: 'radne', neutrPl: 'radny',
|
|
|
|
declension: dukajAdjectiveDeclension,
|
2021-01-17 11:43:21 -08:00
|
|
|
}),
|
|
|
|
],
|
2021-08-03 10:25:48 -07:00
|
|
|
dukajDeclension,
|
|
|
|
dukajAdjectiveDeclension,
|
2021-01-17 11:43:21 -08:00
|
|
|
dukajExtendedDeclension: new NounDeclension({
|
|
|
|
M: 'tenu kosmicznu twórcu',
|
|
|
|
D: 'tenu kosmicznenu twórcu',
|
|
|
|
C: 'tewu kosmicznewu twórcu',
|
|
|
|
B: 'tenu kosmicznenu twórcu',
|
|
|
|
N: 'tum kosmicznum twórcum',
|
|
|
|
Msc: 'tum kosmicznum twórcum',
|
2021-05-02 09:34:48 -07:00
|
|
|
W: 'ty kosmicznu twórcu',
|
2021-01-17 11:43:21 -08:00
|
|
|
|
|
|
|
M_pl: 'teny kosmiczny twórcy',
|
2021-05-02 09:34:48 -07:00
|
|
|
D_pl: 'tych kosmicznych twórcych',
|
|
|
|
C_pl: 'tym kosmicznym twórcym',
|
|
|
|
B_pl: 'tych kosmicznych twórcych',
|
|
|
|
N_pl: 'tymi kosmicznymi twórcymi',
|
|
|
|
Msc_pl: 'tych kosmicznych twórcych',
|
|
|
|
W_pl: 'wy kosmiczny twórcy',
|
2021-01-17 11:43:21 -08:00
|
|
|
}),
|
2021-03-24 11:29:25 -07:00
|
|
|
sources: undefined,
|
2021-08-03 10:25:48 -07:00
|
|
|
templates,
|
2021-08-03 11:02:59 -07:00
|
|
|
generatorWord: 'ktoś',
|
2021-01-17 11:43:21 -08:00
|
|
|
}
|
|
|
|
},
|
2021-03-24 11:29:25 -07:00
|
|
|
async mounted() {
|
|
|
|
this.sources = {
|
|
|
|
'': new SourceLibrary(await this.$axios.$get(`/sources?pronoun=dukatywy`)).getForPronoun('dukatywy'),
|
|
|
|
};
|
|
|
|
},
|
2021-08-03 10:25:48 -07:00
|
|
|
computed: {
|
|
|
|
template() {
|
|
|
|
let longestMatch = 0;
|
|
|
|
let matchingTemplates = [];
|
|
|
|
for (let t of templates) {
|
|
|
|
if (!this.generatorWord.endsWith(t.masc)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (t.masc.length > longestMatch) {
|
|
|
|
longestMatch = t.masc.length;
|
|
|
|
matchingTemplates = [t];
|
|
|
|
} else if (t.masc.length === longestMatch) {
|
|
|
|
matchingTemplates.push(t);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!matchingTemplates.length) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return matchingTemplates[0];
|
|
|
|
},
|
|
|
|
generatorResult() {
|
|
|
|
if (!this.template) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
const root = this.generatorWord.substring(0, this.generatorWord.length - this.template.masc.length);
|
|
|
|
|
|
|
|
const result = {id: null};
|
|
|
|
for (let k in this.template) {
|
|
|
|
if (!this.template.hasOwnProperty(k)) { continue; }
|
|
|
|
result[k] = this.template[k].split('/').map(ending => root + ending).join(' / ');
|
|
|
|
}
|
|
|
|
|
|
|
|
result.declension = this.generatorWord.endsWith('y') || this.generatorWord.endsWith('i')
|
|
|
|
? dukajAdjectiveDeclension
|
|
|
|
: dukajDeclension;
|
|
|
|
|
2021-08-03 11:02:59 -07:00
|
|
|
if (this.template.neutrPl.endsWith('i')) {
|
|
|
|
result.declension = dukajIDeclension;
|
|
|
|
}
|
|
|
|
|
2021-08-03 10:25:48 -07:00
|
|
|
return new Noun(result);
|
|
|
|
}
|
|
|
|
},
|
2021-01-17 11:43:21 -08:00
|
|
|
head() {
|
|
|
|
return head({
|
|
|
|
title: this.$t('nouns.dukajNouns.header'),
|
|
|
|
description: this.$t('nouns.dukajNouns.info')[0],
|
|
|
|
});
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import "assets/variables";
|
|
|
|
|
|
|
|
figure {
|
|
|
|
width: 100%;
|
|
|
|
max-width: 24rem;
|
|
|
|
padding: $spacer;
|
|
|
|
img {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
figcaption {
|
|
|
|
font-size: $small-font-size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|