Пример #1
0
 public Segments(CharacterDefinitionTable table, string representation, Shape shape)
 {
     _representation = representation;
     _table          = table;
     _shape          = shape;
     _shape.Freeze();
 }
Пример #2
0
        /// <summary>
        /// Converts the specified phonetic shape to a valid regular expression string. Regular expressions
        /// formatted for display purposes are NOT guaranteed to compile.
        /// </summary>
        /// <param name="shape">The phonetic shape.</param>
        /// <param name="table">The symbol table.</param>
        /// <param name="displayFormat">if <c>true</c> the result will be formatted for display, otherwise
        /// it will be formatted for compilation.</param>
        /// <returns>The regular expression string.</returns>
        public static string ToRegexString(this Shape shape, CharacterDefinitionTable table, bool displayFormat)
        {
            var sb = new StringBuilder();

            if (!displayFormat)
            {
                sb.Append("^");
            }
            foreach (ShapeNode node in shape)
            {
                if (node.IsDeleted())
                {
                    continue;
                }

                string[] strReps     = table.GetMatchingStrReps(node).ToArray();
                int      strRepCount = strReps.Length;
                if (strRepCount > 0)
                {
                    if (strRepCount > 1)
                    {
                        sb.Append(displayFormat ? "[" : "(");
                    }
                    int i = 0;
                    foreach (string strRep in strReps)
                    {
                        if (strRep.Length > 1)
                        {
                            sb.Append("(");
                        }

                        sb.Append(displayFormat ? strRep : Regex.Escape(strRep));

                        if (strRep.Length > 1)
                        {
                            sb.Append(")");
                        }
                        if (i < strRepCount - 1 && !displayFormat)
                        {
                            sb.Append("|");
                        }
                        i++;
                    }
                    if (strReps.Length > 1)
                    {
                        sb.Append(displayFormat ? "]" : ")");
                    }

                    if (node.Annotation.Optional)
                    {
                        sb.Append("?");
                    }
                }
            }
            if (!displayFormat)
            {
                sb.Append("$");
            }
            return(sb.ToString());
        }
