mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-03 16:22:52 -06:00
rearranging resource-1.0
This commit is contained in:
BIN
lib/resource-1.0/doc/Lang.png
Normal file
BIN
lib/resource-1.0/doc/Lang.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
520
lib/resource-1.0/doc/Resource-HOWTO.html
Normal file
520
lib/resource-1.0/doc/Resource-HOWTO.html
Normal file
@@ -0,0 +1,520 @@
|
||||
<html>
|
||||
<body>
|
||||
|
||||
<center>
|
||||
<h1>HOW TO WRITE A RESOURCE GRAMMAR</h1>
|
||||
|
||||
<p>
|
||||
|
||||
<a href="http://www.cs.chalmers.se/~aarne/">Aarne Ranta</a>
|
||||
<p>
|
||||
30 November 2005
|
||||
</center>
|
||||
|
||||
<p>
|
||||
|
||||
The purpose of this document is to tell how to implement the GF
|
||||
resource grammar API for a new language. We will <i>not</i> cover how
|
||||
to use the resource grammar, nor how to change the API. But we
|
||||
will give some hints how to extend the API.
|
||||
|
||||
<p>
|
||||
|
||||
<b>Notice</b>. This document concerns the API V. 1.0 which has not
|
||||
yet been released. You can find the beginnings of it
|
||||
in <tt>GF/lib/resource-1.0/gf</tt>, but the locations of
|
||||
files are not yet final.
|
||||
|
||||
|
||||
<h2>The resource grammar API</h2>
|
||||
|
||||
The API is divided into a bunch of <tt>abstract</tt> modules.
|
||||
The following figure gives the dependencies of these modules.
|
||||
|
||||
<center>
|
||||
<img src="Lang.png">
|
||||
</center>
|
||||
|
||||
It is advisable to start with a simpler subset of the API, which
|
||||
leaves out certain complicated but not always necessary things:
|
||||
tenses and most part of the lexicon.
|
||||
|
||||
<center>
|
||||
<img src="Test.png">
|
||||
</center>
|
||||
|
||||
The module structure is rather flat: almost every module is a direct
|
||||
parent of the top module (<tt>Lang</tt> or <tt>Test</tt>). The idea
|
||||
is that you can concentrate on one linguistic aspect at a time, or
|
||||
also distribute the work among several authors.
|
||||
|
||||
|
||||
<h3>Phrase category modules</h3>
|
||||
|
||||
The direct parents of the top could be called <b>phrase category modules</b>,
|
||||
since each of them concentrates on a particular phrase category (nouns, verbs,
|
||||
adjectives, sentences,...). A phrase category module tells
|
||||
<i>how to construct phrases in that category</i>. You will find out that
|
||||
all functions in any of these modules have the same value type (or maybe
|
||||
one of a small number of different types). Thus we have
|
||||
<ul>
|
||||
<li> <tt>Noun</tt>: construction of nouns and noun phrases
|
||||
<li> <tt>Adjective</tt>: construction of adjectival phrases
|
||||
<li> <tt>Verb</tt>: construction of verb phrases
|
||||
<li> <tt>Adverb</tt>: construction of adverbial phrases
|
||||
<li> <tt>Numeral</tt>: construction of cardinal and ordinal numerals
|
||||
<li> <tt>Sentence</tt>: construction of sentences and imperatives
|
||||
<li> <tt>Question</tt>: construction of questions
|
||||
<li> <tt>Relative</tt>: construction of relative clauses
|
||||
<li> <tt>Conjunction</tt>: coordination of phrases
|
||||
<li> <tt>Phrase</tt>: construction of the major units of text and speech
|
||||
</ul>
|
||||
|
||||
|
||||
<h3>Infrastructure modules</h3>
|
||||
|
||||
Expressions of each phrase category are constructed in the corresponding
|
||||
phrase category module. But their <i>use</i> takes mostly place in other modules.
|
||||
For instance, noun phrases, which are constructed in <tt>Noun</tt>, are
|
||||
used as arguments of functions of almost all other phrase category modules.
|
||||
How can we build all these modules independently of each other?
|
||||
|
||||
<p>
|
||||
|
||||
As usual in typeful programming, the <i>only</i> thing you need to know
|
||||
about an object you use is its type. When writing a linearization rule
|
||||
for a GF abstract syntax function, the only thing you need to know is
|
||||
the linearization types of its value and argument categories. To achieve
|
||||
the division of the resource grammar to several parallel phrase category modules,
|
||||
what we need is an underlying definition of the linearization types. This
|
||||
definition is given as the implementation of
|
||||
<ul>
|
||||
<li> <tt>Cat</tt>: syntactic categories of the resource grammar
|
||||
</ul>
|
||||
Any resource grammar implementation has first to agree on how to implement
|
||||
<tt>Cat</tt>. Luckily enough, even this can be done incrementally: you
|
||||
can skip the <tt>lincat</tt> definition of a category and use the default
|
||||
<tt>{s : Str}</tt> until you need to change it to something else. In
|
||||
English, for instance, most categories do have this linearization type!
|
||||
|
||||
<p>
|
||||
|
||||
As a slight asymmetry in the module diagrams, you find the following
|
||||
modules:
|
||||
<ul>
|
||||
<li> <tt>Tense</tt>: defines the parameters of polarity, anteriority, and tense
|
||||
<li> <tt>Tensed</tt>: defines how sentences use those parameters
|
||||
<li> <tt>Untensed</tt>: makes sentences use the polarity parameter only
|
||||
</ul>
|
||||
The full resource API (<tt>Lang</tt>) uses <tt>Tensed</tt>, whereas the
|
||||
restricted <tt>Test</tt> API uses <tt>Untensed</tt>.
|
||||
|
||||
|
||||
|
||||
<h3>Lexical modules</h3>
|
||||
|
||||
What is lexical and what is syntactic is not as clearcut in GF as in
|
||||
some other grammar formalisms. Logically, however, lexical means
|
||||
<tt>fun</tt> with no arguments. Linguistically, one may add to this
|
||||
that the <tt>lin</tt> consists of only one token (or of a table whose values
|
||||
are single tokens). Even in the restricted lexicon included in the resource
|
||||
API, the latter rule is sometimes violated in some languages.
|
||||
|
||||
<p>
|
||||
|
||||
Another characterization of lexical is that lexical units can be added
|
||||
almost <i>ad libitum</i>, and they cannot be defined in terms of already
|
||||
given rules. The lexical modules of the resource API are thus more like
|
||||
samples than complete lists. There are three such modules:
|
||||
<ul>
|
||||
<li> <tt>Structural</tt>: structural words (determiners, conjunctions,...)
|
||||
<li> <tt>Basic</tt>: basic everyday content words (nouns, verbs,...)
|
||||
<li> <tt>Lex</tt>: a very small sample of both structural and content words
|
||||
</ul>
|
||||
The module <tt>Structural</tt> aims for completeness, and is likely to
|
||||
be extended in future releases of the resource. The module <tt>Basic</tt>
|
||||
gives a "random" list of words, which enable interesting testing of syntax,
|
||||
and also a check list for morphology, since those words are likely to include
|
||||
most morphological patterns of the language.
|
||||
|
||||
<p>
|
||||
|
||||
The module <tt>Lex</tt> is used in <tt>Test</tt> instead of the two
|
||||
larger modules. Its purpose is to provide a quick way to test the
|
||||
syntactic structures of the phrase category modules without having to implement
|
||||
the larger lexica.
|
||||
|
||||
<p>
|
||||
|
||||
In the case of <tt>Basic</tt> it may come out clearer than anywhere else
|
||||
in the API that it is impossible to give exact translation equivalents in
|
||||
different languages on the level of a resource grammar. In other words,
|
||||
application grammars are likely to use the resource in different ways for
|
||||
different languages.
|
||||
|
||||
|
||||
|
||||
<h2>Phases of the work</h2>
|
||||
|
||||
<h3>Putting up a directory</h3>
|
||||
|
||||
Unless you are writing an instance of a parametrized implementation
|
||||
(Romance or Scandinavian), which will be covered later, the most
|
||||
simple way is to follow roughly the following procedure. Assume you
|
||||
are building a grammar for the Dutch language. Here are the first steps.
|
||||
<ol>
|
||||
<li> Create a sister directory for <tt>GF/lib/resource/english</tt>, named
|
||||
<tt>dutch</tt>.
|
||||
<pre>
|
||||
cd GF/lib/resource/
|
||||
mkdir dutch
|
||||
cd dutch
|
||||
</pre>
|
||||
|
||||
<li> Check out the <a href="http://www.w3.org/WAI/ER/IG/ert/iso639.htm">
|
||||
ISO 639 3-letter language code</a> for Dutch: it is <tt>Dut</tt>.
|
||||
|
||||
<li> Copy the <tt>*Eng.gf</tt> files from <tt>english</tt> <tt>dutch</tt>,
|
||||
and rename them:
|
||||
<pre>
|
||||
cp ../english/*Eng.gf .
|
||||
rename -n 's/Eng/Dut/' *Eng.gf
|
||||
</pre>
|
||||
|
||||
<li> Change the <tt>Eng</tt> module references to <tt>Dut</tt> references
|
||||
in all files:
|
||||
<pre>
|
||||
sed -i 's/Eng/Dut/g' *Dut.gf
|
||||
</pre>
|
||||
|
||||
<li> This may of course change unwanted occurrences of the
|
||||
string <tt>Eng</tt> - verify this by
|
||||
<pre>
|
||||
grep Dut *.gf
|
||||
</pre>
|
||||
But you will have to make lots of manual changes in all files anyway!
|
||||
|
||||
<li> Comment out the contents of these files, except their headers and module
|
||||
brackets. This will give you a set of templates out of which the grammar
|
||||
will grow as you uncomment and modify the files rule by rule.
|
||||
|
||||
</ol>
|
||||
|
||||
|
||||
<h3>The develop-test cycle</h3>
|
||||
|
||||
Now starts the real work. The order in which the <tt>Phrase</tt> modules
|
||||
were introduced above is a natural order to proceed, even though not the
|
||||
only one. So you will find yourseld iterating the following steps:
|
||||
|
||||
<ol>
|
||||
<li> Select a phrase category module, e.g. <tt>NounDut</tt>, and uncomment one
|
||||
linearization rule (for instance, <tt>DefSg</tt>, which is
|
||||
not too complicated).
|
||||
|
||||
<li> Write down some Dutch examples of this rule, in this case translations
|
||||
of "the dog", "the house", "the big house", etc.
|
||||
|
||||
<li> Think about the categories involved (<tt>CN, NP, N</tt>) and the
|
||||
variations they have. Encode this in the lincats of <tt>CatDut</tt>.
|
||||
You may have to define some new parameter types in <tt>ResDut</tt>.
|
||||
|
||||
<li> To be able to test the construction,
|
||||
define some words you need to instantiate it
|
||||
in <tt>LexDut</tt>. Again, it can be helpful to define some simple-minded
|
||||
morphological paradigms in <tt>ResDut</tt>, e.g. corresponding to
|
||||
<tt>ResEng.regN</tt>.
|
||||
|
||||
<li> Doing this, you may want to test the resource independently. Do this by
|
||||
<pre>
|
||||
i -retain ResDut
|
||||
cc regN "huis"
|
||||
</pre>
|
||||
|
||||
<li> Uncomment <tt>NounDut</tt> and <tt>LexDut</tt> in <tt>TestDut</tt>,
|
||||
and compile <tt>TestDut</tt> in GF. Then test by parsing, linearization,
|
||||
and random generation. In particular, linearization to a table should
|
||||
be used so that you see all forms produced:
|
||||
<pre>
|
||||
gr -cat=NP -number=20 -tr | l -table
|
||||
</pre>
|
||||
|
||||
<li> Spare some tree-linearization pairs for later regression testing.
|
||||
You can do this way (!!to be completed)
|
||||
|
||||
</ol>
|
||||
You are likely to run this cycle a few times for each linearization rule
|
||||
you implement, and some hundreds of times altogether. There are 159
|
||||
<tt>funs</tt> in <tt>Test</tt> (at the moment).
|
||||
|
||||
<p>
|
||||
|
||||
Of course, you don't need to complete one phrase category module before starting
|
||||
with the next one. Actually, a suitable subset of <tt>Noun</tt>,
|
||||
<tt>Verb</tt>, and <tt>Adjective</tt> will lead to a reasonable coverage
|
||||
very soon, keep you motivated, and reveal errors.
|
||||
|
||||
|
||||
<h3>Resource modules used</h3>
|
||||
|
||||
These modules will be written by you.
|
||||
<ul>
|
||||
<li> <tt>ResDut</tt>: parameter types and auxiliary operations
|
||||
<li> <tt>MorphoDut</tt>: complete inflection engine; not needed for <tt>Test</tt>.
|
||||
</ul>
|
||||
These modules are language-independent and provided by the existing resource
|
||||
package.
|
||||
<ul>
|
||||
<li> <tt>ParamX</tt>: parameter types used in many languages
|
||||
<li> <tt>TenseX</tt>: implementation of the logical tense, anteriority,
|
||||
and polarity parameters
|
||||
<li> <tt>Coordination</tt>: operations to deal with lists and coordination
|
||||
<li> <tt>Prelude</tt>: general-purpose operations on strings, records,
|
||||
truth values, etc.
|
||||
<li> <tt>Predefined</tt>: general-purpose operations with hard-coded definitions
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<h3>Morphology and lexicon</h3>
|
||||
|
||||
When the implementation of <tt>Test</tt> is complete, it is time to
|
||||
work out the lexicon files. The underlying machinery is provided in
|
||||
<tt>MorphoDut</tt>, which is, in effect, your linguistic theory of
|
||||
Dutch morphology. It can contain very sophisticated and complicated
|
||||
definitions, which are not necessarily suitable for actually building a
|
||||
lexicon. For this purpose, you should write the module
|
||||
<ul>
|
||||
<li> <tt>ParadigmsDut</tt>: morphological paradigms for the lexicographer.
|
||||
</ul>
|
||||
This module provides high-level ways to define the linearization of
|
||||
lexical items, of categories <tt>N, A, V</tt> and their complement-taking
|
||||
variants.
|
||||
|
||||
<p>
|
||||
|
||||
For ease of use, the <tt>Paradigms</tt> modules follow a certain
|
||||
naming convention. Thus they for each lexical category, such as <tt>N</tt>,
|
||||
the functions
|
||||
<ul>
|
||||
<li> <tt>mkN</tt>, for worst-case construction of <tt>N</tt>. Its type signature
|
||||
has the form
|
||||
<pre>
|
||||
mkN : Str -> ... -> Str -> P -> ... -> Q -> N
|
||||
</pre>
|
||||
with as many string and parameter arguments as can ever be needed to
|
||||
construct an <tt>N</tt>.
|
||||
<li> <tt>regN</tt>, for the most common cases, with just one string argument:
|
||||
<pre>
|
||||
regN : Str -> N
|
||||
</pre>
|
||||
<li> A language-dependent (small) set of functions to handle mild irregularities
|
||||
and common exceptions.
|
||||
</ul>
|
||||
For the complement-taking variants, such as <tt>V2</tt>, we provide
|
||||
<ul>
|
||||
<li> <tt>mkV2</tt>, which takes a <tt>V</tt> and all necessary arguments, such
|
||||
as case and preposition:
|
||||
<pre>
|
||||
mkV2 : V -> Case -> Str -> V2 ;
|
||||
</pre>
|
||||
<li> A language-dependent (small) set of functions to handle common special cases,
|
||||
such as direct transitive verbs:
|
||||
<pre>
|
||||
dirV2 : V -> V2 ;
|
||||
-- dirV2 v = mkV2 v accusative []
|
||||
</pre>
|
||||
</ul>
|
||||
The golden rule for the design of paradigms is that
|
||||
<ul>
|
||||
<li> The user will only need function applications with constants and strings,
|
||||
never any records or tables.
|
||||
</ul>
|
||||
The discipline of data abstraction moreover requires that the user of the resource
|
||||
is not given access to parameter constructors, but only to constants that denote
|
||||
them. This gives the resource grammarian the freedom to change the underlying
|
||||
data representation if needed. It means that the <tt>ParadigmsDut</tt> module has
|
||||
to define constants for those parameter types and constructors that
|
||||
the application grammarian may need to use, e.g.
|
||||
<pre>
|
||||
oper
|
||||
Case : Type ;
|
||||
nominative, accusative, genitive : Case ;
|
||||
</pre>
|
||||
These constants are defined in terms of parameter types and constructors
|
||||
in <tt>ResDut</tt> and <tt>MorphoDut</tt>, which modules are are not
|
||||
accessible to the application grammarian.
|
||||
|
||||
|
||||
<h3>Lock fields</h3>
|
||||
|
||||
An important difference between <tt>MorphoDut</tt> and
|
||||
<tt>ParadigmsDut</tt> is that the former uses "raw" record types
|
||||
as lincats, whereas the latter used category symbols defined in
|
||||
<tt>CatDut</tt>. When these category symbols are used to denote
|
||||
record types in a resource modules, such as <tt>ParadigmsDut</tt>,
|
||||
a <b>lock field</b> is added to the record, so that categories
|
||||
with the same implementation are not confused with each other.
|
||||
(This is inspired by the <tt>newtype</tt> discipline in Haskell.)
|
||||
For instance, the lincats of adverbs and conjunctions may be the same
|
||||
in <tt>CatDut</tt>:
|
||||
<pre>
|
||||
lincat Adv = {s : Str} ;
|
||||
lincat Conj = {s : Str} ;
|
||||
</pre>
|
||||
But when these category symbols are used to denote their linearization
|
||||
types in resource module, these definitions are translated to
|
||||
<pre>
|
||||
oper Adv : Type = {s : Str ; lock_Adv : {}} ;
|
||||
oper Conj : Type = {s : Str} ; lock_Conj : {}} ;
|
||||
</pre>
|
||||
In this way, the user of a resource grammar cannot confuse adverbs with
|
||||
conjunctions. In other words, the lock fields force the type checker
|
||||
to function as grammaticality checker.
|
||||
|
||||
<p>
|
||||
|
||||
When the resource grammar is <tt>open</tt>ed in an application grammar, the
|
||||
lock fields are never seen (except possibly in type error messages),
|
||||
and the application grammarian should never write them herself. If she
|
||||
has to do this, it is a sign that the resource grammar is incomplete, and
|
||||
the proper way to proceed is to fix the resource grammar.
|
||||
|
||||
<p>
|
||||
|
||||
The resource grammarian has to provide the dummy lock field values
|
||||
in her hidden definitions of constants in <tt>Paradigms</tt>. For instance,
|
||||
<pre>
|
||||
mkAdv : Str -> Adv ;
|
||||
-- mkAdv s = {s = s ; lock_Adv = <>} ;
|
||||
</pre>
|
||||
|
||||
|
||||
<h3>Lexicon construction</h3>
|
||||
|
||||
The lexicon belonging to <tt>LangDut</tt> consists of two modules:
|
||||
<ul>
|
||||
<li> <tt>StructuralDut</tt>, structural words, built by directly using
|
||||
<tt>MorphoDut</tt>.
|
||||
<li> <tt>BasicDut</tt>, content words, built by using <tt>ParadigmsDut</tt>.
|
||||
</ul>
|
||||
The reason why <tt>MorphoDut</tt> has to be used in <tt>StructuralDut</tt>
|
||||
is that <tt>ParadigmsDut</tt> does not contain constructors for closed
|
||||
word classes such as pronouns and determiners. The reason why we
|
||||
recommend <tt>ParadigmsDut</tt> for building <tt>BasicDut</tt> is that
|
||||
the coverage of the paradigms gets thereby tested and that the
|
||||
use of the paradigms in <tt>BasicDut</tt> gives a good set of examples for
|
||||
those who want to build new lexica.
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Inside phrase category modules</h2>
|
||||
|
||||
<h3>Noun</h3>
|
||||
|
||||
<h3>Verb</h3>
|
||||
|
||||
<h3>Adjective</h3>
|
||||
|
||||
|
||||
<h2>Lexicon extension</h2>
|
||||
|
||||
<h3>The irregularity lexicon</h3>
|
||||
|
||||
It may be handy to provide a separate module of irregular
|
||||
verbs and other words which are difficult for a lexicographer
|
||||
to handle. There are usually a limited number of such words - a
|
||||
few hundred perhaps. Building such a lexicon separately also
|
||||
makes it less important to cover <i>everything</i> by the
|
||||
worst-case paradigms (<tt>mkV</tt> etc).
|
||||
|
||||
|
||||
|
||||
<h3>Lexicon extraction from a word list</h3>
|
||||
|
||||
You can often find resources such as lists of
|
||||
irregular verbs on the internet. For instance, the
|
||||
<a href="http://www.dutchtrav.com/gram/irrverbs.html">
|
||||
Dutch for Travelers</a> page gives a list of verbs in the
|
||||
traditional tabular format, which begins as follows:
|
||||
<pre>
|
||||
begrijpen begrijp begreep begrepen to understand
|
||||
bijten bijt beet gebeten to bite
|
||||
binden bind bond gebonden to tie
|
||||
breken breek brak gebroken to break
|
||||
</pre>
|
||||
All you have to do is to write a suitable verb paradigm
|
||||
<pre>
|
||||
irregV : Str -> Str -> Str -> Str -> V ;
|
||||
</pre>
|
||||
and a Perl or Python or Haskell script that transforms
|
||||
the table to
|
||||
<pre>
|
||||
begrijpen_V = irregV "begrijpen" "begrijp" "begreep" "begrepen" ;
|
||||
bijten_V = irregV "bijten" "bijt" "beet" "gebeten" ;
|
||||
binden_V = irregV "binden" "bind" "bond" "gebonden" ;
|
||||
</pre>
|
||||
(You may want to use the English translation for some purpose, as well.)
|
||||
|
||||
<p>
|
||||
|
||||
When using ready-made word lists, you should think about
|
||||
coyright issues. Ideally, all resource grammar material should
|
||||
be provided under GNU General Public License.
|
||||
|
||||
|
||||
|
||||
<h3>Lexicon extraction from raw text data</h3>
|
||||
|
||||
This is a cheap technique to build a lexicon of thousands
|
||||
of words, if text data is available in digital format.
|
||||
See the <a href="http://www.cs.chalmers.se/~markus/FM/">
|
||||
Functional Morphology</a> homepage for details.
|
||||
|
||||
|
||||
|
||||
<h3>Extending the resource grammar API</h3>
|
||||
|
||||
Sooner or later it will happen that the resource grammar API
|
||||
does not suffice for all applications. A common reason is
|
||||
that it does not include idiomatic expressions in a given language.
|
||||
The solution then is in the first place to build language-specific
|
||||
extension modules. This chapter will deal with this issue.
|
||||
|
||||
|
||||
<h2>Writing an instance of parametrized resource grammar implementation</h2>
|
||||
|
||||
Above we have looked at how a resource implementation is built by
|
||||
the copy and paste method (from English to Dutch), that is, formally
|
||||
speaking, from scratch. A more elegant solution available for
|
||||
families of languages such as Romance and Scandinavian is to
|
||||
use parametrized modules. The advantages are
|
||||
<ul>
|
||||
<li> theoretical: linguistic generalizations and insights
|
||||
<li> practical: maintainability improves with fewer components
|
||||
</ul>
|
||||
In this chapter, we will look at an example: adding Portuguese to
|
||||
the Romance family.
|
||||
|
||||
|
||||
|
||||
<h2>Parametrizing a resource grammar implementation</h2>
|
||||
|
||||
This is the most demanding form of resource grammar writing.
|
||||
We do <i>not</i> recommend the method of parametrizing from the
|
||||
beginning: it is easier to have one language first implemented
|
||||
in the conventional way and then add another language of the
|
||||
same family by aprametrization. This means that the copy and
|
||||
paste method is still used, but at this time the differences
|
||||
are put into an <tt>interface</tt> module.
|
||||
|
||||
<p>
|
||||
|
||||
This chapter will work out an example of how an Estonian grammar
|
||||
is constructed from the Finnish grammar through parametrization.
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
BIN
lib/resource-1.0/doc/Test.png
Normal file
BIN
lib/resource-1.0/doc/Test.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
581
lib/resource-1.0/doc/official.txt
Normal file
581
lib/resource-1.0/doc/official.txt
Normal file
@@ -0,0 +1,581 @@
|
||||
The Official EU languages
|
||||
|
||||
The 20 official languages of the EU and their abbreviations are as follows:
|
||||
|
||||
Español ES Spanish
|
||||
Dansk DA Danish
|
||||
Deutsch DE German
|
||||
Elinika EL Greek
|
||||
English EN
|
||||
Français FR French
|
||||
Italiano IT Italian
|
||||
Nederlands NL Dutch
|
||||
Português PT Portuguese
|
||||
Suomi FI Finnish
|
||||
Svenska SV Swedish
|
||||
?e?tina CS Czech
|
||||
Eesti ET Estonian
|
||||
Latviesu valoda LV Latvian
|
||||
Lietuviu kalba LT Lithuanian
|
||||
Magyar HU Hungarian
|
||||
Malti MT Maltese
|
||||
Polski PL Polish
|
||||
Sloven?ina SK Slovak
|
||||
Sloven??ina SL Slovene
|
||||
|
||||
http://europa.eu.int/comm/education/policies/lang/languages/index_en.html
|
||||
|
||||
-----
|
||||
http://www.w3.org/WAI/ER/IG/ert/iso639.htm
|
||||
|
||||
ar arabic
|
||||
no norwegian
|
||||
ru russian
|
||||
|
||||
--
|
||||
|
||||
ISO 639: 3-letter codes
|
||||
|
||||
abk ab Abkhazian
|
||||
ace Achinese
|
||||
ach Acoli
|
||||
ada Adangme
|
||||
aar aa Afar
|
||||
afh Afrihili
|
||||
afr af Afrikaans
|
||||
afa Afro-Asiatic (Other)
|
||||
aka Akan
|
||||
akk Akkadian
|
||||
alb/sqi sq Albanian
|
||||
ale Aleut
|
||||
alg Algonquian languages
|
||||
tut Altaic (Other)
|
||||
amh am Amharic
|
||||
apa Apache languages
|
||||
ara ar Arabic
|
||||
arc Aramaic
|
||||
arp Arapaho
|
||||
arn Araucanian
|
||||
arw Arawak
|
||||
arm/hye hy Armenian
|
||||
art Artificial (Other)
|
||||
asm as Assamese
|
||||
ath Athapascan languages
|
||||
map Austronesian (Other)
|
||||
ava Avaric
|
||||
ave Avestan
|
||||
awa Awadhi
|
||||
aym ay Aymara
|
||||
aze az Azerbaijani
|
||||
nah Aztec
|
||||
ban Balinese
|
||||
bat Baltic (Other)
|
||||
bal Baluchi
|
||||
bam Bambara
|
||||
bai Bamileke languages
|
||||
bad Banda
|
||||
bnt Bantu (Other)
|
||||
bas Basa
|
||||
bak ba Bashkir
|
||||
baq/eus eu Basque
|
||||
bej Beja
|
||||
bem Bemba
|
||||
ben bn Bengali
|
||||
ber Berber (Other)
|
||||
bho Bhojpuri
|
||||
bih bh Bihari
|
||||
bik Bikol
|
||||
bin Bini
|
||||
bis bi Bislama
|
||||
bra Braj
|
||||
bre be Breton
|
||||
bug Buginese
|
||||
bul bg Bulgarian
|
||||
bua Buriat
|
||||
bur/mya my Burmese
|
||||
bel be Byelorussian
|
||||
cad Caddo
|
||||
car Carib
|
||||
cat ca Catalan
|
||||
cau Caucasian (Other)
|
||||
ceb Cebuano
|
||||
cel Celtic (Other)
|
||||
cai Central American Indian (Other)
|
||||
chg Chagatai
|
||||
cha Chamorro
|
||||
che Chechen
|
||||
chr Cherokee
|
||||
chy Cheyenne
|
||||
chb Chibcha
|
||||
chi/zho zh Chinese
|
||||
chn Chinook jargon
|
||||
cho Choctaw
|
||||
chu Church Slavic
|
||||
chv Chuvash
|
||||
cop Coptic
|
||||
cor Cornish
|
||||
cos co Corsican
|
||||
cre Cree
|
||||
mus Creek
|
||||
crp Creoles and Pidgins (Other)
|
||||
cpe Creoles and Pidgins, English-based (Other)
|
||||
cpf Creoles and Pidgins, French-based (Other)
|
||||
cpp Creoles and Pidgins, Portuguese-based (Other)
|
||||
cus Cushitic (Other)
|
||||
hr Croatian
|
||||
ces/cze cs Czech
|
||||
dak Dakota
|
||||
dan da Danish
|
||||
del Delaware
|
||||
din Dinka
|
||||
div Divehi
|
||||
doi Dogri
|
||||
dra Dravidian (Other)
|
||||
dua Duala
|
||||
dut/nla nl Dutch
|
||||
dum Dutch, Middle (ca. 1050-1350)
|
||||
dyu Dyula
|
||||
dzo dz Dzongkha
|
||||
efi Efik
|
||||
egy Egyptian (Ancient)
|
||||
eka Ekajuk
|
||||
elx Elamite
|
||||
eng en English
|
||||
enm English, Middle (ca. 1100-1500)
|
||||
ang English, Old (ca. 450-1100)
|
||||
esk Eskimo (Other)
|
||||
epo eo Esperanto
|
||||
est et Estonian
|
||||
ewe Ewe
|
||||
ewo Ewondo
|
||||
fan Fang
|
||||
fat Fanti
|
||||
fao fo Faroese
|
||||
fij fj Fijian
|
||||
fin fi Finnish
|
||||
fiu Finno-Ugrian (Other)
|
||||
fon Fon
|
||||
fra/fre fr French
|
||||
frm French, Middle (ca. 1400-1600)
|
||||
fro French, Old (842- ca. 1400)
|
||||
fry fy Frisian
|
||||
ful Fulah
|
||||
gaa Ga
|
||||
gae/gdh Gaelic (Scots)
|
||||
glg gl Gallegan
|
||||
lug Ganda
|
||||
gay Gayo
|
||||
gez Geez
|
||||
geo/kat ka Georgian
|
||||
deu/ger de German
|
||||
gmh German, Middle High (ca. 1050-1500)
|
||||
goh German, Old High (ca. 750-1050)
|
||||
gem Germanic (Other)
|
||||
gil Gilbertese
|
||||
gon Gondi
|
||||
got Gothic
|
||||
grb Grebo
|
||||
grc Greek, Ancient (to 1453)
|
||||
ell/gre el Greek, Modern (1453-)
|
||||
kal kl Greenlandic
|
||||
grn gn Guarani
|
||||
guj gu Gujarati
|
||||
hai Haida
|
||||
hau ha Hausa
|
||||
haw Hawaiian
|
||||
heb he Hebrew
|
||||
her Herero
|
||||
hil Hiligaynon
|
||||
him Himachali
|
||||
hin hi Hindi
|
||||
hmo Hiri Motu
|
||||
hun hu Hungarian
|
||||
hup Hupa
|
||||
iba Iban
|
||||
ice/isl is Icelandic
|
||||
ibo Igbo
|
||||
ijo Ijo
|
||||
ilo Iloko
|
||||
inc Indic (Other)
|
||||
ine Indo-European (Other)
|
||||
ind id Indonesian
|
||||
ina ia Interlingua (International Auxiliary language Association)
|
||||
ine - Interlingue
|
||||
iku iu Inuktitut
|
||||
ipk ik Inupiak
|
||||
ira Iranian (Other)
|
||||
gai/iri ga Irish
|
||||
sga Irish, Old (to 900)
|
||||
mga Irish, Middle (900 - 1200)
|
||||
iro Iroquoian languages
|
||||
ita it Italian
|
||||
jpn ja Japanese
|
||||
jav/jaw jv/jw Javanese
|
||||
jrb Judeo-Arabic
|
||||
jpr Judeo-Persian
|
||||
kab Kabyle
|
||||
kac Kachin
|
||||
kam Kamba
|
||||
kan kn Kannada
|
||||
kau Kanuri
|
||||
kaa Kara-Kalpak
|
||||
kar Karen
|
||||
kas ks Kashmiri
|
||||
kaw Kawi
|
||||
kaz kk Kazakh
|
||||
kha Khasi
|
||||
khm km Khmer
|
||||
khi Khoisan (Other)
|
||||
kho Khotanese
|
||||
kik Kikuyu
|
||||
kin rw Kinyarwanda
|
||||
kir ky Kirghiz
|
||||
kom Komi
|
||||
kon Kongo
|
||||
kok Konkani
|
||||
kor ko Korean
|
||||
kpe Kpelle
|
||||
kro Kru
|
||||
kua Kuanyama
|
||||
kum Kumyk
|
||||
kur ku Kurdish
|
||||
kru Kurukh
|
||||
kus Kusaie
|
||||
kut Kutenai
|
||||
lad Ladino
|
||||
lah Lahnda
|
||||
lam Lamba
|
||||
oci oc Langue d'Oc (post 1500)
|
||||
lao lo Lao
|
||||
lat la Latin
|
||||
lav lv Latvian
|
||||
ltz Letzeburgesch
|
||||
lez Lezghian
|
||||
lin ln Lingala
|
||||
lit lt Lithuanian
|
||||
loz Lozi
|
||||
lub Luba-Katanga
|
||||
lui Luiseno
|
||||
lun Lunda
|
||||
luo Luo (Kenya and Tanzania)
|
||||
mac/mak mk Macedonian
|
||||
mad Madurese
|
||||
mag Magahi
|
||||
mai Maithili
|
||||
mak Makasar
|
||||
mlg mg Malagasy
|
||||
may/msa ms Malay
|
||||
mal Malayalam
|
||||
mlt ml Maltese
|
||||
man Mandingo
|
||||
mni Manipuri
|
||||
mno Manobo languages
|
||||
max Manx
|
||||
mao/mri mi Maori
|
||||
mar mr Marathi
|
||||
chm Mari
|
||||
mah Marshall
|
||||
mwr Marwari
|
||||
mas Masai
|
||||
myn Mayan languages
|
||||
men Mende
|
||||
mic Micmac
|
||||
min Minangkabau
|
||||
mis Miscellaneous (Other)
|
||||
moh Mohawk
|
||||
mol mo Moldavian
|
||||
mkh Mon-Kmer (Other)
|
||||
lol Mongo
|
||||
mon mn Mongolian
|
||||
mos Mossi
|
||||
mul Multiple languages
|
||||
mun Munda languages
|
||||
nau na Nauru
|
||||
nav Navajo
|
||||
nde Ndebele, North
|
||||
nbl Ndebele, South
|
||||
ndo Ndongo
|
||||
nep ne Nepali
|
||||
new Newari
|
||||
nic Niger-Kordofanian (Other)
|
||||
ssa Nilo-Saharan (Other)
|
||||
niu Niuean
|
||||
non Norse, Old
|
||||
nai North American Indian (Other)
|
||||
nor no Norwegian
|
||||
nno Norwegian (Nynorsk)
|
||||
nub Nubian languages
|
||||
nym Nyamwezi
|
||||
nya Nyanja
|
||||
nyn Nyankole
|
||||
nyo Nyoro
|
||||
nzi Nzima
|
||||
oji Ojibwa
|
||||
ori or Oriya
|
||||
orm om Oromo
|
||||
osa Osage
|
||||
oss Ossetic
|
||||
oto Otomian languages
|
||||
pal Pahlavi
|
||||
pau Palauan
|
||||
pli Pali
|
||||
pam Pampanga
|
||||
pag Pangasinan
|
||||
pan pa Panjabi
|
||||
pap Papiamento
|
||||
paa Papuan-Australian (Other)
|
||||
fas/per fa Persian
|
||||
peo Persian, Old (ca 600 - 400 B.C.)
|
||||
phn Phoenician
|
||||
pol pl Polish
|
||||
pon Ponape
|
||||
por pt Portuguese
|
||||
pra Prakrit languages
|
||||
pro Provencal, Old (to 1500)
|
||||
pus ps Pushto
|
||||
que qu Quechua
|
||||
roh rm Rhaeto-Romance
|
||||
raj Rajasthani
|
||||
rar Rarotongan
|
||||
roa Romance (Other)
|
||||
ron/rum ro Romanian
|
||||
rom Romany
|
||||
run rn Rundi
|
||||
rus ru Russian
|
||||
sal Salishan languages
|
||||
sam Samaritan Aramaic
|
||||
smi Sami languages
|
||||
smo sm Samoan
|
||||
sad Sandawe
|
||||
sag sg Sango
|
||||
san sa Sanskrit
|
||||
srd Sardinian
|
||||
sco Scots
|
||||
sel Selkup
|
||||
sem Semitic (Other)
|
||||
sr Serbian
|
||||
scr sh Serbo-Croatian
|
||||
srr Serer
|
||||
shn Shan
|
||||
sna sn Shona
|
||||
sid Sidamo
|
||||
bla Siksika
|
||||
snd sd Sindhi
|
||||
sin si Singhalese
|
||||
sit - Sino-Tibetan (Other)
|
||||
sio Siouan languages
|
||||
sla Slavic (Other)
|
||||
ssw ss Siswant
|
||||
slk/slo sk Slovak
|
||||
slv sl Slovenian
|
||||
sog Sogdian
|
||||
som so Somali
|
||||
son Songhai
|
||||
wen Sorbian languages
|
||||
nso Sotho, Northern
|
||||
sot st Sotho, Southern
|
||||
sai South American Indian (Other)
|
||||
esl/spa es Spanish
|
||||
suk Sukuma
|
||||
sux Sumerian
|
||||
sun su Sudanese
|
||||
sus Susu
|
||||
swa sw Swahili
|
||||
ssw Swazi
|
||||
sve/swe sv Swedish
|
||||
syr Syriac
|
||||
tgl tl Tagalog
|
||||
tah Tahitian
|
||||
tgk tg Tajik
|
||||
tmh Tamashek
|
||||
tam ta Tamil
|
||||
tat tt Tatar
|
||||
tel te Telugu
|
||||
ter Tereno
|
||||
tha th Thai
|
||||
bod/tib bo Tibetan
|
||||
tig Tigre
|
||||
tir ti Tigrinya
|
||||
tem Timne
|
||||
tiv Tivi
|
||||
tli Tlingit
|
||||
tog to Tonga (Nyasa)
|
||||
ton Tonga (Tonga Islands)
|
||||
tru Truk
|
||||
tsi Tsimshian
|
||||
tso ts Tsonga
|
||||
tsn tn Tswana
|
||||
tum Tumbuka
|
||||
tur tr Turkish
|
||||
ota Turkish, Ottoman (1500 - 1928)
|
||||
tuk tk Turkmen
|
||||
tyv Tuvinian
|
||||
twi tw Twi
|
||||
uga Ugaritic
|
||||
uig ug Uighur
|
||||
ukr uk Ukrainian
|
||||
umb Umbundu
|
||||
und Undetermined
|
||||
urd ur Urdu
|
||||
uzb uz Uzbek
|
||||
vai Vai
|
||||
ven Venda
|
||||
vie vi Vietnamese
|
||||
vol vo Volapük
|
||||
vot Votic
|
||||
wak Wakashan languages
|
||||
wal Walamo
|
||||
war Waray
|
||||
was Washo
|
||||
cym/wel cy Welsh
|
||||
wol wo Wolof
|
||||
xho xh Xhosa
|
||||
sah Yakut
|
||||
yao Yao
|
||||
yap Yap
|
||||
yid yi Yiddish
|
||||
yor yo Yoruba
|
||||
zap Zapotec
|
||||
zen Zenaga
|
||||
zha za Zhuang
|
||||
zul zu Zulu
|
||||
zun Zuni
|
||||
|
||||
ISO 639: 2-letter codes
|
||||
|
||||
AA "Afar"
|
||||
AB "Abkhazian"
|
||||
AF "Afrikaans"
|
||||
AM "Amharic"
|
||||
AR "Arabic"
|
||||
AS "Assamese"
|
||||
AY "Aymara"
|
||||
AZ "Azerbaijani"
|
||||
BA "Bashkir"
|
||||
BE "Byelorussian"
|
||||
BG "Bulgarian"
|
||||
BH "Bihari"
|
||||
BI "Bislama"
|
||||
BN "Bengali" "Bangla"
|
||||
BO "Tibetan"
|
||||
BR "Breton"
|
||||
CA "Catalan"
|
||||
CO "Corsican"
|
||||
CS "Czech"
|
||||
CY "Welsh"
|
||||
DA "Danish"
|
||||
DE "German"
|
||||
DZ "Bhutani"
|
||||
EL "Greek"
|
||||
EN "English" "American"
|
||||
EO "Esperanto"
|
||||
ES "Spanish"
|
||||
ET "Estonian"
|
||||
EU "Basque"
|
||||
FA "Persian"
|
||||
FI "Finnish"
|
||||
FJ "Fiji"
|
||||
FO "Faeroese"
|
||||
FR "French"
|
||||
FY "Frisian"
|
||||
GA "Irish"
|
||||
GD "Gaelic" "Scots Gaelic"
|
||||
GL "Galician"
|
||||
GN "Guarani"
|
||||
GU "Gujarati"
|
||||
HA "Hausa"
|
||||
HI "Hindi"
|
||||
HR "Croatian"
|
||||
HU "Hungarian"
|
||||
HY "Armenian"
|
||||
IA "Interlingua"
|
||||
IE "Interlingue"
|
||||
IK "Inupiak"
|
||||
IN "Indonesian"
|
||||
IS "Icelandic"
|
||||
IT "Italian"
|
||||
IW "Hebrew"
|
||||
JA "Japanese"
|
||||
JI "Yiddish"
|
||||
JW "Javanese"
|
||||
KA "Georgian"
|
||||
KK "Kazakh"
|
||||
KL "Greenlandic"
|
||||
KM "Cambodian"
|
||||
KN "Kannada"
|
||||
KO "Korean"
|
||||
KS "Kashmiri"
|
||||
KU "Kurdish"
|
||||
KY "Kirghiz"
|
||||
LA "Latin"
|
||||
LN "Lingala"
|
||||
LO "Laothian"
|
||||
LT "Lithuanian"
|
||||
LV "Latvian" "Lettish"
|
||||
MG "Malagasy"
|
||||
MI "Maori"
|
||||
MK "Macedonian"
|
||||
ML "Malayalam"
|
||||
MN "Mongolian"
|
||||
MO "Moldavian"
|
||||
MR "Marathi"
|
||||
MS "Malay"
|
||||
MT "Maltese"
|
||||
MY "Burmese"
|
||||
NA "Nauru"
|
||||
NE "Nepali"
|
||||
NL "Dutch"
|
||||
NO "Norwegian"
|
||||
OC "Occitan"
|
||||
OM "Oromo" "Afan"
|
||||
OR "Oriya"
|
||||
PA "Punjabi"
|
||||
PL "Polish"
|
||||
PS "Pashto" "Pushto"
|
||||
PT "Portuguese"
|
||||
QU "Quechua"
|
||||
RM "Rhaeto-Romance"
|
||||
RN "Kirundi"
|
||||
RO "Romanian"
|
||||
RU "Russian"
|
||||
RW "Kinyarwanda"
|
||||
SA "Sanskrit"
|
||||
SD "Sindhi"
|
||||
SG "Sangro"
|
||||
SH "Serbo-Croatian"
|
||||
SI "Singhalese"
|
||||
SK "Slovak"
|
||||
SL "Slovenian"
|
||||
SM "Samoan"
|
||||
SN "Shona"
|
||||
SO "Somali"
|
||||
SQ "Albanian"
|
||||
SR "Serbian"
|
||||
SS "Siswati"
|
||||
ST "Sesotho"
|
||||
SU "Sudanese"
|
||||
SV "Swedish"
|
||||
SW "Swahili"
|
||||
TA "Tamil"
|
||||
TE "Tegulu"
|
||||
TG "Tajik"
|
||||
TH "Thai"
|
||||
TI "Tigrinya"
|
||||
TK "Turkmen"
|
||||
TL "Tagalog"
|
||||
TN "Setswana"
|
||||
TO "Tonga"
|
||||
TR "Turkish"
|
||||
TS "Tsonga"
|
||||
TT "Tatar"
|
||||
TW "Twi"
|
||||
UK "Ukrainian"
|
||||
UR "Urdu"
|
||||
UZ "Uzbek"
|
||||
VI "Vietnamese"
|
||||
VO "Volapuk"
|
||||
WO "Wolof"
|
||||
XH "Xhosa"
|
||||
YO "Yoruba"
|
||||
ZH "Chinese"
|
||||
ZU "Zulu"
|
||||
Reference in New Issue
Block a user