Exemplo n.º 1
0
 public void Migrate_NoPrenasalSuperscript_PrenasalSuperscriptAdded()
 {
     Assert.That(_project.Segmenter.Consonants.Contains("ⁿ"), Is.False);
     var pm = new ProjectMigration4();
     pm.Migrate(_segmentPool, _project);
     Assert.That(_project.Segmenter.Consonants.Contains("ⁿ"), Is.True);
 }
Exemplo n.º 2
0
        public void Migrate_ExistingPrenasalSuperscript_PrenasalSuperscriptNotUpdated()
        {
            FeatureStruct fs = FeatureStruct.New(_project.FeatureSystem).Symbol("nasal+").Value;
            _project.Segmenter.Consonants.Add("ⁿ", fs);

            var pm = new ProjectMigration4();
            pm.Migrate(_segmentPool, _project);
            Symbol symbol = _project.Segmenter.Consonants["ⁿ"];
            Assert.That(symbol.FeatureStruct.ValueEquals(fs), Is.True);
        }
Exemplo n.º 3
0
 public void Migrate_NewProjectSspSyllabifier_SspSyllabifierUpdated()
 {
     var pm = new ProjectMigration4();
     pm.Migrate(_segmentPool, _project);
     var syllabifier = (SspSyllabifier) _project.VarietyProcessors[ComponentIdentifiers.Syllabifier];
     SonorityClass[] scale = syllabifier.SonorityScale.ToArray();
     Assert.That(scale.Length, Is.EqualTo(17));
     Assert.That(scale[0].SoundClass.Name, Is.EqualTo("Prenasal"));
     Assert.That(((UnnaturalClass) scale[8].SoundClass).IgnoreModifiers, Is.True);
     Assert.That(((NaturalClass) scale[16].SoundClass).FeatureStruct.ValueEquals(FeatureStruct.New(_project.FeatureSystem)
         .Symbol(CogFeatureSystem.VowelType).Symbol("syllabic+").Symbol("open").Value), Is.True);
 }
Exemplo n.º 4
0
        public void Migrate_ModifiedSspSyllabifier_SspSyllabifierNotUpdated()
        {
            var oldSyllabifier = (SspSyllabifier) _project.VarietyProcessors[ComponentIdentifiers.Syllabifier];
            SonorityClass[] oldScale = oldSyllabifier.SonorityScale.ToArray();
            oldScale[0] = new SonorityClass(1, new NaturalClass("Stop", FeatureStruct.New(_project.FeatureSystem).Symbol(CogFeatureSystem.ConsonantType).Symbol("stop").Value));
            var newSyllabifier = new SspSyllabifier(oldSyllabifier.CombineVowels, oldSyllabifier.CombineConsonants, oldSyllabifier.VowelsSameSonorityTautosyllabic,
                _segmentPool, oldScale);
            _project.VarietyProcessors[ComponentIdentifiers.Syllabifier] = newSyllabifier;

            var pm = new ProjectMigration4();
            pm.Migrate(_segmentPool, _project);
            Assert.That(_project.VarietyProcessors[ComponentIdentifiers.Syllabifier], Is.EqualTo(newSyllabifier));
        }
Exemplo n.º 5
0
        public void Migrate_SimpleSyllabifier_SimpleSyllabifierNotUpdated()
        {
            var syllabifier = new SimpleSyllabifier(true, true);
            _project.VarietyProcessors[ComponentIdentifiers.Syllabifier] = syllabifier;

            var pm = new ProjectMigration4();
            pm.Migrate(_segmentPool, _project);
            Assert.That(_project.VarietyProcessors[ComponentIdentifiers.Syllabifier], Is.EqualTo(syllabifier));
        }
Exemplo n.º 6
0
        public void Migrate_SettingsSspSyllabifier_SspSyllabifierUpdated()
        {
            var oldSyllabifier = (SspSyllabifier) _project.VarietyProcessors[ComponentIdentifiers.Syllabifier];
            SonorityClass[] oldScale = oldSyllabifier.SonorityScale.ToArray();
            oldScale[7] = new SonorityClass(8, new UnnaturalClass("Glide", new[] {"j", "ɥ", "ɰ", "w"}, true, _project.Segmenter));
            oldScale[15] = new SonorityClass(15, new NaturalClass("Open vowel", FeatureStruct.New(_project.FeatureSystem).Symbol(CogFeatureSystem.VowelType).Symbol("open").Symbol("syllabic+").Value));
            var newSyllabifier = new SspSyllabifier(oldSyllabifier.CombineVowels, oldSyllabifier.CombineConsonants, oldSyllabifier.VowelsSameSonorityTautosyllabic,
                _segmentPool, oldScale);
            _project.VarietyProcessors[ComponentIdentifiers.Syllabifier] = newSyllabifier;

            var pm = new ProjectMigration4();
            pm.Migrate(_segmentPool, _project);
            var syllabifier = (SspSyllabifier) _project.VarietyProcessors[ComponentIdentifiers.Syllabifier];
            SonorityClass[] scale = syllabifier.SonorityScale.ToArray();
            Assert.That(scale.Length, Is.EqualTo(17));
            Assert.That(scale[0].SoundClass.Name, Is.EqualTo("Prenasal"));
        }