Пример #3
0
        private void AddSegDef(CharacterDefinitionTable table, FeatureSystem phoneticFeatSys, string strRep,
                               params string[] symbols)
        {
            var fs = new FeatureStruct();

            foreach (string symbolID in symbols)
            {
                FeatureSymbol symbol = phoneticFeatSys.GetSymbol(symbolID);
                fs.AddValue(symbol.Feature, new SymbolicFeatureValue(symbol));
            }
            table.AddSegment(strRep, fs);
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Stratum"/> class.
        /// </summary>
        /// <param name="charDefTable"></param>
        public Stratum(CharacterDefinitionTable charDefTable)
        {
            Depth         = -1;
            _charDefTable = charDefTable;

            _mrules = new ObservableCollection <IMorphologicalRule>();
            _mrules.CollectionChanged += MorphologicalRulesChanged;
            _prules = new List <IPhonologicalRule>();

            _templates = new ObservableCollection <AffixTemplate>();
            _templates.CollectionChanged += TemplatesChanged;

            _entries = new ObservableCollection <LexEntry>();
            _entries.CollectionChanged += EntriesChanged;
        }
Пример #5
0
        public static string ToString(this IEnumerable <ShapeNode> nodes, CharacterDefinitionTable table, bool includeBdry)
        {
            var sb = new StringBuilder();

            foreach (ShapeNode node in nodes)
            {
                if ((!includeBdry && node.Annotation.Type() == HCFeatureSystem.Boundary) || node.IsDeleted())
                {
                    continue;
                }

                IEnumerable <string> strReps = table.GetMatchingStrReps(node);
                string strRep = strReps.FirstOrDefault();
                if (strRep != null)
                {
                    sb.Append(strRep);
                }
            }
            return(sb.ToString());
        }
Пример #6
0
        private void PrintTrace(Trace trace, int indent, HashSet <int> lineIndices)
        {
            _context.Out.Write(GetTraceTypeString(trace.Type));
            _context.Out.Write(" [");
            bool   first     = true;
            string ruleLabel = GetRuleLabelString(trace.Source);

            if (!string.IsNullOrEmpty(ruleLabel))
            {
                if (trace.SubruleIndex >= 0)
                {
                    _context.Out.Write("{0}: {1}({2})", ruleLabel, trace.Source.Name, trace.SubruleIndex);
                }
                else
                {
                    _context.Out.Write("{0}: {1}", ruleLabel, trace.Source.Name);
                }
                first = false;
            }
            bool analysis = IsAnalysis(trace.Type);

            if (trace.Input != null)
            {
                if (!first)
                {
                    _context.Out.Write(", ");
                }
                first = false;
                CharacterDefinitionTable table = trace.Input.Stratum.CharacterDefinitionTable;
                _context.Out.Write("Input: {0}", analysis ? trace.Input.Shape.ToRegexString(table, true) : trace.Input.Shape.ToString(table, true));
            }
            if (trace.Output != null)
            {
                if (!first)
                {
                    _context.Out.Write(", ");
                }
                first = false;
                CharacterDefinitionTable table = trace.Output.Stratum.CharacterDefinitionTable;
                _context.Out.Write("Output: {0}", analysis ? trace.Output.Shape.ToRegexString(table, true) : trace.Output.Shape.ToString(table, true));
            }
            if (trace.FailureReason != FailureReason.None)
            {
                if (!first)
                {
                    _context.Out.Write(", ");
                }
                _context.Out.Write("Reason: {0}", trace.FailureReason);
            }
            _context.Out.WriteLine("]");

            if (!trace.IsLeaf)
            {
                int i = 0;
                foreach (Trace child in trace.Children)
                {
                    PrintIndent(indent, lineIndices);
                    _context.Out.WriteLine("|");
                    PrintIndent(indent, lineIndices);
                    _context.Out.Write("+-");
                    if (i != trace.Children.Count - 1)
                    {
                        lineIndices.Add(indent);
                    }
                    PrintTrace(child, indent + 2, lineIndices);
                    if (i != trace.Children.Count - 1)
                    {
                        lineIndices.Remove(indent);
                    }
                    i++;
                }
            }
        }
Пример #7
0
 public Segments(CharacterDefinitionTable table, string representation)
     : this(table, representation, table.Segment(representation))
 {
 }
Пример #8
0
 protected FeatureStruct Char(CharacterDefinitionTable table, string strRep)
 {
     return(table[strRep].FeatureStruct);
 }
Пример #9
0
 private void AddBdryDef(CharacterDefinitionTable table, string strRep)
 {
     table.AddBoundary(strRep);
 }
Пример #10
0
        public void FixtureSetUp()
        {
            TraceManager = new TraceManager();
            var phonologicalFeatSys = new FeatureSystem
            {
                new SymbolicFeature("voc", new FeatureSymbol("voc+", "+"), new FeatureSymbol("voc-", "-")),
                new SymbolicFeature("cons", new FeatureSymbol("cons+", "+"), new FeatureSymbol("cons-", "-")),
                new SymbolicFeature("high", new FeatureSymbol("high+", "+"), new FeatureSymbol("high-", "-")),
                new SymbolicFeature("low", new FeatureSymbol("low+", "+"), new FeatureSymbol("low-", "-")),
                new SymbolicFeature("back", new FeatureSymbol("back+", "+"), new FeatureSymbol("back-", "-")),
                new SymbolicFeature("round", new FeatureSymbol("round+", "+"), new FeatureSymbol("round-", "-")),
                new SymbolicFeature("vd", new FeatureSymbol("vd+", "+"), new FeatureSymbol("vd-", "-")),
                new SymbolicFeature("asp", new FeatureSymbol("asp+", "+"), new FeatureSymbol("asp-", "-")),
                new SymbolicFeature("del_rel", new FeatureSymbol("del_rel+", "+"), new FeatureSymbol("del_rel-", "-")),
                new SymbolicFeature("ATR", new FeatureSymbol("ATR+", "+"), new FeatureSymbol("ATR-", "-")),
                new SymbolicFeature("strident", new FeatureSymbol("strident+", "+"),
                                    new FeatureSymbol("strident-", "-")),
                new SymbolicFeature("cont", new FeatureSymbol("cont+", "+"), new FeatureSymbol("cont-", "-")),
                new SymbolicFeature("nasal", new FeatureSymbol("nasal+", "+"), new FeatureSymbol("nasal-", "-")),
                new SymbolicFeature("poa", new FeatureSymbol("bilabial"), new FeatureSymbol("labiodental"),
                                    new FeatureSymbol("alveolar"), new FeatureSymbol("velar"))
            };

            phonologicalFeatSys.Freeze();

            var syntacticFeatSys = new SyntacticFeatureSystem
            {
                new SymbolicFeature("foo", new FeatureSymbol("foo+", "+"), new FeatureSymbol("foo-", "-")),
                new SymbolicFeature("baz", new FeatureSymbol("baz+", "+"), new FeatureSymbol("baz-", "-")),
                new SymbolicFeature("num", new FeatureSymbol("sg"), new FeatureSymbol("pl")),
                new SymbolicFeature("pers", new FeatureSymbol("1"), new FeatureSymbol("2"), new FeatureSymbol("3"),
                                    new FeatureSymbol("4")),
                new SymbolicFeature("tense", new FeatureSymbol("past"), new FeatureSymbol("pres")),
                new SymbolicFeature("evidential", new FeatureSymbol("witnessed")),
                new SymbolicFeature("aspect", new FeatureSymbol("perf"), new FeatureSymbol("impf")),
                new SymbolicFeature("mood", new FeatureSymbol("active"), new FeatureSymbol("passive")),
                new SymbolicFeature("fum", new FeatureSymbol("fum+", "+"), new FeatureSymbol("fum-", "-")),
                new SymbolicFeature("bar", new FeatureSymbol("bar+", "+"), new FeatureSymbol("bar-", "-"))
            };

            syntacticFeatSys.AddPartsOfSpeech(new FeatureSymbol("N", "Noun"), new FeatureSymbol("V", "Verb"),
                                              new FeatureSymbol("TV", "Transitive Verb"),
                                              new FeatureSymbol("IV", "Intransitive Verb"), new FeatureSymbol("A", "Adjective"));
            Head = syntacticFeatSys.AddHeadFeature();
            Foot = syntacticFeatSys.AddFootFeature();
            syntacticFeatSys.Freeze();

            Table1 = new CharacterDefinitionTable()
            {
                Name = "table1"
            };
            AddSegDef(Table1, phonologicalFeatSys, "a", "cons-", "voc+", "high-", "low+", "back+", "round-", "vd+");
            AddSegDef(Table1, phonologicalFeatSys, "i", "cons-", "voc+", "high+", "low-", "back-", "round-", "vd+");
            AddSegDef(Table1, phonologicalFeatSys, "u", "cons-", "voc+", "high+", "low-", "back+", "round+", "vd+");
            AddSegDef(Table1, phonologicalFeatSys, "o", "cons-", "voc+", "high-", "low-", "back+", "round+", "vd+");
            AddSegDef(Table1, phonologicalFeatSys, "y", "cons-", "voc+", "high+", "low-", "back-", "round+", "vd+");
            AddSegDef(Table1, phonologicalFeatSys, "ɯ", "cons-", "voc+", "high+", "low-", "back+", "round-", "vd+");
            AddSegDef(Table1, phonologicalFeatSys, "p", "cons+", "voc-", "bilabial", "vd-", "asp-", "strident-",
                      "cont-", "nasal-");
            AddSegDef(Table1, phonologicalFeatSys, "t", "cons+", "voc-", "alveolar", "vd-", "asp-", "del_rel-",
                      "strident-", "cont-", "nasal-");
            AddSegDef(Table1, phonologicalFeatSys, "k", "cons+", "voc-", "velar", "vd-", "asp-", "strident-", "cont-",
                      "nasal-");
            AddSegDef(Table1, phonologicalFeatSys, "ts", "cons+", "voc-", "alveolar", "vd-", "asp-", "del_rel+",
                      "strident+", "cont-", "nasal-");
            AddSegDef(Table1, phonologicalFeatSys, "pʰ", "cons+", "voc-", "bilabial", "vd-", "asp+", "strident-",
                      "cont-", "nasal-");
            AddSegDef(Table1, phonologicalFeatSys, "tʰ", "cons+", "voc-", "alveolar", "vd-", "asp+", "del_rel-",
                      "strident-", "cont-", "nasal-");
            AddSegDef(Table1, phonologicalFeatSys, "kʰ", "cons+", "voc-", "velar", "vd-", "asp+", "strident-", "cont-",
                      "nasal-");
            AddSegDef(Table1, phonologicalFeatSys, "tsʰ", "cons+", "voc-", "alveolar", "vd-", "asp+", "del_rel+",
                      "strident+", "cont-", "nasal-");
            AddSegDef(Table1, phonologicalFeatSys, "b", "cons+", "voc-", "bilabial", "vd+", "cont-", "nasal-");
            AddSegDef(Table1, phonologicalFeatSys, "d", "cons+", "voc-", "alveolar", "vd+", "strident-", "cont-",
                      "nasal-");
            AddSegDef(Table1, phonologicalFeatSys, "g", "cons+", "voc-", "velar", "vd+", "cont-", "nasal-");
            AddSegDef(Table1, phonologicalFeatSys, "m", "cons+", "voc-", "bilabial", "vd+", "cont-", "nasal+");
            AddSegDef(Table1, phonologicalFeatSys, "n", "cons+", "voc-", "alveolar", "vd+", "strident-", "cont-",
                      "nasal+");
            AddSegDef(Table1, phonologicalFeatSys, "ŋ", "cons+", "voc-", "velar", "vd+", "cont-", "nasal+");
            AddSegDef(Table1, phonologicalFeatSys, "s", "cons+", "voc-", "alveolar", "vd-", "asp-", "del_rel-",
                      "strident+", "cont+");
            AddSegDef(Table1, phonologicalFeatSys, "z", "cons+", "voc-", "alveolar", "vd+", "asp-", "del_rel-",
                      "strident+", "cont+");
            AddSegDef(Table1, phonologicalFeatSys, "f", "cons+", "voc-", "labiodental", "vd-", "asp-", "strident+",
                      "cont+");
            AddSegDef(Table1, phonologicalFeatSys, "v", "cons+", "voc-", "labiodental", "vd+", "asp-", "strident+",
                      "cont+");

            Table2 = new CharacterDefinitionTable()
            {
                Name = "table2"
            };
            AddSegDef(Table2, phonologicalFeatSys, "a", "cons-", "voc+", "high-", "low+", "back+", "round-", "vd+");
            AddSegDef(Table2, phonologicalFeatSys, "i", "cons-", "voc+", "high+", "low-", "back-", "round-", "vd+");
            AddSegDef(Table2, phonologicalFeatSys, "u", "cons-", "voc+", "high+", "low-", "back+", "round+", "vd+");
            AddSegDef(Table2, phonologicalFeatSys, "y", "cons-", "voc+", "high+", "low-", "back-", "round+", "vd+");
            AddSegDef(Table2, phonologicalFeatSys, "o", "cons-", "voc+", "high-", "low-", "back+", "round+", "vd+");
            AddSegDef(Table2, phonologicalFeatSys, "p", "cons+", "voc-", "bilabial", "vd-");
            AddSegDef(Table2, phonologicalFeatSys, "t", "cons+", "voc-", "alveolar", "vd-", "del_rel-", "strident-");
            AddSegDef(Table2, phonologicalFeatSys, "k", "cons+", "voc-", "velar", "vd-");
            AddSegDef(Table2, phonologicalFeatSys, "ts", "cons+", "voc-", "alveolar", "vd-", "del_rel+", "strident+");
            AddSegDef(Table2, phonologicalFeatSys, "b", "cons+", "voc-", "bilabial", "vd+");
            AddSegDef(Table2, phonologicalFeatSys, "d", "cons+", "voc-", "alveolar", "vd+", "strident-");
            AddSegDef(Table2, phonologicalFeatSys, "g", "cons+", "voc-", "velar", "vd+");
            AddSegDef(Table2, phonologicalFeatSys, "m", "cons+", "voc-", "bilabial", "vd+", "cont-", "nasal+");
            AddSegDef(Table2, phonologicalFeatSys, "n", "cons+", "voc-", "alveolar", "vd+", "cont-", "nasal+");
            AddSegDef(Table2, phonologicalFeatSys, "ŋ", "cons+", "voc-", "velar", "vd+", "cont-", "nasal+");
            AddSegDef(Table2, phonologicalFeatSys, "s", "cons+", "voc-", "alveolar", "vd-", "asp-", "del_rel-",
                      "strident+", "cont+");
            AddSegDef(Table2, phonologicalFeatSys, "z", "cons+", "voc-", "alveolar", "vd+", "asp-", "del_rel-",
                      "strident+", "cont+");
            AddSegDef(Table2, phonologicalFeatSys, "f", "cons+", "voc-", "labiodental", "vd-", "asp-", "strident+",
                      "cont+");
            AddSegDef(Table2, phonologicalFeatSys, "v", "cons+", "voc-", "labiodental", "vd+", "asp-", "strident+",
                      "cont+");
            AddBdryDef(Table2, "+");
            AddBdryDef(Table2, "#");
            AddBdryDef(Table2, "!");
            AddBdryDef(Table2, ".");
            AddBdryDef(Table2, "$");

            Table3 = new CharacterDefinitionTable()
            {
                Name = "table3"
            };
            AddSegDef(Table3, phonologicalFeatSys, "a", "cons-", "voc+", "high-", "low+", "back+", "round-", "vd+",
                      "ATR+", "cont+");
            AddSegDef(Table3, phonologicalFeatSys, "a̘", "cons-", "voc+", "high-", "low+", "back+", "round-", "vd+",
                      "ATR-", "cont+");
            AddSegDef(Table3, phonologicalFeatSys, "i", "cons-", "voc+", "high+", "low-", "back-", "round-", "vd+",
                      "cont+");
            AddSegDef(Table3, phonologicalFeatSys, "u", "cons-", "voc+", "high+", "low-", "back+", "round+", "vd+",
                      "cont+");
            AddSegDef(Table3, phonologicalFeatSys, "y", "cons-", "voc+", "high+", "low-", "back-", "round+", "vd+",
                      "cont+");
            AddSegDef(Table3, phonologicalFeatSys, "ɯ", "cons-", "voc+", "high+", "low-", "back+", "round-", "vd+",
                      "cont+");
            AddSegDef(Table3, phonologicalFeatSys, "o", "cons-", "voc+", "high-", "low-", "back+", "round+", "vd+",
                      "cont+");
            AddSegDef(Table3, phonologicalFeatSys, "p", "cons+", "voc-", "bilabial", "vd-", "cont-", "nasal-");
            AddSegDef(Table3, phonologicalFeatSys, "t", "cons+", "voc-", "alveolar", "vd-", "del_rel-", "strident-",
                      "cont-", "nasal-");
            AddSegDef(Table3, phonologicalFeatSys, "k", "cons+", "voc-", "velar", "vd-", "cont-", "nasal-");
            AddSegDef(Table3, phonologicalFeatSys, "ts", "cons+", "voc-", "alveolar", "vd-", "del_rel+", "strident+",
                      "cont-", "nasal-");
            AddSegDef(Table3, phonologicalFeatSys, "b", "cons+", "voc-", "bilabial", "vd+", "cont-", "nasal-");
            AddSegDef(Table3, phonologicalFeatSys, "d", "cons+", "voc-", "alveolar", "vd+", "strident-", "cont-",
                      "nasal-");
            AddSegDef(Table3, phonologicalFeatSys, "g", "cons+", "voc-", "velar", "vd+", "cont-", "nasal-");
            AddSegDef(Table3, phonologicalFeatSys, "m", "cons+", "voc-", "bilabial", "vd+", "cont-", "nasal+");
            AddSegDef(Table3, phonologicalFeatSys, "n", "cons+", "voc-", "alveolar", "vd+", "strident-", "cont-",
                      "nasal+");
            AddSegDef(Table3, phonologicalFeatSys, "ŋ", "cons+", "voc-", "velar", "vd+", "cont-", "nasal+");
            AddSegDef(Table3, phonologicalFeatSys, "s", "cons+", "voc-", "alveolar", "vd-", "asp-", "del_rel-",
                      "strident+", "cont+");
            AddSegDef(Table3, phonologicalFeatSys, "z", "cons+", "voc-", "alveolar", "vd+", "asp-", "del_rel-",
                      "strident+", "cont+");
            AddSegDef(Table3, phonologicalFeatSys, "f", "cons+", "voc-", "labiodental", "vd-", "asp-", "strident+",
                      "cont+");
            AddSegDef(Table3, phonologicalFeatSys, "v", "cons+", "voc-", "labiodental", "vd+", "asp-", "strident+",
                      "cont+");
            AddBdryDef(Table3, "+");
            AddBdryDef(Table3, "#");
            AddBdryDef(Table3, "!");
            AddBdryDef(Table3, ".");

            Latinate = new MprFeature {
                Name = "latinate"
            };
            Germanic = new MprFeature {
                Name = "germanic"
            };

            Morphophonemic = new Stratum(Table3)
            {
                Name = "Morphophonemic",
                MorphologicalRuleOrder = MorphologicalRuleOrder.Unordered
            };
            Allophonic = new Stratum(Table1)
            {
                Name = "Allophonic",
                MorphologicalRuleOrder = MorphologicalRuleOrder.Unordered
            };
            Surface = new Stratum(Table1)
            {
                Name = "Surface",
                MorphologicalRuleOrder = MorphologicalRuleOrder.Unordered
            };

            Entries = new Dictionary <string, LexEntry>();
            var fs = FeatureStruct.New(syntacticFeatSys)
                     .Symbol("N")
                     .Feature(Head).EqualTo(head => head
                                            .Symbol("foo+").Symbol("baz-"))
                     .Feature(Foot).EqualTo(foot => foot
                                            .Symbol("fum-").Symbol("bar+")).Value;

            AddEntry("1", fs, Allophonic, "pʰit");
            fs = FeatureStruct.New(syntacticFeatSys)
                 .Symbol("N")
                 .Feature(Head).EqualTo(head => head
                                        .Symbol("foo+").Symbol("baz-"))
                 .Feature(Foot).EqualTo(foot => foot
                                        .Symbol("fum-").Symbol("bar+")).Value;
            AddEntry("2", fs, Allophonic, "pit");

            AddEntry("5", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "pʰut");
            AddEntry("6", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "kʰat");
            AddEntry("7", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "kʰut");

            AddEntry("8", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "dat");
            AddEntry("9", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Allophonic, "dat");

            AddEntry("10", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "ga̘p");
            AddEntry("11", FeatureStruct.New(syntacticFeatSys).Symbol("A").Value, Morphophonemic, "gab");
            AddEntry("12", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Morphophonemic, "ga+b");

            AddEntry("13", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "bubabu");
            AddEntry("14", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "bubabi");
            AddEntry("15", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "bɯbabu");
            AddEntry("16", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "bibabi");
            AddEntry("17", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "bubi");
            AddEntry("18", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "bibu");
            AddEntry("19", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Morphophonemic, "b+ubu");
            AddEntry("20", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "bubababi");
            AddEntry("21", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "bibababu");
            AddEntry("22", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "bubabababi");
            AddEntry("23", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "bibabababu");
            AddEntry("24", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "bubui");
            AddEntry("25", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "buibu");
            AddEntry("26", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "buibui");
            AddEntry("27", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "buiibuii");
            AddEntry("28", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "buitibuiti");
            AddEntry("29", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "iibubu");

            AddEntry("30", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Morphophonemic, "bu+ib");
            AddEntry("31", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Morphophonemic, "buib");

            AddEntry("32", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "sag");
            AddEntry("33", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "sas");
            AddEntry("34", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "saz");
            AddEntry("35", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "sat");
            AddEntry("36", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "sasibo");
            AddEntry("37", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "sasibut");
            AddEntry("38", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "sasibud");

            AddEntry("39", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "ab+ba");
            AddEntry("40", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "abba");

            AddEntry("41", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Allophonic, "pip");
            AddEntry("42", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "bubibi");
            AddEntry("43", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "bubibu");

            AddEntry("44", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "gigigi");

            AddEntry("45", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "nbinding");

            AddEntry("46", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "bupu");

            AddEntry("47", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "tag");
            AddEntry("48", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "pag");
            AddEntry("49", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "ktb");
            AddEntry("50", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Allophonic, "suupu");
            AddEntry("51", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Morphophonemic, "miu");
            AddEntry("52", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Morphophonemic, "pu");
            AddEntry("53", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Morphophonemic, "mi");
            AddEntry("54", FeatureStruct.New().Value, Morphophonemic, "pi");
            AddEntry("55", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Morphophonemic, "mim+ɯɯ");

            fs = FeatureStruct.New(syntacticFeatSys)
                 .Symbol("V")
                 .Feature(Head).EqualTo(head => head
                                        .Feature("num").EqualTo("pl")).Value;
            AddEntry("Perc0", fs, Morphophonemic, "ssag");
            fs = FeatureStruct.New(syntacticFeatSys)
                 .Symbol("V")
                 .Feature(Head).EqualTo(head => head
                                        .Feature("pers").EqualTo("1")
                                        .Feature("num").EqualTo("pl")).Value;
            AddEntry("Perc1", fs, Morphophonemic, "ssag");
            fs = FeatureStruct.New(syntacticFeatSys)
                 .Symbol("V")
                 .Feature(Head).EqualTo(head => head
                                        .Feature("pers").EqualTo("3")
                                        .Feature("num").EqualTo("pl")).Value;
            AddEntry("Perc2", fs, Morphophonemic, "ssag");
            fs = FeatureStruct.New(syntacticFeatSys)
                 .Symbol("V")
                 .Feature(Head).EqualTo(head => head
                                        .Feature("pers").EqualTo("2", "3")
                                        .Feature("num").EqualTo("pl")).Value;
            AddEntry("Perc3", fs, Morphophonemic, "ssag");
            fs = FeatureStruct.New(syntacticFeatSys)
                 .Symbol("V")
                 .Feature(Head).EqualTo(head => head
                                        .Feature("pers").EqualTo("1", "3")
                                        .Feature("num").EqualTo("pl")).Value;
            AddEntry("Perc4", fs, Morphophonemic, "ssag");

            var seeFamily = new LexFamily {
                Name = "SEE"
            };

            seeFamily.Entries.Add(AddEntry("bl1", FeatureStruct.New(syntacticFeatSys)
                                           .Symbol("V").Value, Morphophonemic, "si"));
            fs = FeatureStruct.New(syntacticFeatSys)
                 .Symbol("V")
                 .Feature(Head).EqualTo(head => head
                                        .Feature("tense").EqualTo("past")).Value;
            seeFamily.Entries.Add(AddEntry("bl2", fs, Morphophonemic, "sau"));
            fs = FeatureStruct.New(syntacticFeatSys)
                 .Symbol("V")
                 .Feature(Head).EqualTo(head => head
                                        .Feature("tense").EqualTo("pres")).Value;
            seeFamily.Entries.Add(AddEntry("bl3", fs, Morphophonemic, "sis"));

            LexEntry entry = AddEntry("pos1", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic,
                                      "ba");

            entry.MprFeatures.Add(Latinate);
            entry = AddEntry("pos2", FeatureStruct.New(syntacticFeatSys).Symbol("N").Value, Morphophonemic, "ba");
            entry.MprFeatures.Add(Germanic);

            var vowel = FeatureStruct.New(phonologicalFeatSys).Symbol(HCFeatureSystem.Segment).Symbol("voc+").Value;

            entry = AddEntry("free", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "tap",
                             "taz", "tas");
            entry.Allomorphs[0].Environments.Add(new AllomorphEnvironment(ConstraintType.Require, null,
                                                                          Pattern <Word, ShapeNode> .New().Annotation(vowel).Value));

            entry = AddEntry("disj", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "baz",
                             "bat", "bad", "bas");
            var unroundedVowel = FeatureStruct.New(phonologicalFeatSys)
                                 .Symbol(HCFeatureSystem.Segment)
                                 .Symbol("voc+")
                                 .Symbol("round-").Value;

            entry.Allomorphs[0].Environments.Add(new AllomorphEnvironment(ConstraintType.Require, null,
                                                                          Pattern <Word, ShapeNode> .New().Annotation(unroundedVowel).Value));
            entry.Allomorphs[1].Environments.Add(new AllomorphEnvironment(ConstraintType.Require, null,
                                                                          Pattern <Word, ShapeNode> .New().Annotation(vowel).Value));
            entry.Allomorphs[2].Environments.Add(new AllomorphEnvironment(ConstraintType.Require, null,
                                                                          Pattern <Word, ShapeNode> .New().Annotation(vowel).Value));

            entry = AddEntry("stemname", FeatureStruct.New(syntacticFeatSys)
                             .Symbol("V")
                             .Feature(Head).EqualTo(head => head.Feature("tense").EqualTo("pres")).Value,
                             Morphophonemic, "san", "sad", "sap");
            entry.Allomorphs[1].StemName = new StemName(
                FeatureStruct.New(syntacticFeatSys)
                .Symbol("V")
                .Feature(Head).EqualTo(head => head
                                       .Feature("pers").EqualTo("1")).Value,
                FeatureStruct.New(syntacticFeatSys)
                .Symbol("V")
                .Feature(Head).EqualTo(head => head
                                       .Feature("pers").EqualTo("2")).Value)
            {
                Name = "sn1"
            };
            entry.Allomorphs[2].StemName = new StemName(
                FeatureStruct.New(syntacticFeatSys)
                .Symbol("V")
                .Feature(Head).EqualTo(head => head
                                       .Feature("pers").EqualTo("1")).Value,
                FeatureStruct.New(syntacticFeatSys)
                .Symbol("V")
                .Feature(Head).EqualTo(head => head
                                       .Feature("pers").EqualTo("3")).Value)
            {
                Name = "sn2"
            };


            AddEntry("synfs", FeatureStruct.New(syntacticFeatSys)
                     .Symbol("V")
                     .Feature(Head).EqualTo(head => head.Feature("tense").EqualTo("pres")).Value, Morphophonemic, "bag");

            entry = AddEntry("bound", FeatureStruct.New(syntacticFeatSys).Symbol("V").Value, Morphophonemic, "dag");
            entry.PrimaryAllomorph.IsBound = true;

            Language = new Language
            {
                Name = "Test",
                PhonologicalFeatureSystem = phonologicalFeatSys,
                SyntacticFeatureSystem    = syntacticFeatSys,
                Strata = { Morphophonemic, Allophonic, Surface }
            };
        }