Skip to content

Compoglot Language Documentation

Luke Silva edited this page Dec 18, 2016 · 1 revision

Concepts

The compoglot language is build upon three different structures, the group, list and definition. These structures may have a preceding name/identifier consisting of alphanumeric characters.

The root node of a sentence definition in compoglot is a group, without a preceding name. The smallest valid compoglot code is therefore {}

Structure Name Example Contains Notes
Groups group{ x y z } Groups, lists or definitions, separated by whitespace A group symbolizes a single object that is made up of multiple objects of differing types.
Lists list[ x , x ] Groups, lists or definitions, separated by commas A list symbolizes a single object that is made up of multiple objects of the same type
Definitions def(1,true,optional=7) Required parameters, and optional keyworded parameters, separated by commas The basic element, which creates an object.

Primitives

Compoglot supports integers, strings and booleans.

Booleans can be constructed with true and false or T and F as short hands.

Strings may use either single or double quotes. No escaping is currently implemented for special characters.

Naming

Many constructs in compoglot have two names. One longer and more descriptive, and one shorter, but less descriptive.

Longer names have capitalisation for every word. Eg: SentenceType

Shorter names are entirely lowercase Eg: st

Construct Documentation

Table of contents:

SubjectList - List - sub | Subject

A list that may hold NounGroups. Stores all the nouns for the subject in a single object.

###Examples

sub[{n(2,0,F)}, {n(1,0,F)}]        => you and I
sub[{n(842,0,F) adj(25)}]          => brown paper

ObjectGroup - Group - obj | Object

A group that holds ObjectLists Holds all of the objects in a single object.

###Examples

