From: Thad Hughes Date: Tue, 20 Dec 2011 21:18:17 +0000 (-0800) Subject: Show all rows in foreign lists. X-Git-Url: http://gitweb.fperrin.net/?p=DictionaryPC.git;a=commitdiff_plain;h=cde2f082e2ad9070bdee69c99ac50b77622efad4 Show all rows in foreign lists. --- diff --git a/src/com/hughes/android/dictionary/parser/EnWiktionaryXmlParser.java b/src/com/hughes/android/dictionary/parser/EnWiktionaryXmlParser.java index c6aee3b..0dd51d2 100644 --- a/src/com/hughes/android/dictionary/parser/EnWiktionaryXmlParser.java +++ b/src/com/hughes/android/dictionary/parser/EnWiktionaryXmlParser.java @@ -768,24 +768,27 @@ public class EnWiktionaryXmlParser { if (lastForeign != null && pairEntry.pairs.size() > 0) { pairEntry.pairs.remove(pairEntry.pairs.size() - 1); final Pair pair = new Pair(formatAndIndexExampleString(nextLine, enIndexBuilder, indexedEntry), formatAndIndexExampleString(lastForeign, otherIndexBuilder, indexedEntry), swap); - if (pair.lang1 != "--" && pair.lang1 != "--") { + if (pair.lang1 != "--" || pair.lang2 != "--") { pairEntry.pairs.add(pair); } lastForeign = null; } else { LOG.warning("TODO: English example with no foreign: " + title + ", " + nextLine); - // TODO: add something. + final Pair pair = new Pair("--", formatAndIndexExampleString(nextLine, null, indexedEntry), swap); + if (pair.lang1 != "--" || pair.lang2 != "--") { + pairEntry.pairs.add(pair); + } } } else if (nextPrefix.equals("#*")) { // Can't really index these. final Pair pair = new Pair("--", formatAndIndexExampleString(nextLine, null, indexedEntry), swap); lastForeign = nextLine; - if (pair.lang1 != "--" && pair.lang1 != "--") { + if (pair.lang1 != "--" || pair.lang2 != "--") { pairEntry.pairs.add(pair); } } else if (nextPrefix.equals("#::*") || nextPrefix.equals("##") || nextPrefix.equals("#*:") || nextPrefix.equals("#:*") || true) { final Pair pair = new Pair("--", formatAndIndexExampleString(nextLine, null, indexedEntry), swap); - if (pair.lang1 != "--" && pair.lang1 != "--") { + if (pair.lang1 != "--" || pair.lang2 != "--") { pairEntry.pairs.add(pair); } // } else { diff --git a/testdata/goldens/wiktionary.de_de.quickdic.text b/testdata/goldens/wiktionary.de_de.quickdic.text index f067799..595df2d 100644 --- a/testdata/goldens/wiktionary.de_de.quickdic.text +++ b/testdata/goldens/wiktionary.de_de.quickdic.text @@ -171,7 +171,9 @@ Index: de de->en ===als=== Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===also=== also! :: so! also :: so @@ -475,7 +477,9 @@ Index: de de->en ===Berlin=== Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- Berlin {n} (proper noun) :: Berlin, one of the current component states of Germany. ===Bern=== Bern {n} (proper noun) :: Bern {{qualifier|city, canton}} @@ -808,7 +812,9 @@ Index: de de->en ===dazu=== Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===de=== (Low German) de (article), genitive: der, dative: den, accusative: de, definite article :: the (Low German) de {f} (article), genitive: der, dative: der, accusative: de, definite article :: the @@ -1180,7 +1186,9 @@ Index: de de->en ===ewig=== Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===Fabian=== Fabian (proper noun) :: {{given name|male|lang=de}} ===fade=== @@ -2212,7 +2220,9 @@ Index: de de->en never again :: -- Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- je {{de-adv}} :: {{context|with “[[desto]]” or “[[umso]]“}} the ... the ... je mehr, desto besser :: “the more the merrier” je mehr, umso besser – “the more the merrier“ :: -- @@ -2470,7 +2480,9 @@ Index: de de->en ===niemals=== Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===Niemand=== glauben {{de-verb}} :: to believe (to think sb/sth exists = an + acc.; to think sth someone says is correct = dat.) Glaubst du an Engel? :: Do you believe in angels? @@ -3186,7 +3198,9 @@ Index: de de->en Basel-Stadt {{de-proper noun}} :: {{l|en|Basel-Stadt}} Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===Stadtluft=== frei {{de-adj|comparative=freier|superlative=freisten}} :: released, unimprisoned, unenslaved Stadtluft macht frei. :: City's air makes free. (By living in a city for a certain time, a German peasant could free himself from serfdom.) @@ -3466,7 +3480,9 @@ Index: de de->en ===verdammt=== Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===Vereinigte=== Vereinigte Arabische Emirate {{de-proper noun|head=[[Vereinigte]] [[Arabische]] [[Emirate]]}} :: The United Arab Emirates; a country in the Middle East. ===Verhältnis=== @@ -3608,7 +3624,9 @@ Index: de de->en ===Weltteil=== Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===wen=== wen :: {{interrogative|lang=de}} accusative of wer, who(m) (direct object). ===wenn=== @@ -3626,7 +3644,9 @@ Index: de de->en Und Gott sprach: »Es werde Licht!« Und es ward Licht. [http://www.bibledbdata.org/onlinebibles/german_l/01_001.htm] :: And God said: "Let there be light." And there was light. Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===Wermut=== Wermut {{de-noun|g=m|pl=-|genitive=Wermuts}} :: vermouth Wermut {{de-noun|g=m|pl=-|genitive=Wermuts}} :: wormwood @@ -3884,11 +3904,15 @@ Index: en en->de ===1800=== Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===1910=== Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===1930s=== Ursula (proper noun) :: {{given name|female|lang=de}} of {{etyl|la|de}} origin, very popular from the 1930s to the 1960s. ===1960s=== @@ -4416,7 +4440,9 @@ Index: en en->de ===author=== Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===authority=== nach (preposition), + dative :: by the authority of ===Auto=== @@ -4588,7 +4614,9 @@ Index: en en->de ===Berlin=== Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- Berlin {n} (proper noun) :: Berlin, one of the current component states of Germany. ===better=== besser :: comparative of gut; better @@ -4842,7 +4870,9 @@ Index: en en->de Bangkok {n} (proper noun) :: Bangkok (capital of Thailand) Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- Kabul {n} (proper noun) :: Kabul (capital of Afghanistan) Zagreb {n} (proper noun) :: Zagreb (capital of Croatia) Hannover {{de-proper noun|g=n}} :: Hanover, capital of Lower Saxony, Germany. @@ -5000,7 +5030,9 @@ Index: en en->de Aachen {{infl|de|proper noun|genitive=Aachens}} :: The German city Aachen Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- Hamburg {n} (proper noun) :: Hamburg (German city) Sofia (proper noun) :: Sofia (city) Turku {n} (proper noun) :: Turku (city in Finland) @@ -5582,7 +5614,9 @@ Index: en en->de ===Ein=== Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===eine=== ne :: {{colloquial|lang=de}} shorthand of the feminine indefinite article eine (“an; a”) Möchtest du ne Flasche Bier? :: “Would you like a bottle of beer?” @@ -6000,7 +6034,9 @@ Index: en en->de ===Friedrich=== Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===friend=== (Middle High German) wine {m} :: friend Freundin {{de-noun|g=f|plural=Freundinnen}} :: a female friend @@ -6112,7 +6148,9 @@ Index: en en->de rot {{de-adj|comparative=röter|superlative=rötesten}}
{{de-adj|comparative=roter|superlative=rotesten}} :: {{context|politics|Germany|lang=de}} specifically, pertaining to the SPD (a large social democratic party in Germany) or Linke (a far-left political party in Germany) Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- Berlin {n} (proper noun) :: Berlin, one of the current component states of Germany. Hannover {{de-proper noun|g=n}} :: Hanover, capital of Lower Saxony, Germany. Jan (proper noun) :: {{given name|male|lang=de}}, a Low German and North European variant of Johann (=John), popular in Germany at the end of the 20th century. @@ -6825,7 +6863,9 @@ Index: en en->de Jan (proper noun) :: {{given name|male|lang=de}}, a Low German and North European variant of Johann (=John), popular in Germany at the end of the 20th century. Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===Johannisbeere=== Johannisbeere {{de-noun|g=f|plural=Johannisbeeren}} :: redcurrant (rote Johannisbeere) Johannisbeere {{de-noun|g=f|plural=Johannisbeeren}} :: blackcurrant (schwarze Johannisbeere) @@ -6861,7 +6901,9 @@ Index: en en->de ===Karl=== Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===Kater=== mies (mieser, am miesesten) :: {{usually|somewhat jocularly|lang=de}} mean, wretched; as, ein mieser Kater (a horrible hang-over), ein mieser Kerl (a mean guy). ===Kerl=== @@ -7975,7 +8017,9 @@ Index: en en->de Paul (proper noun) :: {{given name|male|lang=de}}, cognate to English Paul. Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===paved=== Straße {{de-noun|g=f|plural=Straßen}} :: a paved road, especially in the city Das Kind überquerte die Straße. :: The child crossed the road. @@ -8424,7 +8468,9 @@ Index: en en->de ===Richter=== Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===rid=== los (adverb)(only used in combination with sein (to be) or another verb) :: rid of ===right=== @@ -8583,7 +8629,9 @@ Index: en en->de ===Scheffler=== Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===Scheldt=== Schelde (proper noun) :: The mighty river Scheldt, which flows through France, Flanders (Belgium, where he becomes navigable for seaships) and the Netherlands. ===Schleswig=== @@ -9015,7 +9063,9 @@ Index: en en->de ===Stadtschicksal=== Berlin {n} (proper noun) :: Berlin, the capital city of Germany. Berlin ist mehr ein Weltteil als eine Stadt. :: Johann Paul Friedrich Richter, 1800. + Berlin is more a part of a world than a city. :: -- Berlin ist eine Stadt, verdammt dazu, ewig zu werden, niemals zu sein. :: Karl Scheffler, author of Berlin: Ein Stadtschicksal, 1910. + Berlin is a city damned forever to become, never to be. :: -- ===stamp=== beschlagen (third-person singular simple present beschlägt, past tense beschlug, past participle beschlagen) :: to stamp, flatten. ===stand=== diff --git a/todo.txt b/todo.txt index f3e54e0..dee3b6b 100644 --- a/todo.txt +++ b/todo.txt @@ -3,21 +3,11 @@ X version number ! enter should hide keyboard icons -done: -add to wordlist should focus word (so next typing clears text). -sideways keyboard appear. - **** PC: -! {infl} -! always put defs in list... handle word-info in English. italian verbs... (show conjugation, pulled from a linked place....) -done: -better handling of language name in foreign sections (might need to append it if it isn't exact) -sub-levels in translations. -add unit test for: Errors: [Unmatched {{ error: * {{a|US}} {{IPA|[ˈfɔɹ.wɝd]]}} === Bad ordering: ===do=== @@ -36,3 +26,12 @@ in wiktionary futurismo :: futurism () (noun) +done: +{infl} +better handling of language name in foreign sections (might need to append it if it isn't exact) +sub-levels in translations. +add unit test for: Errors: [Unmatched {{ error: * {{a|US}} {{IPA|[ˈfɔɹ.wɝd]]}} +add to wordlist should focus word (so next typing clears text). +sideways keyboard appear. +always put defs in list... + \ No newline at end of file