Exploring Phonologies through Automatic Vocabulary Generation

By Martin Keegan / @mk270

Prolog


:- use_module(library(lists)).

sentence(S, sentence(NPTree, VPTree)) :-
        np(S, T, NPTree),
        vp(T, [], VPTree).

np(NP, Rest, np(ATree, NTree)) :-
        a(NP, N, ATree),
        n(N, Rest, NTree).
		  

OCaml


type sea_maiden = Mermaid | Siren
type drawing_implement = Fine_camel_hair_brush   
type animal = Imperial_property
            | Embalmed
            | Trained
            | Suckling_pig
            | Sea_maiden of sea_maiden
            | Fabulous
            | Stray_dog
            | Classified of animal
            | Trembling_as_if_mad
            | Innumerable
            | Drawn_with of drawing_implement
            | Et_cetera
            | Just_broken_flower_vase
            | Resemblent_of_flies_at_distance
		  

C


int main(void)
{
        struct timeval current = { 100, 0 };
        struct timeval before = { 90, 0 };
        struct timeval tdiff;

        timersub(&current, &before, &tdiff);
        printf("sec: %ld\nusec: %ld\n", tdiff.tv_sec, tdiff.tv_usec);

        timerclear(&before);
        if(timercmp(&tdiff, &before, >)) {
                printf("true\n");
        }       
        tdiff = current;
        printf("sec: %ld\nusec: %ld\n", tdiff.tv_sec, tdiff.tv_usec);
        return 0;
}
		  

Assembly


        .global Call_gen_code
Call_gen_code:
        save    %sp, -96, %sp
        mov     %i0, %l0
        mov     %i1, %i0
        mov     %i4, %i3
        mov     %i5, %i4
        call    %l0
        nop
        mov     %o0, %i0
        ret
        restore

        .global Caml_c_call
Caml_c_call:
        jmp     %g4
        nop
		  

Phonology from scratch


word(Start, End) :-
    syllable(Start, S1),
    syllable(S1, End).

syllable(Start, End) :- 
    onset(Start, S1),
    vowel(S1, End).

onset([t|X], X).
onset([k|X], X).

vowel([i|X], X).
vowel([a|X], X).
vowel([u|X], X).
		  

Textual example: Pater noster


gilaserei arinmaaOur father in the sky
domeeg nergis edoganlet your name be praised
isaareeg jagoganlet your reign come