mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-21 17:12:50 -06:00
the Android App now show the valency patterns for verbs in English, Bulgarian and Swedish
This commit is contained in:
@@ -160,15 +160,23 @@
|
|||||||
<cat>V2</cat>
|
<cat>V2</cat>
|
||||||
<cat>V3</cat>
|
<cat>V3</cat>
|
||||||
<cat>V2V</cat>
|
<cat>V2V</cat>
|
||||||
|
<cat>V2S</cat>
|
||||||
|
<cat>V2Q</cat>
|
||||||
|
<cat>V2A</cat>
|
||||||
<cat>VV</cat>
|
<cat>VV</cat>
|
||||||
<cat>VS</cat>
|
<cat>VS</cat>
|
||||||
|
<cat>VQ</cat>
|
||||||
|
<cat>VA</cat>
|
||||||
<tag>гл</tag>
|
<tag>гл</tag>
|
||||||
<template>
|
<template>
|
||||||
<h1>Глагол от несвършен вид</h1>
|
<h1>Глагол</h1>
|
||||||
|
<lin>Feat<cat/> (<lemma/>)</lin>
|
||||||
|
|
||||||
<h2>Изявително наклонение</h2>
|
<h2>Несвършен вид</h2>
|
||||||
|
|
||||||
<h3>Сегашно време</h3>
|
<h3>Изявително наклонение</h3>
|
||||||
|
|
||||||
|
<h4>Сегашно време</h4>
|
||||||
<table class="forms-table" rules="all">
|
<table class="forms-table" rules="all">
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
@@ -192,7 +200,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3>Минало свършено време (аорист)</h3>
|
<h4>Минало свършено време (аорист)</h4>
|
||||||
<table class="forms-table" rules="all">
|
<table class="forms-table" rules="all">
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
@@ -216,7 +224,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3>Минало несвършено време (имперфект)</h3>
|
<h4>Минало несвършено време (имперфект)</h4>
|
||||||
<table class="forms-table" rules="all">
|
<table class="forms-table" rules="all">
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
@@ -240,7 +248,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h2>Повелително наклонение</h2>
|
<h3>Повелително наклонение</h3>
|
||||||
<table class="forms-table" rules="all">
|
<table class="forms-table" rules="all">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ед.ч.</th>
|
<th>ед.ч.</th>
|
||||||
@@ -252,9 +260,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h2>Причастия (отглаголни прилагателни)</h2>
|
<h3>Причастия (отглаголни прилагателни)</h3>
|
||||||
|
|
||||||
<h3>Минало страдателно причастие</h3>
|
<h4>Минало страдателно причастие</h4>
|
||||||
<table class="forms-table" rules="all">
|
<table class="forms-table" rules="all">
|
||||||
<tr>
|
<tr>
|
||||||
<th rowspan="7">ед.ч.</th>
|
<th rowspan="7">ед.ч.</th>
|
||||||
@@ -299,7 +307,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3>Минало свършено деятелно причастие</h3>
|
<h4>Минало свършено деятелно причастие</h4>
|
||||||
<table class="forms-table" rules="all">
|
<table class="forms-table" rules="all">
|
||||||
<tr>
|
<tr>
|
||||||
<th rowspan="7">ед.ч.</th>
|
<th rowspan="7">ед.ч.</th>
|
||||||
@@ -344,7 +352,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3>Минало несвършено деятелно причастие</h3>
|
<h4>Минало несвършено деятелно причастие</h4>
|
||||||
<table class="forms-table" rules="all">
|
<table class="forms-table" rules="all">
|
||||||
<tr>
|
<tr>
|
||||||
<th rowspan="7">ед.ч.</th>
|
<th rowspan="7">ед.ч.</th>
|
||||||
@@ -389,7 +397,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3>Сегашно деятелно причастие</h3>
|
<h4>Сегашно деятелно причастие</h4>
|
||||||
<table class="forms-table" rules="all">
|
<table class="forms-table" rules="all">
|
||||||
<tr>
|
<tr>
|
||||||
<th rowspan="7">ед.ч.</th>
|
<th rowspan="7">ед.ч.</th>
|
||||||
@@ -434,13 +442,10 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h2>Деепричастие (отглаголно наречие)</h2>
|
<h2>Свършен вид</h2>
|
||||||
<p><form>s Imperf VGerund</form></p>
|
<h3>Изявително наклонение</h3>
|
||||||
|
|
||||||
<h1>Глагол от свършен вид</h1>
|
<h4>Сегашно време</h4>
|
||||||
<h2>Изявително наклонение</h2>
|
|
||||||
|
|
||||||
<h3>Сегашно време</h3>
|
|
||||||
<table class="forms-table" rules="all">
|
<table class="forms-table" rules="all">
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
@@ -464,7 +469,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3>Минало свършено време (аорист)</h3>
|
<h4>Минало свършено време (аорист)</h4>
|
||||||
<table class="forms-table" rules="all">
|
<table class="forms-table" rules="all">
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
@@ -488,7 +493,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3>Минало несвършено време (имперфект)</h3>
|
<h4>Минало несвършено време (имперфект)</h4>
|
||||||
<table class="forms-table" rules="all">
|
<table class="forms-table" rules="all">
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
@@ -512,7 +517,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h2>Повелително наклонение</h2>
|
<h3>Повелително наклонение</h3>
|
||||||
<table class="forms-table" rules="all">
|
<table class="forms-table" rules="all">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ед.ч.</th>
|
<th>ед.ч.</th>
|
||||||
@@ -524,9 +529,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h2>Причастия (отглаголни прилагателни)</h2>
|
<h3>Причастия (отглаголни прилагателни)</h3>
|
||||||
|
|
||||||
<h3>Минало свършено деятелно причастие</h3>
|
<h4>Минало свършено деятелно причастие</h4>
|
||||||
<table class="forms-table" rules="all">
|
<table class="forms-table" rules="all">
|
||||||
<tr>
|
<tr>
|
||||||
<th rowspan="7">ед.ч.</th>
|
<th rowspan="7">ед.ч.</th>
|
||||||
@@ -571,7 +576,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3>Минало несвършено деятелно причастие</h3>
|
<h4>Минало несвършено деятелно причастие</h4>
|
||||||
<table class="forms-table" rules="all">
|
<table class="forms-table" rules="all">
|
||||||
<tr>
|
<tr>
|
||||||
<th rowspan="7">ед.ч.</th>
|
<th rowspan="7">ед.ч.</th>
|
||||||
@@ -637,6 +642,9 @@
|
|||||||
<td><form>s Imperf (VNoun (NF Pl Def))</form></td>
|
<td><form>s Imperf (VNoun (NF Pl Def))</form></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<h1>Деепричастие (отглаголно наречие)</h1>
|
||||||
|
<p><form>s Imperf VGerund</form></p>
|
||||||
</template>
|
</template>
|
||||||
</inflection>
|
</inflection>
|
||||||
</inflection_template>
|
</inflection_template>
|
||||||
|
|||||||
@@ -54,8 +54,13 @@
|
|||||||
<cat>V2</cat>
|
<cat>V2</cat>
|
||||||
<cat>V3</cat>
|
<cat>V3</cat>
|
||||||
<cat>V2V</cat>
|
<cat>V2V</cat>
|
||||||
|
<cat>V2S</cat>
|
||||||
|
<cat>V2Q</cat>
|
||||||
|
<cat>V2A</cat>
|
||||||
<cat>VV</cat>
|
<cat>VV</cat>
|
||||||
<cat>VS</cat>
|
<cat>VS</cat>
|
||||||
|
<cat>VQ</cat>
|
||||||
|
<cat>VA</cat>
|
||||||
<tag>v</tag>
|
<tag>v</tag>
|
||||||
<template>
|
<template>
|
||||||
<h1>Verb</h1>
|
<h1>Verb</h1>
|
||||||
|
|||||||
@@ -79,11 +79,16 @@
|
|||||||
<cat>V2</cat>
|
<cat>V2</cat>
|
||||||
<cat>V3</cat>
|
<cat>V3</cat>
|
||||||
<cat>V2V</cat>
|
<cat>V2V</cat>
|
||||||
<cat>VV</cat>
|
<cat>V2S</cat>
|
||||||
|
<cat>V2Q</cat>
|
||||||
|
<cat>V2A</cat>
|
||||||
<cat>VS</cat>
|
<cat>VS</cat>
|
||||||
|
<cat>VQ</cat>
|
||||||
|
<cat>VA</cat>
|
||||||
<tag>v</tag>
|
<tag>v</tag>
|
||||||
<template>
|
<template>
|
||||||
<h1>Verb</h1>
|
<h1>Verb</h1>
|
||||||
|
<p><lin>Feat<cat/> (<lemma/>)</lin></p>
|
||||||
<table class="forms-table" rules="all">
|
<table class="forms-table" rules="all">
|
||||||
<tr>
|
<tr>
|
||||||
<th>infitive</th>
|
<th>infitive</th>
|
||||||
@@ -108,4 +113,34 @@
|
|||||||
</table>
|
</table>
|
||||||
</template>
|
</template>
|
||||||
</inflection>
|
</inflection>
|
||||||
|
<inflection>
|
||||||
|
<cat>VV</cat>
|
||||||
|
<tag>v</tag>
|
||||||
|
<template>
|
||||||
|
<h1>Verb</h1>
|
||||||
|
<p><lin>Feat<cat/> (<lemma/>)</lin></p>
|
||||||
|
<table class="forms-table" rules="all">
|
||||||
|
<tr>
|
||||||
|
<th>infitive</th>
|
||||||
|
<td><form>s (VVF VInf)</form></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>present</th>
|
||||||
|
<td><form>s (VVF VPres)</form> <form>s VVPresNeg</form></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>past</th>
|
||||||
|
<td><form>s (VVF VPast)</form> <form>s VVPastNeg</form></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>past part.</th>
|
||||||
|
<td><form>s (VVF VPPart)</form></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>present part.</th>
|
||||||
|
<td><form>s (VVF VPresPart)</form></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</template>
|
||||||
|
</inflection>
|
||||||
</inflection_template>
|
</inflection_template>
|
||||||
|
|||||||
@@ -132,11 +132,17 @@
|
|||||||
<cat>V2</cat>
|
<cat>V2</cat>
|
||||||
<cat>V3</cat>
|
<cat>V3</cat>
|
||||||
<cat>V2V</cat>
|
<cat>V2V</cat>
|
||||||
|
<cat>V2S</cat>
|
||||||
|
<cat>V2Q</cat>
|
||||||
|
<cat>V2A</cat>
|
||||||
<cat>VV</cat>
|
<cat>VV</cat>
|
||||||
<cat>VS</cat>
|
<cat>VS</cat>
|
||||||
|
<cat>VQ</cat>
|
||||||
|
<cat>VA</cat>
|
||||||
<tag>v</tag>
|
<tag>v</tag>
|
||||||
<template>
|
<template>
|
||||||
<h1>Verb</h1>
|
<h1>Verb</h1>
|
||||||
|
<p><lin>Feat<cat/> (<lemma/>)</lin></p>
|
||||||
<table class="forms-table" rules="all">
|
<table class="forms-table" rules="all">
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
|
|||||||
@@ -89,6 +89,10 @@ public class LexicalEntryActivity extends ListActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void expand(View view, String lemma) {
|
private void expand(View view, String lemma) {
|
||||||
|
String html = mTranslator.getInflectionTable(lemma);
|
||||||
|
if (html == null)
|
||||||
|
return;
|
||||||
|
|
||||||
ImageView arrow = (ImageView) view.findViewById(R.id.arrow);
|
ImageView arrow = (ImageView) view.findViewById(R.id.arrow);
|
||||||
arrow.setImageResource(R.drawable.close_arrow);
|
arrow.setImageResource(R.drawable.close_arrow);
|
||||||
|
|
||||||
@@ -102,7 +106,6 @@ public class LexicalEntryActivity extends ListActivity {
|
|||||||
((RelativeLayout) view).addView(inflectionView, params);
|
((RelativeLayout) view).addView(inflectionView, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
String html = mTranslator.getInflectionTable(lemma);
|
|
||||||
inflectionView.loadData(html, "text/html; charset=UTF-8", null);
|
inflectionView.loadData(html, "text/html; charset=UTF-8", null);
|
||||||
|
|
||||||
expandedView = view;
|
expandedView = view;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package org.grammaticalframework.ui.android;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.res.XmlResourceParser;
|
import android.content.res.XmlResourceParser;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import org.grammaticalframework.pgf.Concr;
|
import org.grammaticalframework.pgf.Concr;
|
||||||
@@ -213,14 +214,17 @@ public class Translator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getInflectionTable(String lemma) {
|
public String getInflectionTable(String lemma) {
|
||||||
String cat = getGrammar().getFunctionType(lemma).getCategory();
|
Concr targetLang = getConcr(getTargetLanguage().getConcrete());
|
||||||
|
|
||||||
|
if (!targetLang.hasLinearization(lemma))
|
||||||
|
return null;
|
||||||
|
|
||||||
int res = getTargetLanguage().getInflectionResource();
|
int res = getTargetLanguage().getInflectionResource();
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
|
String cat = getGrammar().getFunctionType(lemma).getCategory();
|
||||||
Expr expr = Expr.readExpr(lemma);
|
Expr expr = Expr.readExpr(lemma);
|
||||||
Concr targetLang = getConcr(getTargetLanguage().getConcrete());
|
|
||||||
Map<String,String> lins = targetLang.tabularLinearize(expr);
|
Map<String,String> lins = targetLang.tabularLinearize(expr);
|
||||||
XmlResourceParser parser = mContext.getResources().getXml(res);
|
XmlResourceParser parser = mContext.getResources().getXml(res);
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
@@ -277,7 +281,8 @@ public class Translator {
|
|||||||
form = false;
|
form = false;
|
||||||
} else if (state == 4 && lin && "lin".equals(parser.getName())) {
|
} else if (state == 4 && lin && "lin".equals(parser.getName())) {
|
||||||
Expr expr2 = Expr.readExpr(abstrBuilder.toString());
|
Expr expr2 = Expr.readExpr(abstrBuilder.toString());
|
||||||
builder.append(targetLang.linearize(expr2));
|
builder.append(TextUtils.htmlEncode(targetLang.linearize(expr2)));
|
||||||
|
lin = false;
|
||||||
emit = true;
|
emit = true;
|
||||||
} else if (state == 4 && emit) {
|
} else if (state == 4 && emit) {
|
||||||
builder.append("</"+parser.getName()+">");
|
builder.append("</"+parser.getName()+">");
|
||||||
@@ -291,7 +296,7 @@ public class Translator {
|
|||||||
if (form) {
|
if (form) {
|
||||||
String s = lins.get(parser.getText());
|
String s = lins.get(parser.getText());
|
||||||
if (s != null)
|
if (s != null)
|
||||||
builder.append(s);
|
builder.append(TextUtils.htmlEncode(s));
|
||||||
} else {
|
} else {
|
||||||
builder.append(parser.getText());
|
builder.append(parser.getText());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user