obj{ 1[{n(1,0,F)}] }               => me
obj{ 1[{n(842,-1,F) adj(25)}] 2[{n(2,0,F)}] => the brown paper(1)   you(2)

ObjectList - List - 1 | 2 | 3 | 4 | 5 | 6 | 7

A list that holds NounGroups for a particular object. The preceding name for this list is the number of the object that should be filled by this list.

As a general rule, the direct object of a sentence is usually numbered 1.

###Examples

1[{n(1,0,F)}]            => me
2[{n(3,0,F)}]            => him
1[{n(842,-1,F)}]         => the paper

NounGroup - Group

A group that may hold Noun, Adjective and It definitions.

###Examples

{Noun(842,0,F) Adjective(25)}      => brown paper

Noun | n (ID,Article Type,Plural) - Definition

Defines a noun object

###Required arguments:

  • int ID: The identifier number for the noun. Can be found in the Noun list for your native language.
  • int Article: The identifier number for the article / possessive pronoun that precedes the noun. See the table below:
ID Article
-2 a / an
-1 the
0
1 my
2 your (singular & potentially informal)
3 his
4 her
5 its
6 our
7 your (plural)
8 their
9 your (formal)
10 a lot of
11 this
  • bool Plural: If true, the noun is made into it's plural form.

###Keyword (optional) arguments:

  • int Numeral | num: The preceding numeral, displaying a count of a plural noun.

    If negative, the appropriate negative marker is added to the noun.

    If zero, the numeral is ignored. Hence, this number should be one greater than the number you wish to display. The value of zero is ignored, the value of 1 produces 0, the value of 2 produces 1, etc.

  • int Preposition | prepos: Adds a preposition to the noun by it's identifier.

    TODO: Create a list of prepositions by their identifier numbers.

  • bool Reflexive | reflex: Ensures the reflexive form of a pronoun.

    Eg: him -> himself. her -> herself

  • Group GenitiveNoun | genitive: Adds a noun which this noun possesses. Accepts a NounGroup

  • Group RelativeClause | rclause: Adds a relative clause to the noun. Accepts a RootGroup

  • bool RelativeClauseEssential | rclauseessential: Should be set to true if the relative clause for this noun is essential to the meaning of the sentence.

    In English this determines whether the word "which"(non-essential) or "that"(essential) is used to mark a relative clause.

  • int RelativeClauseObj | rclauseobj: Should be set to the number of the object that this noun should replace in the relative clause. Should be set to 0 if this noun should replace the subject of the relative clause.

###Examples:

n(167,0,F)                => air
Noun(167,0,F)             => air
n(167,-1,F)               => the air
n(3,0,F,reflex=T)         => he (subject) / himself (object)
n(157,-1,T,num=5)         => the four tests

Adjective | adj (ID) - Definition

Defines an adjective

###Required arguments:

  • int ID: The identifier number of the adjective to add

    TODO: Create a list of adjectives.

Examples:

adj(23)                   => blue
Adjective(23)             => blue

It | it (ID) - Definition

Creates the correct pronoun to represent an object. Usually 'it' in English, however will pick the correct genered pronoun in langauges with genders

Required arguments:

  • int ID: The identifier number of the noun to represent with a pronoun

Examples:

it(167)                    => it (en)  |  sie (de)
it(156)                    => it (en)  |  er  (de)

Verb{1,2,3} (VerbID) - Definition

Adds an (extended) verb to the sentence. Sets either ExtVerb1, ExtVerb2 or ExtVerb3 depending on it's name.

Required arguments:

  • int VerbID: The ID of the verb to add to the sentence.

###Examples:

Verb1(233)                 => wave
Verb1(4) Verb2(21)         => can swim

SentenceType | st (Sentence Type) - Definition

Sets the tense, and voice of the sentence

Required arguments:

  • int Sentence Type: The sentence type of the current sentence. Can be one of the following:

    Note: Not all sentence types are different for every language. Compoglot will use the closest available tenses in the output language.

ID Notes Example
0 Present tense (progressive) I am going.
1 Present tense (simple) I go.
2 Recent past tense I went.
3 Recent past tense (formal) I went.
4 Recent past tense (progressive) I was going.
5 Recent past tense (formal & progressive) I was going.
6 Distant past tense I have gone.
7 Distant past tense (formal) I have gone.
8 Distant past tense (progressive) I have been going.
9 Distant past tense (formal & progressive) I have been going.
10 (Near) Future tense I will go.
11 (Near) Future tense (progressive) I will be going.
12 (Distant) Future tense I will go.
13 (Distant) Future tense (progressive) I will be going.
14 Future past tense I will go.
15 Future past tense (progressive) I will be going.
16 Present passive tense (progressive) It is being eaten.
17 Present passive tense (simple) It is eaten.
18 Recent past passive tense It was eaten.
19 Recent past passive tense (formal) It was eaten.
20 Recent past passive tense (progressive) It was being eaten.
21 Recent past passive tense (formal & progressive) It was being eaten.
22 Distant past passive tense It has been eaten.
23 Distant past passive tense (formal) It has been eaten.
24 Distant past passive tense (progressive) It has been being eaten.
25 Distant past passive tense (formal & progressive) It has been being eaten.
26 (Near) Future passive tense It will be eaten.
27 (Near) Future passive tense (progressive) It will be being eaten.
28 (Distant) Future passive tense It will be eaten.
29 (Distant) Future passive tense (progressive) It will be eaten.
30 Future past passive tense It will have been eaten.
31 Future past passive tense (progressive) It will have been being eaten.
32 Button text Save File

###Keyword (optional) arguments:

  • bool Negate | neg: If true, the sentence is negated.

  • bool question: If true, the sentence is formed as a question.

  • int Punctuation | punc: Set's the punctuation mark at the end of the sentence. Can be one of the following values

ID Notes
0 No punctuation is added at the end of the sentence.
1 A full stop or question mark is added at the end of the sentence, depending on if the sentence is a question or not.

###Examples:

st(1)            ________  => I go.
st(1,neg=T)      ________  => I did not go.
st(1,question=T) ________  => Did you go?
st(1,punc=0)     ________  => I go

Clause | clause (Conjunction,clause) - Definition

Adds another clause to the sentence.

Required arguments:

  • int Conjunction: The ID of the conjunction to use to join the two clauses. TODO:Create a list of conjunctions

  • int clause: A RootGroup containing the clause to add after this clause.

###Examples:

clause(3,{ sub[{n(3,0,F)}] Verb1(233) st(2) })  => and he waved