Features

What is a feature again?

A feature is a typed value which is an attribute of an object. The object type of an object determines which features it has.

See here for more information.

How do I store the text?

Well, the text arises because objects exist in the monad stream which carry the textual information.

That may seem a bit cryptic, so let's try an example.

CREATE OBJECT TYPE
[Word
  surface : STRING;
]
GO

Here we have created an object type "Word" with a feature called "surface". The idea is that the objects of type Word will make up the text collectively, but filling the monad stream with word-sized chunks of the text.

Note that we need not have "Word" as the text-bearing unit: It can also be "Morpheme" or "Grapheme", or even "Sentence" if we don't care about individual words.

How do I store parts of speech?

The easiest is to create an enumeration with the parts of speech, then have this enumeration type as the type of a feature on the Word object type:

CREAT ENUMERATION pos_t = {
  NA = -1,
  noun = 1,
  verb,
  adjective,
  adverb,
  preposition,
  conjunction,
  interjection,
  negative,
  article
}
GO

CREATE OBJECT TYPE
[Word
  surface : STRING;
  pos : pos_t;
  lemma : STRING;
]
GO

How do I store complex grammatical tags?

Well, there are two ways:

  1. Either you use a single STRING or ASCII feature, or
  2. You split up the grammatical tag into its constituent parts (for example, part of speech, person, number, gender, discourse type, etc. etc.) and store those as individual enumerations or strings.

The latter makes the grammatical "tag" searcheable in its individual parts through the topographic search-features of MQL.

The former is more compact, is less prone to error, and is also searcheable through regular expressions.

How do I store a phrase type?

Much in the same way as you store a part of speech (see above).

How do I point to other objects?

You use the ID_D type and then let that feature point to the other object through that object's "self" feature.

That is, say you want object A to point to object B. Object A must have a feature of type ID_D, say, "parent". Then, when creating object A, set object A.parent to B.self.

How do I create a syntax tree?

Since Emdros does not provide a way of storing a list of id_ds, you cannot express the tree top-down. Instead, express it bottom-up with upwards pointers:

CREATE OBJECT TYPE
[Word
    surface : STRING;
    parent : ID_D; // Points to phrase or clause
]
GO

CREATE OBJECT TYPE
[Phrase
    phrase_type : phrase_type_t; // A suitably defined enumeration
    parent : ID_D; // Points to phrase or clause
]
GO

CREATE OBJECT TYPE
[Clause
    parent : ID_D; // Points to clause or sentence (or phrase, in some languages)
]
GO

CREATE OBJECT TYPE
[Sentence
    parent : ID_D; // Points to paragraph...
]

CREATE OBJECT TYPE
[Paragraph]   // The buck stops here.
GO

Previous:Object types
Up:Schema
Next:Enumerations