debug word initial environment rules

This commit is contained in:
Sorrel Bri 2020-02-19 18:50:59 -08:00
parent 42f0b179c8
commit 162b6b8cfc
3 changed files with 16 additions and 4 deletions

View file

@ -14,7 +14,7 @@ export const initState = (changesArgument: number): stateType => {
'[+ occlusive - nasal]>[+ occlusive + nasal]/n_.', '[+ occlusive - nasal]>[+ occlusive + nasal]/n_.',
'a>ɯ/._#', 'a>ɯ/._#',
'[+ sonorant - low rounded high back]>0/._.', '[+ sonorant - low rounded high back]>0/._.',
// '[+ nasal][+ obstruent]>[+ nasal obstruent aspirated ]/#_.', '[+ obstruent]>[+ obstruent aspirated ]/#_.',
// 'nn>nun/._.', // 'nn>nun/._.',
// '[+ sonorant rounded]>[+ sonorant - rounded]/._#' // '[+ sonorant rounded]>[+ sonorant - rounded]/._#'
] ]
@ -74,8 +74,8 @@ export const initState = (changesArgument: number): stateType => {
occlusive: { positive:[ state.phones.t, state.phones.n, state.phones.t.ʰ ], negative: [] }, occlusive: { positive:[ state.phones.t, state.phones.n, state.phones.t.ʰ ], negative: [] },
coronal: { positive:[ state.phones.t, state.phones.n, state.phones.t.ʰ ], negative: [] }, coronal: { positive:[ state.phones.t, state.phones.n, state.phones.t.ʰ ], negative: [] },
obstruent: { positive:[ state.phones.t, state.phones.n, state.phones.t.ʰ ], negative: [] }, obstruent: { positive:[ state.phones.t, state.phones.n, state.phones.t.ʰ ], negative: [] },
nasal: { positive:[ state.phones.n ], negative: [] }, nasal: { positive:[ state.phones.n ], negative: [state.phones.t, state.phones.t.ʰ] },
aspirated: { positive:[ state.phones.t.ʰ ], negative: [] }, aspirated: { positive:[ state.phones.t.ʰ ], negative: [ state.phones.t ] },
} }
state.lexicon = [ state.lexicon = [
{lexeme: 'anta', epoch: state.epochs[0]}, {lexeme: 'anta', epoch: state.epochs[0]},

View file

@ -214,7 +214,6 @@ export const run = (state: stateType, action: resultsAction): stateType => {
const lexiconBundle = formBundleFromLexicon(lexicon)(phones); const lexiconBundle = formBundleFromLexicon(lexicon)(phones);
const passResults = transformLexicon(lexiconBundle)(ruleBundle)(features); const passResults = transformLexicon(lexiconBundle)(ruleBundle)(features);
const stringifiedPassResults = passResults.map(stringifyResults); const stringifiedPassResults = passResults.map(stringifyResults);
console.log(passResults)
const pass = { const pass = {
pass: epoch.name, pass: epoch.name,
lexicon: stringifiedPassResults lexicon: stringifiedPassResults

View file

@ -125,6 +125,19 @@ describe('Results', () => {
]); ]);
}); });
it('results returned through fourth sound change rule', () => {
const action = {type: 'RUN'};
state = initState(4)
expect(stateReducer(state, action).results).toEqual([
{
pass: 'epoch 1',
lexicon: [
'annɯ', 'anat', 'ant', 'annɯ', 'tʰan', 'nnɯ'
]
}
]);
});
// if('results returned from sound change suite', () => { // if('results returned from sound change suite', () => {
// const action = {type: 'RUN'}; // const action = {type: 'RUN'};
// state = initState() // state = initState()