Lattakia1 (Lattice Kiaugh) Language Reference Manual Heba Elfardy <hme2110 >, Li Yifan <!yl2774 >, Dara Hazeghi<dmh2186>, Wael Salbum<wss2113> ! Why Lattakia? Lattakia is a programming language that deals with all the lattice kiaugh (kiaugh means trouble or anxiety). It’s designed to focus on using lattices as a main data structure and code structure. In fact, Lattakia work on word lattices, which are special kinds of lattices (partially-ordered sets). An example of a word lattice is: http://www.statmt.org/moses/?n=Moses.WordLattices. Word lattices are powerful representation models. They are used in many applications; e.g., in NLP, they are useful wherever there is ambiguity (uncertainty) in the meaning (or interpretation) of a word; such as in speech recognition, machine translation, language (or dialect) identification, language models, paraphrasing (e.g., in information retrieval and question answering), and other applications. However, many researchers avoid using them because they are hard to implement; instead they use top ‘n’ paths. Recently, many free NLP tools that accept lattices as input have been implemented (e.g. Moses, SRILM, etc.); thus, we will build a programming language that allows programmers to build lattices, process them and provide them to other tools. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1!Lattakia!(o r!L a t a k ia )!is !a!c ity !o n !th e !Mediterrane a n !S ea !th at!is!over!40 00!yea rs!old.!It!was !called!Ra m itha!an d!was!a!part!of!the!kingdom!of!Ugarit.!Later,!under!the!Roman!rule,!it!was!called!Laodicea.!!Table Of Contents Why Lattakia?............................................................................................................................................. 1!Table Of Contents....................................................................................................................................... 2!Introduction to Word Lattices ......................................................................................................3!Defining the language:................................................................................................................................ 3!Variables (or alternative lattices; or altlats):............................................................................................... 3!Lattices (or sequence lattices; or seqlats): .................................................................................................. 3!Labels:......................................................................................................................................................... 4!Conditions are also lattices: ........................................................................................................................ 4!Types, Operators, and Expressions ..............................................................................................5!Assignment and Evaluation: ....................................................................................................................... 5!Left-preference assignment V.S. Right-preference assignment: ................................................................ 5!Operations on Lattices: ............................................................................................................................... 5!Example: Stack: .......................................................................................................................................... 6!Constrained Variables (Functions) ...............................................................................................7!Types Of Variables:.................................................................................................................................... 7!Recursion: ................................................................................................................................................... 7!Epsilon V.S. NIL: ....................................................................................................................................... 8!Loops (built-in recursive functions): .......................................................................................................... 8!Built-in Aggregation functions: .................................................................................................................. 9!Example: Quicksort: ................................................................................................................................... 9!Advanced Data Structures...........................................................................................................11!Lists:.......................................................................................................................................................... 11!Stack and Queue: ...................................................................................................................................... 11!Hash Tables:.............................................................................................................................................. 11!Sets:........................................................................................................................................................... 11!Tuples:....................................................................................................................................................... 11!Search and Rule Triggering ........................................................................................................12!Search (Regular Expressions):.................................................................................................................. 12!Rules: When triggered (condition satisfied), apply action: ...................................................................... 12!Accessing the value of a variable: (Not part of our plan for this semester).............................................. 12!Example: Part-of-Speech (POS) Tagger:.................................................................................................. 13!Object-Oriented Lattakia (Under construction) .......................................................................14!Classes: .....................................................................................................................................................
View Full Document