=e.length-o.length)return[].concat(Object(O.a)(a),[u]);if(!L(e.slice(i-r.length,i),r))return[].concat(Object(O.a)(a),[u]);if(!L([u],c))return[].concat(Object(O.a)(a),[u]);if(!L(e.slice(i,i+o.length),o))return[].concat(Object(O.a)(a),[u]);var s=U(u,t.newFeatures[0],n);return s&&s.grapheme?[].concat(Object(O.a)(a),[s]):Object(O.a)(a)}),[])},V=function(e){return function(t){return e.map((function(e){var n=e.lexeme;return function(e,t){var n=[],a=t.length-1,r={};return Object(O.a)(t).forEach((function(t,o){return o?o===a?r[t]?n.push(r[t]):n.push(r,e[t]):!r[t]&&r.features?(n.push(r),r=e[t]):r[t]?void 0:r=r[t]:r=e[t]})),n}(t,n)}))}},W=function(e){return e.map(C("grapheme")).join("")},X=function(e){var t=e.lexicon,n=Object(w.a)(e,["lexicon"]);return Object(h.a)({},n,{lexicon:t.map(W)})},B=function(e,t){try{var n=e.epochs.reduce((function(t,n,a){var r,o=e.phones,c=e.features,u=e.lexicon;n.parent&&(r=t.find((function(e){return e.pass===n.parent})).lexicon),n.parent||(r=V(u)(o));var i=I(n,o),s=function(e){return function(t){return function(n){return e.map((function(e){return t.reduce((function(e,t,a){return M(e,t,n)}),e)}))}}}(r)(i)(c),l={pass:n.name,lexicon:s};return n.parent&&(l.parent=n.parent),[].concat(Object(O.a)(t),[l])}),[]).map(X);return Object(h.a)({},e,{results:n,errors:{}})}catch(a){return console.log(a),Object(h.a)({},e,{errors:a})}},J=function(e){var t={epochs:[{name:"epoch 1",changes:["[+ occlusive - nasal]>[+ occlusive + nasal]/n_.","a>\u026f/._#","[+ sonorant - low rounded high back]>0/._.","[+ obstruent]>[+ obstruent aspirated ]/#_.","[+ sonorant - rounded]>[+ sonorant + rounded]/._#"]}],phones:{a:{grapheme:"a",features:{sonorant:!0,back:!0,low:!0,high:!1,rounded:!1}},u:{grapheme:"u",features:{sonorant:!0,back:!0,low:!1,high:!0,rounded:!0}},"\u026f":{grapheme:"\u026f",features:{sonorant:!0,back:!0,low:!1,high:!0,rounded:!1}},"\u0259":{grapheme:"\u0259",features:{sonorant:!0,low:!1,rounded:!1,high:!1,back:!1}},t:{grapheme:"t",features:{occlusive:!0,coronal:!0,obstruent:!0,nasal:!1},"\u02b0":{grapheme:"t\u02b0",features:{occlusive:!0,coronal:!0,obstruent:!0,aspirated:!0}}},n:{grapheme:"n",features:{sonorant:!0,nasal:!0,occlusive:!0,coronal:!0}}},options:{output:"default",save:!1},results:[],errors:{},features:{},lexicon:[]};return t.features={sonorant:{positive:[t.phones.a,t.phones.u,t.phones.\u026f,t.phones.\u0259,t.phones.n],negative:[]},back:{positive:[t.phones.a,t.phones.u,t.phones.\u026f],negative:[t.phones.\u0259]},low:{positive:[t.phones.a],negative:[t.phones.u,t.phones.\u026f,t.phones.\u0259]},high:{positive:[t.phones.u,t.phones.\u026f],negative:[t.phones.a,t.phones.\u0259]},rounded:{positive:[t.phones.u],negative:[t.phones.a,t.phones.\u026f,t.phones.\u0259]},occlusive:{positive:[t.phones.t,t.phones.n,t.phones.t.\u02b0],negative:[]},coronal:{positive:[t.phones.t,t.phones.n,t.phones.t.\u02b0],negative:[]},obstruent:{positive:[t.phones.t,t.phones.n,t.phones.t.\u02b0],negative:[]},nasal:{positive:[t.phones.n],negative:[t.phones.t,t.phones.t.\u02b0]},aspirated:{positive:[t.phones.t.\u02b0],negative:[t.phones.t]}},t.lexicon=[{lexeme:"anta",epoch:t.epochs[0]},{lexeme:"anat",epoch:t.epochs[0]},{lexeme:"an\u0259t",epoch:t.epochs[0]},{lexeme:"anna",epoch:t.epochs[0]},{lexeme:"tan",epoch:t.epochs[0]},{lexeme:"\u0259nta",epoch:t.epochs[0]}],e>-1&&(t.epochs[0].changes=t.epochs[0].changes.splice(0,e)),t},$=function(e,t){switch(t.type){case"INIT":return J();case"ADD_LEXEME":return function(e,t){var n=j(t.value.lexeme,t.value.epoch,e);return Object(h.a)({},e,{lexicon:[].concat(Object(O.a)(e.lexicon),[n])})}(e,t);case"SET_LEXICON":return function(e,t){var n=t.value;return n=n.map((function(t){return j(t.lexeme,t.epoch,e)})),Object(h.a)({},e,{lexicon:n})}(e,t);case"ADD_EPOCH":return function(e,t){var n={name:t.value.name,changes:t.value.changes||[""],parent:null};return Object(h.a)({},e,{epochs:[].concat(Object(O.a)(e.epochs),[n])})}(e,t);case"SET_EPOCH":return function(e,t){var n=t.value.index;if("number"!==typeof n)return e;var a=e.epochs;return a[n].name=t.value.name?t.value.name:a[n].name,a[n].changes=t.value.changes?t.value.changes:a[n].changes,a[n].parent=t.value.parent&&"none"!==t.value.parent?t.value.parent:null,Object(h.a)({},e,{epochs:Object(O.a)(a)})}(e,t);case"REMOVE_EPOCH":return function(e,t){var n=e.epochs.filter((function(e){return e.name!==t.value.name}));return Object(h.a)({},e,{epochs:Object(O.a)(n)})}(e,t);case"ADD_FEATURE":return function(e,t){var n=t.value.positivePhones||[],a=t.value.negativePhones||[],r=t.value.feature,o=[].concat(Object(O.a)(n),Object(O.a)(a)).reduce((function(e,t){return function(e,t){var n={};return t.split("").forEach((function(a,r){r&&(n[a]={}),r||e[a]||(e[a]={}),n=0===r?e[a]:n[a],r===t.length-1&&(n.grapheme=t)})),e}(e,t)}),e.phones);n&&(n.reduce((function(e,t){return _(e,t,r,!0)}),o),n=n.map((function(e){return x(o,e)}))),a&&(a.reduce((function(e,t){return _(e,t,r,!1)}),o),a=a.map((function(e){return x(o,e)})));var c=Object(s.a)({},t.value.feature,{positive:n,negative:a});return Object(h.a)({},e,{features:Object(h.a)({},e.features,{},c),phones:o})}(e,t);case"SET_OPTIONS":return function(e,t){var n=t.value.option,a=t.value.setValue;"true"===a&&(a=!0),"false"===a&&(a=!1);var r=Object(h.a)({},e);return r.options[n]=a,r}(e,t);case"RUN":return B(e);default:return e}},q=function(){var e=Object(a.useReducer)($,{},J),t=Object(u.a)(e,2),n=t[0],o=t[1],c=n.lexicon,s=n.phones,l=(n.phonemes,n.epochs),p=n.options,h=n.features,f=n.results,g=n.errors;return r.a.createElement("div",{className:"PhonoChangeApplier","data-testid":"PhonoChangeApplier"},r.a.createElement(i,{lexicon:c,dispatch:o}),r.a.createElement(m,{phones:s,features:h,dispatch:o}),r.a.createElement(v,{epochs:l,errors:g,dispatch:o}),r.a.createElement(E,{options:p,dispatch:o}),r.a.createElement(b,{results:f,options:p,dispatch:o}))};var z=function(){return r.a.createElement("div",{className:"App","data-testid":"App"},r.a.createElement("h1",null,"Phono Change Applier"),r.a.createElement(q,null))};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));c.a.render(r.a.createElement(z,null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))}],[[12,1,2]]]);
-//# sourceMappingURL=main.19748fc6.chunk.js.map
\ No newline at end of file
diff --git a/static/js/main.19748fc6.chunk.js.map b/static/js/main.19748fc6.chunk.js.map
deleted file mode 100644
index 9865809..0000000
--- a/static/js/main.19748fc6.chunk.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["components/ProtoLang.js","components/Features.js","components/SoundChangeSuite.js","components/Epochs.js","components/Options.js","components/Output.js","reducers/reducer.lexicon.js","reducers/reducer.features.js","reducers/reducer.results.js","reducers/reducer.init.js","reducers/reducer.js","reducers/reducer.epochs.js","reducers/reducer.options.js","PhonoChangeApplier.js","App.js","serviceWorker.js","index.js"],"names":["ProtoLang","lexicon","dispatch","className","data-testid","name","cols","rows","value","map","property","object","join","renderLexicon","onChange","e","console","log","target","split","line","lexeme","trim","epoch","type","parseNewPhones","somePhones","phone","buildAddFeatureAction","newPositivePhones","newNegativePhones","feature","positivePhones","negativePhones","Features","phones","features","useState","setFeature","setNewPositivePhones","setNewNegativePhones","featureObject","getProperty","featureMap","index","featureName","Object","keys","plus","minus","key","getFeatureMapJSX","plusPhones","positive","minusPhones","negative","getFeatureMap","parsePhonesFromFeatureObject","htmlFor","id","onClick","dispatchFunction","actionBuilder","actionParameters","preventDefault","handleClickDispatch","SoundChangeSuite","props","epochIndex","error","removeEpoch","epochs","changes","parent","setEpoch","changeHandler","cb","updateEpoch","useEffect","renderOptionFromEpoch","thisEpoch","replaceCurrentEpoch","isViableParent","list","filter","change","onSubmit","Epochs","errors","epochName","dispatchValue","renderAddEpochButton","length","addEpoch","epochError","Options","options","load","setLoad","handleRadioChange","option","setValue","handleFormSubmit","checked","output","localStorage","phonoChange","ls","get","priorRun","Output","results","renderDefault","i","pass","renderResults","makeLexeme","state","newLexeme","findIndex","findPhone","reduce","node","graph","addFeatureToPhone","featureKey","featureValue","forEach","errorMessage","location","err","prefix","separator","decomposeRule","rule","match","lintRule","position","newFeatures","environment","pre","post","isUnknownFeatureToken","token","getFeatures","phoneme","featureBoolean","featureMatch","unknownTokens","doesFeatureRuleContainUnknownToken","bool","mapToPositiveAndNegativeFeatures","mapStringToFeatures","ruleString","ruleBrackets","v","featureBundle","lastIndex","push","findFeaturesFromGrapheme","decomposeRules","ruleBundle","mapRuleBundleToFeatureBundle","isEnvironmentBoundByRule","phonemeFeatures","ruleFeatures","ruleFeature","entries","hasOwnProperty","isPhonemeBoundByRule","getEntries","reduceFeatureValues","newPhoneme","newFeature","newValue","transformPhoneme","newPhonemeFeatures","newPhonemeCandidates","transformFeatureValues","candidates","candidatesSubset","array","candidate","includes","isObjectWithPropertyInArray","transformLexeme","lexemeBundle","find","val","slice","grapheme","transformLexemeInitial","transformLexemeCoda","formBundleFromLexicon","findFeaturesFromLexeme","stringifyLexeme","stringifyResults","passResults","run","action","_","lexiconBundle","result","transformLexicon","initState","changesArgument","a","sonorant","back","low","high","rounded","u","ɯ","ə","t","occlusive","coronal","obstruent","nasal","ʰ","aspirated","n","save","splice","stateReducer","addLexeme","newLexicon","setLexicon","newEpoch","mutatedEpochs","newFeatureName","newPhoneObject","phoneObject","addPhones","positivePhone","negativePhone","addFeature","mutatedState","setOptions","PhonoChangeApplier","useReducer","phonemes","App","Boolean","window","hostname","ReactDOM","render","document","getElementById","navigator","serviceWorker","ready","then","registration","unregister"],"mappings":"yZA6CeA,G,YA1CG,SAAC,GAA2B,IAAzBC,EAAwB,EAAxBA,QAASC,EAAe,EAAfA,SAS5B,OACE,yBAAKC,UAAU,YAAYC,cAAY,aACrC,sDACA,6BACA,0BAAMA,cAAY,qBAChB,8BACEC,KAAK,UACLC,KAAK,KACLC,KAAK,KACLH,cAAY,8BACZI,MAjBc,WACpB,OAAKP,EAGEA,EAAQQ,KALGC,EAKa,SALD,SAAAC,GAAM,OAAIA,EAAOD,MAKLE,KAAK,MAH1B,GAFH,IAAAF,EAkBLG,GACPC,SAAU,SAAAC,GACRC,QAAQC,IAAIF,EAAEG,OAAOV,MAAMW,MAAM,MAAMV,KAAI,SAAAW,GAGzC,MAAO,CAAEC,OAFMD,EAAKD,MAAM,KAAK,GAAGG,OAEjBC,MADHH,EAAKD,MAAM,KAAK,IAAM,QAGtCjB,EAAS,CACPsB,KAAM,cACNhB,MAAOO,EAAEG,OAAOV,MAAMW,MAAM,MAAMV,KAAI,SAAAW,GAGpC,MAAO,CAAEC,OAFMD,EAAKD,MAAM,KAAK,GAAGG,OAEjBC,MADHH,EAAKD,MAAM,KAAK,IAAM,gB,OCgB9CM,G,MAAiB,SAAAC,GACrB,MAAmB,KAAfA,EAA0B,CAAC,IACxBA,EAAWP,MAAM,KAAKV,KAAI,SAAAkB,GAAK,OAAIA,EAAML,YAQ5CM,EAAwB,SAAC,GAAD,uBAAEC,EAAF,KAAqBC,EAArB,KAAwCC,EAAxC,WAC5B,CACEP,KAAM,cACNhB,MAAO,CACLwB,eAAgBP,EAAeI,GAC/BI,eAAgBR,EAAeK,GAC/BC,aA6DSG,EAxDE,SAAC,GAAoC,IAAlCC,EAAiC,EAAjCA,OAAQC,EAAyB,EAAzBA,SAAUlC,EAAe,EAAfA,SAAe,EACrBmC,mBAAS,aADY,mBAC5CN,EAD4C,KACnCO,EADmC,OAECD,mBAAS,+BAFV,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AA1EpH,QAASkC,EAAiEkF,EAAjElF,OAAkBoC,GAA+C8C,EAAzD6H,SAAyD7H,EAA/C9C,QAAQyB,EAAuCqB,EAAvCrB,QAAS5D,EAA8BiF,EAA9BjF,SAAU2E,EAAoBM,EAApBN,QAASvB,EAAW6B,EAAX7B,OAEvE,OACE,yBAAKrF,UAAU,qBAAqBC,cAAY,sBAC9C,kBAAC,EAAD,CAAWH,QAASA,EAASC,SAAUA,IACvC,kBAAC,EAAD,CAAUiC,OAAQA,EAAQC,SAAUA,EAAUlC,SAAUA,IACxD,kBAAC,EAAD,CAAQqE,OAAQA,EAAQiB,OAAQA,EAAQtF,SAAUA,IAClD,kBAAC,EAAD,CAAS8F,QAASA,EAAS9F,SAAUA,IACrC,kBAAC,EAAD,CAAQ6G,QAASA,EAASf,QAASA,EAAS9F,SAAUA,MCb7CiP,MATf,WACE,OACE,yBAAKhP,UAAU,MAAMC,cAAY,OAC/B,oDACA,kBAAC,EAAD,QCIcgP,QACW,cAA7BC,OAAOpH,SAASqH,UAEe,UAA7BD,OAAOpH,SAASqH,UAEhBD,OAAOpH,SAASqH,SAAS/G,MACvB,2DCZNgH,IAASC,OAAO,kBAAC,EAAD,MAASC,SAASC,eAAe,SD2H3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAMC,MAAK,SAAAC,GACjCA,EAAaC,kB","file":"static/js/main.19748fc6.chunk.js","sourcesContent":["import React from 'react';\nimport './ProtoLang.scss';\n\nconst ProtoLang = ({ lexicon, dispatch }) => {\n const getProperty = property => object => object[property];\n const renderLexicon = () => {\n if (!lexicon) return '';\n // Code for optionally rendering epoch name with lexeme\n // `\\t#${lexeme.epoch.name}`\n return lexicon.map(getProperty('lexeme')).join('\\n');\n }\n\n return (\n \n
Proto Language Lexicon
\n
\n \n \n );\n}\n\nexport default ProtoLang;","// @flow\nimport React, {useState} from 'react';\nimport './Features.scss';\n\nimport type { featureAction } from '../reducers/reducer.features';\n\nconst parsePhonesFromFeatureObject = featureObject => {\n const getProperty = property => object => object[property]\n \n const getFeatureMap = (featureObject) => {\n return Object.keys(featureObject).map(feature => {\n const plusPhones = featureObject[feature].positive.map(getProperty('grapheme')).join(' / ');\n const minusPhones = featureObject[feature].negative.map(getProperty('grapheme')).join(' / ');\n return {[feature]: {plus: plusPhones, minus: minusPhones}}\n })\n }\n\n const getFeatureMapJSX = (featureMap) => {\n return featureMap.map((feature, index) => {\n const featureName = Object.keys(feature);\n const { plus, minus } = feature[featureName];\n return (\n \n \n \n {`[+ ${featureName}]`}\n \n \n {plus}\n \n \n \n \n {`[- ${featureName}]`}\n \n \n {minus}\n \n \n \n )\n })\n }\n\n const featureMap = getFeatureMap(featureObject);\n const featureMapJSX = getFeatureMapJSX(featureMap);\n return featureMapJSX;\n}\n\nconst parseNewPhones = somePhones => {\n if (somePhones === '') return [''];\n return somePhones.split('/').map(phone => phone.trim());\n}\n\nconst handleClickDispatch = e => dispatchFunction => actionBuilder => actionParameters => {\n e.preventDefault();\n return dispatchFunction(actionBuilder(actionParameters));\n}\n\nconst buildAddFeatureAction = ([newPositivePhones, newNegativePhones, feature]): featureAction => (\n {\n type: \"ADD_FEATURE\",\n value: {\n positivePhones: parseNewPhones(newPositivePhones),\n negativePhones: parseNewPhones(newNegativePhones),\n feature\n }\n }\n)\n\nconst Features = ({ phones, features, dispatch }) => {\n const [feature, setFeature] = useState('aspirated')\n const [ newPositivePhones, setNewPositivePhones ] = useState('tʰ / pʰ / kʰ');\n const [ newNegativePhones, setNewNegativePhones ] = useState('t / p / k');\n \n const newFeaturesSubmit = e => {\n e.preventDefault();\n setFeature('');\n setNewPositivePhones('');\n setNewNegativePhones('');\n }\n\n return (\n \n );\n}\n\nexport default Features;","import React, { useState, useEffect } from 'react';\nimport './SoundChangeSuite.scss';\n\nconst SoundChangeSuite = props => {\n const { epochIndex, error, removeEpoch, epochs } = props;\n const [ epoch, setEpoch ] = useState(props.epoch ? props.epoch : {name:'', changes:[''], parent:'none'});\n \n const changeHandler = (e,cb) => {\n cb(e);\n props.updateEpoch(epoch, epochIndex);\n }\n \n useEffect(() => {\n props.updateEpoch(epoch, epochIndex);\n }, [epoch])\n\n const renderOptionFromEpoch = thisEpoch => (\n \n )\n\n const replaceCurrentEpoch = thisEpoch => {\n if (thisEpoch.name === epoch.name) return {name: 'none'}\n return thisEpoch;\n }\n\n const isViableParent = thisEpoch => {\n if (thisEpoch.parent && thisEpoch.parent === epoch.name) return false;\n return true;\n }\n\n const parentsOptions = () => {\n return epochs.map(replaceCurrentEpoch).filter(isViableParent).map(renderOptionFromEpoch)\n }\n\n const renderParentInput = () => {\n if (epochIndex) return (\n <>\n \n \n >\n )\n return <>>\n }\n\n const renderError = () => {\n if (error) return (\n {error}
\n )\n return <>>\n }\n\n return (\n <>\n {epoch.name}
\n {renderError()}\n \n \n >\n );\n}\n\nexport default SoundChangeSuite;","import React from 'react';\nimport './Epochs.scss';\n\nimport SoundChangeSuite from './SoundChangeSuite';\nimport { render } from 'react-dom';\n\n\n\nconst Epochs = ({epochs, errors, dispatch}) => {\n \n const addEpoch = e => {\n e.preventDefault()\n let index = epochs.length + 1;\n dispatch({\n type: 'ADD_EPOCH',\n value: {name: `Epoch ${index}`}\n })\n }\n\n const removeEpoch = (e, epochName) => {\n e.preventDefault()\n dispatch({\n type: 'REMOVE_EPOCH',\n value: {name: epochName}\n });\n }\n\n const updateEpoch = (epoch, epochIndex) => {\n const dispatchValue = {\n name: epoch.name,\n index: epochIndex,\n changes: epoch.changes,\n parent: epoch.parent\n }\n dispatch({\n type: \"SET_EPOCH\",\n value: dispatchValue\n })\n }\n \n const renderAddEpochButton = index => {\n if (index === epochs.length - 1 ) return (\n \n )\n return <>>\n }\n\n const renderEpochs = () => {\n if (epochs.length) return epochs.map((epoch, index) => {\n const epochError = errors.epoch ? errors.error : null\n return (\n \n \n {renderAddEpochButton(index)}\n
\n )});\n return renderAddEpochButton(-1)\n }\n\n return (\n <>\n { renderEpochs() }\n >\n );\n}\n\nexport default Epochs;","import React, { useState } from 'react';\nimport './Options.scss';\nimport ls from 'local-storage';\n\nconst Options = ({ options, dispatch }) => {\n const [ load, setLoad ] = useState('');\n\n const handleRadioChange = e => {\n const { name, id } = e.target;\n dispatch({\n type: 'SET_OPTIONS',\n value: {\n option: name,\n setValue: id\n }\n });\n }\n \n const handleFormSubmit = (e, options) => {\n e.preventDefault();\n dispatch({\n type: 'RUN',\n value: options\n });\n }\n\n return (\n \n
Modeling Options
\n\n \n\n\n \n \n );\n}\n\nexport default Options;","import React from 'react';\nimport './Output.scss';\n\nconst Output = props => {\n const { results, options, errors } = props;\n const renderResults = () => {\n switch(options.output) {\n case 'default':\n return renderDefault();\n default:\n return <>>\n }\n }\n\n const renderDefault = () => {\n return results.map((epoch, i) => {\n const lexicon = epoch.lexicon.map((lexeme, i) => {lexeme});\n return (\n \n
{epoch.pass}
\n
{lexicon}
\n
\n )\n })\n }\n\n return (\n \n
Results of Run
\n
\n {results && results.length ? renderResults() : <>>}\n
\n
\n );\n}\n\nexport default Output;","// @flow\nimport type { stateType } from './reducer';\n\ntype lexemeType = {\n lexeme: string,\n epoch?: string\n}\n\ntype addLexemeAction = {\n type: 'ADD_LEXEME',\n value: lexemeType\n}\n\ntype setLexiconAction = {\n type: 'SET_LEXICON',\n value: Array\n}\n\nconst makeLexeme = (lexeme: string, epochName: ?string, state: stateType) => {\n const newLexeme = {lexeme: lexeme, epoch: state.epochs[0]};\n if (epochName) {\n const epochIndex = state.epochs.findIndex(epoch => epoch.name === epochName);\n if (epochIndex > 0) {\n newLexeme.epoch = state.epochs[epochIndex];\n };\n }\n return newLexeme;\n}\n\nexport type lexiconAction = addLexemeAction | setLexiconAction\n\nexport const addLexeme = (state: stateType, action: addLexemeAction): stateType => {\n const newLexeme = makeLexeme(action.value.lexeme, action.value.epoch, state);\n return {...state, lexicon:[...state.lexicon, newLexeme]}\n}\n\nexport const setLexicon = (state: stateType, action: setLexiconAction): stateType => {\n let newLexicon = action.value;\n newLexicon = newLexicon.map(lexeme => makeLexeme(lexeme.lexeme, lexeme.epoch, state));\n return {...state, lexicon: newLexicon}\n}","// @flow\nimport type { stateType } from './reducer';\n\nexport type featureAction = {\n type: \"ADD_FEATURE\",\n value: {\n positivePhones: Array,\n negativePhones: Array,\n feature: string\n }\n}\n\nconst addPhones = (phones: {}, phone: string): {} => {\n let node = {};\n\n phone.split('').forEach((graph, index) => {\n if (index) node[graph] = {}\n if (!index && !phones[graph]) phones[graph] = {} \n node = index === 0 ? phones[graph] : node[graph];\n if (index === phone.length - 1) node.grapheme = phone;\n })\n\n return phones;\n}\n\nconst findPhone = (phones: {}, phone: string): {} => {\n return phone\n .split('')\n .reduce((node, graph, index) => {\n node = index === 0 ? phones[graph] : node[graph];\n return node;\n }, {});\n}\n\nconst addFeatureToPhone = (\n phones: {}, phone: string, featureKey: string, featureValue: boolean\n): {} => {\n let node = {}\n phone.split('').forEach((graph, index) => {\n node = index === 0 ? phones[graph] : node[graph];\n \n if (index === phone.split('').length - 1) {\n node.features = {...node.features, [featureKey]: featureValue}\n }\n });\n return phones;\n}\n\nexport const addFeature = (state: stateType, action: featureAction): stateType => {\n let positivePhones = action.value.positivePhones || [];\n let negativePhones = action.value.negativePhones || [];\n let newFeatureName = action.value.feature;\n let newPhoneObject = [\n ...positivePhones, ...negativePhones\n ]\n .reduce((phoneObject, phone) => addPhones(phoneObject, phone), state.phones)\n \n if (positivePhones) {\n\n positivePhones.reduce(\n (phoneObject, positivePhone) => addFeatureToPhone(phoneObject, positivePhone, newFeatureName, true)\n , newPhoneObject\n );\n\n positivePhones = positivePhones.map( positivePhone => findPhone(newPhoneObject, positivePhone) )\n }\n \n if (negativePhones) {\n \n negativePhones.reduce(\n (phoneObject, positivePhone) => addFeatureToPhone(phoneObject, positivePhone, newFeatureName, false)\n , newPhoneObject\n );\n \n negativePhones = negativePhones.map( negativePhone => findPhone(newPhoneObject, negativePhone) )\n }\n \n let newFeature = {[action.value.feature]: {positive: positivePhones, negative: negativePhones}};\n return {...state, features:{...state.features, ...newFeature}, phones: newPhoneObject}\n}","// @flow\nimport type { stateType, epochType, phoneType } from './reducer';\n\nexport type resultsAction = {\n type: 'RUN'\n}\n\nexport type decomposedRulesType = [\n {\n environment: {\n pre: [{[key: string]: boolean}],\n position: [{[key: string]: boolean}],\n post: [{[key: string]: boolean}]\n },\n newFeatures: [{[key: string]: boolean}]\n }\n]\n\ntype ruleBundle = {\n environment: {\n pre: string,\n position: string,\n post: string\n },\n newFeatures: string\n}\n\nconst getProperty = property => object => object[property]\n\nconst findFeaturesFromLexeme = (phones: {}, lexeme:string): [] => {\n let featureBundle = []\n let lastIndex = lexeme.length - 1;\n let node = {};\n [...lexeme].forEach((graph, index) => {\n if (!index) return node = phones[graph]\n if (index === lastIndex) return node[graph] \n ? featureBundle.push(node[graph])\n : featureBundle.push(node, phones[graph])\n if (!node[graph] && node.features) {\n featureBundle.push(node)\n return node = phones[graph]\n }\n if (!node[graph])\n return node = node[graph]\n })\n return featureBundle;\n}\n\nconst findFeaturesFromGrapheme = (phones: {}, lexeme:string): [] => {\n let featureBundle = []\n let lastIndex = lexeme.length - 1;\n let node = {};\n [...lexeme].forEach((graph, index) => {\n if (!index && !lastIndex) featureBundle.push(phones[graph].features)\n if (!index) return node = phones[graph]\n if (index === lastIndex) return node[graph] \n ? featureBundle.push(node[graph])\n : featureBundle.push(node, phones[graph])\n if (!node[graph] && node.features) {\n featureBundle.push(node)\n return node = phones[graph]\n }\n if (!node[graph])\n return node = node[graph]\n })\n return featureBundle;\n}\n\nconst errorMessage = ([prefix, separator], location, err) => `${prefix}${location}${separator}${err}`\n\nconst lintRule = (rule) => {\n if (!rule.match(/>/g)) throw `Insert '>' operator between target and result`\n if (!rule.match(/\\//g)) throw `Insert '/' operator between change and environment`\n if (!rule.match(/_/g)) throw `Insert '_' operator in environment`\n if (rule.match(/>/g).length > 1) throw `Too many '>' operators`\n if (rule.match(/\\//g).length > 1) throw `Too many '/' operators`\n if (rule.match(/_/g).length > 1) throw `Too many '_' operators`\n return rule.split(/>|\\/|_/g);\n}\n\nconst decomposeRule = (rule: string, index: number): ruleBundle => {\n try {\n // splits rule at '>' '/' and '_' substrings resulting in array of length 4\n const [position, newFeatures, pre, post] = lintRule(rule); \n return { environment: { pre, position, post }, newFeatures }\n } catch (err) {\n throw errorMessage`Error in line ${index + 1}: ${err}`;\n }\n}\n\nconst isUnknownFeatureToken = token => token !== '-' && token !== '+' && token !== ']' && token !== '[' && token !== ' ';\n\nconst doesFeatureRuleContainUnknownToken = features => {\n const unknownTokens = features\n .match(/\\W/g)\n .filter(isUnknownFeatureToken)\n if (unknownTokens.length) throw `Unknown token '${unknownTokens[0]}'`;\n return true\n}\n\nconst reduceFeaturesToBoolean = bool => (map, feature) => ({...map, [feature]: bool})\n\nconst getFeatures = (phoneme: string, featureBoolean): {} => {\n try {\n const featureMatch = featureBoolean\n // regEx to pull positive features\n ? /(?=\\+.).*(?<=\\-)|(?=\\+.).*(?!\\-).*(?<=\\])/g \n // regEx to pull negative features\n : /(?=\\-.).*(?<=\\+)|(?=\\-.).*(?!\\+).*(?<=\\])/g\n const [ features ] = phoneme.match(featureMatch) || [ null ];\n if (features) {\n doesFeatureRuleContainUnknownToken(features)\n return features\n .trim()\n .match(/\\w+/g)\n .reduce(reduceFeaturesToBoolean(featureBoolean), {})\n }\n return {}\n } catch (err) {\n throw err;\n }\n}\n\nconst mapToPositiveAndNegativeFeatures = phoneme => (\n { ...getFeatures(phoneme, true), ...getFeatures(phoneme, false) } )\n\nconst mapStringToFeatures = (ruleString, phones) => {\n if (ruleString) {\n if (ruleString === '.') return [];\n if (ruleString === '#') return ['#']\n if (ruleString === '0') return [];\n const ruleBrackets = ruleString.match(/\\[.*\\]/)\n try {\n if (ruleBrackets) {\n return ruleString\n .split('[')\n // filter out empty strings\n .filter(v => v)\n .map(mapToPositiveAndNegativeFeatures)\n }\n return findFeaturesFromGrapheme(phones, ruleString);\n } catch (err) {\n throw err;\n }\n }\n return {};\n}\n\nconst mapRuleBundleToFeatureBundle = phones => ( ruleBundle, index ) => {\n // for each object in ruleBundle, map values to array of objects with feature-boolean key-value pairs\n try {\n const { newFeatures, environment:{ pre, position, post } } = ruleBundle;\n return {\n environment: {\n pre: mapStringToFeatures(pre, phones),\n position: mapStringToFeatures(position, phones),\n post: mapStringToFeatures(post, phones),\n },\n newFeatures: mapStringToFeatures(newFeatures, phones)\n }\n } catch (err) {\n throw errorMessage`Error in line ${index + 1}: ${err}`;\n }\n}\n\nexport const decomposeRules = (epoch: epochType, phones: {[key: string]: phoneType}): decomposedRulesType => {\n const { changes } = epoch\n try {\n return changes\n .map(decomposeRule)\n .map(mapRuleBundleToFeatureBundle(phones));\n } catch (err) {\n const ruleError = {epoch: epoch.name, error: err}\n throw ruleError;\n }\n}\n\nconst isPhonemeBoundByRule = phonemeFeatures => (ruleFeature, index) => {\n const phoneme = phonemeFeatures[index].features;\n return Object.entries(ruleFeature).reduce((bool, [feature, value]) => {\n if (!bool) return false;\n if (!phoneme.hasOwnProperty(feature)) return false;\n if (!phoneme[feature] && !value) return true;\n if (phoneme[feature] !== value) return false;\n return true;\n }, true);\n} \n\nconst isEnvironmentBoundByRule = (phonemeFeatures, ruleFeatures) => {\n if (!ruleFeatures) return true;\n return ruleFeatures.filter(isPhonemeBoundByRule(phonemeFeatures)).length === ruleFeatures.length;\n}\n\nconst getEntries = object => Object.entries(object);\nconst isObjectWithPropertyInArray = (array, property) => candidate => array.map(getProperty(property)).includes(candidate[property]);\nconst transformFeatureValues = features => ([newFeature, newValue]) => features[newFeature][newValue ? 'positive': 'negative'];\nconst reduceFeatureValues = (newPhoneme, [newFeature, newValue]) => ({ ...newPhoneme, [newFeature]: newValue })\n\nconst transformPhoneme = (phoneme, newFeatures, features) => {\n if (!newFeatures) return {}\n const newPhonemeFeatures = getEntries(newFeatures).reduce(reduceFeatureValues, {...phoneme.features});\n const newPhonemeCandidates = getEntries(newPhonemeFeatures).map(transformFeatureValues(features));\n return newPhonemeCandidates\n .reduce((candidates, candidatesSubset, index, array) => candidates.filter(isObjectWithPropertyInArray(candidatesSubset, 'grapheme'))\n , newPhonemeCandidates[newPhonemeCandidates.length - 1])[0];\n}\n\nconst transformLexemeInitial = (newLexeme, pre, post, position, phoneme, index, lexemeBundle, newFeatures, features) => {\n if (index !== pre.length - 1) return [...newLexeme, phoneme];\n if (!isEnvironmentBoundByRule([phoneme], position)) return [...newLexeme, phoneme];\n if (!isEnvironmentBoundByRule(lexemeBundle.slice(index + position.length, index + post.length + position.length), post)) return [...newLexeme, phoneme];\n const newPhoneme = transformPhoneme(phoneme, newFeatures[0], features);\n // if deletion occurs\n if (!newPhoneme.grapheme) return [ ...newLexeme] ;\n return [...newLexeme, newPhoneme];\n}\n\nconst transformLexemeCoda = (newLexeme, pre, post, position, phoneme, index, lexemeBundle, newFeatures, features) => {\n if (index + post.length !== lexemeBundle.length) return [...newLexeme, phoneme];\n if (!isEnvironmentBoundByRule(lexemeBundle.slice(index - pre.length, index), pre)) return [...newLexeme, phoneme];\n if (!isEnvironmentBoundByRule([phoneme], position)) return [...newLexeme, phoneme];\n const newPhoneme = transformPhoneme(phoneme, newFeatures[0], features);\n // if deletion occurs\n if (!newPhoneme.grapheme) return [ ...newLexeme] ;\n return [...newLexeme, newPhoneme];\n}\n\nexport const transformLexeme = (lexemeBundle, rule, features) => {\n const {pre, post, position} = rule.environment;\n const newLexeme = lexemeBundle.reduce((newLexeme, phoneme, index) => {\n if (pre.find(val => val === '#')) return transformLexemeInitial(newLexeme, pre, post, position, phoneme, index, lexemeBundle, rule.newFeatures, features);\n if (post.find(val => val === '#')) return transformLexemeCoda(newLexeme, pre, post, position, phoneme, index, lexemeBundle, rule.newFeatures, features);\n if ( index < pre.length || index >= lexemeBundle.length - post.length ) return [...newLexeme, phoneme];\n if (!isEnvironmentBoundByRule(lexemeBundle.slice(index - pre.length, index), pre)) return [...newLexeme, phoneme];\n if (!isEnvironmentBoundByRule([phoneme], position)) return [...newLexeme, phoneme];\n if (!isEnvironmentBoundByRule(lexemeBundle.slice(index, index + post.length), post)) return [...newLexeme, phoneme];\n const newPhoneme = transformPhoneme(phoneme, rule.newFeatures[0], features);\n // if deletion occurs\n if (!newPhoneme || !newPhoneme.grapheme) return [ ...newLexeme] ;\n return [...newLexeme, newPhoneme];\n }, [])\n return newLexeme;\n}\n\nconst formBundleFromLexicon = lexicon => phones => lexicon.map(({lexeme}) => findFeaturesFromLexeme(phones, lexeme))\n\nconst transformLexicon = lexiconBundle => \n ruleBundle => \n features => \n lexiconBundle.map(lexemeBundle => ruleBundle.reduce(\n (lexeme, rule, i) => transformLexeme(lexeme, rule, features)\n , lexemeBundle\n ))\n\nconst getGraphemeFromEntry = ([_, phoneme]) => phoneme.grapheme\nconst stringifyLexeme = (lexeme) => lexeme.map(getProperty('grapheme')).join('')\nconst stringifyResults = ({lexicon, ...passResults}) => ({...passResults, lexicon: lexicon.map(stringifyLexeme)})\n\nexport const run = (state: stateType, action: resultsAction): stateType => {\n\n // TODO iterate through each epoch\n try {\n const passResults = state.epochs.reduce((results, epoch, _) => {\n const { phones, features, lexicon } = state;\n let lexiconBundle;\n if ( epoch.parent ) {\n lexiconBundle = results.find(result => result.pass === epoch.parent).lexicon\n }\n if (!epoch.parent) {\n lexiconBundle = formBundleFromLexicon(lexicon)(phones); \n }\n const ruleBundle = decomposeRules(epoch, phones);\n const passResults = transformLexicon(lexiconBundle)(ruleBundle)(features)\n const pass = { pass: epoch.name, lexicon: passResults }\n if ( epoch.parent ) pass.parent = epoch.parent;\n return [...results, pass];\n }, []);\n \n const results = passResults.map(stringifyResults);\n return {...state, results, errors: {} }\n } catch (err) {\n console.log(err)\n return {...state, errors: err };\n }\n}","// @flow\nimport type { stateType } from './reducer';\n\nexport type initAction = {\n type: \"INIT\"\n}\n\nexport const initState = (changesArgument: number): stateType => {\n const state = {\n epochs: [\n {\n name: 'epoch 1',\n changes: [\n '[+ occlusive - nasal]>[+ occlusive + nasal]/n_.',\n 'a>ɯ/._#',\n '[+ sonorant - low rounded high back]>0/._.',\n '[+ obstruent]>[+ obstruent aspirated ]/#_.',\n '[+ sonorant - rounded]>[+ sonorant + rounded]/._#',\n // 'at>ta/._#'\n ]\n }\n ],\n phones: {\n a: {\n grapheme: 'a', features: {\n sonorant: true, back: true, low: true, high: false, rounded: false\n }\n },\n u: {\n grapheme: 'u', features: {\n sonorant: true, back: true, low: false, high: true, rounded: true, \n }\n },\n ɯ: {\n grapheme: 'ɯ', features: {\n sonorant: true, back: true, low: false, high: true, rounded: false,\n }\n },\n ə: {\n grapheme: 'ə', features: {\n sonorant: true, low: false, rounded: false, high: false, back: false\n }\n },\n t: {\n grapheme: 't', features: {\n occlusive: true, coronal: true, obstruent: true, nasal: false\n },\n ʰ: {\n grapheme: 'tʰ', features: {\n occlusive: true, coronal: true, obstruent: true, aspirated: true\n }\n }\n },\n n: {\n grapheme: 'n', features: {\n sonorant: true, nasal: true, occlusive: true, coronal: true\n }\n }\n },\n options: {\n output: 'default', save: false\n },\n results: [],\n errors: {},\n features: {},\n lexicon: []\n };\n state.features = {\n sonorant: { positive:[ state.phones.a, state.phones.u, state.phones.ɯ, state.phones.ə, state.phones.n], negative: [] },\n back: { positive:[ state.phones.a, state.phones.u, state.phones.ɯ ], negative: [ state.phones.ə ] },\n low: { positive:[ state.phones.a ], negative: [ state.phones.u, state.phones.ɯ, state.phones.ə ] },\n high: { positive:[ state.phones.u, state.phones.ɯ ], negative: [ state.phones.a, state.phones.ə ] },\n rounded: { positive:[ state.phones.u ], negative: [ state.phones.a, state.phones.ɯ, state.phones.ə ] },\n occlusive: { positive:[ state.phones.t, state.phones.n, state.phones.t.ʰ ], negative: [] },\n coronal: { positive:[ state.phones.t, state.phones.n, state.phones.t.ʰ ], negative: [] },\n obstruent: { positive:[ state.phones.t, state.phones.n, state.phones.t.ʰ ], negative: [] },\n nasal: { positive:[ state.phones.n ], negative: [state.phones.t, state.phones.t.ʰ] },\n aspirated: { positive:[ state.phones.t.ʰ ], negative: [ state.phones.t ] },\n }\n state.lexicon = [\n {lexeme: 'anta', epoch: state.epochs[0]}, \n {lexeme: 'anat', epoch: state.epochs[0]},\n {lexeme: 'anət', epoch: state.epochs[0]},\n {lexeme: 'anna', epoch: state.epochs[0]}, \n {lexeme: 'tan', epoch: state.epochs[0]},\n {lexeme: 'ənta', epoch: state.epochs[0]}\n ]\n\n if(changesArgument > -1) state.epochs[0].changes = state.epochs[0].changes.splice(0, changesArgument)\n\n return state;\n}","// @flow\nimport { addLexeme, setLexicon } from './reducer.lexicon';\nimport type { lexiconAction } from './reducer.lexicon';\nimport { addEpoch, setEpoch, removeEpoch } from './reducer.epochs';\nimport type { epochAction } from './reducer.epochs';\nimport { addFeature } from './reducer.features';\nimport type { featureAction } from './reducer.features';\nimport type { optionsAction } from './reducer.options';\nimport { setOptions } from './reducer.options';\nimport { run } from './reducer.results';\nimport type { resultsAction } from './reducer.results'\nimport { initState } from './reducer.init';\nimport type { initAction } from './reducer.init';\n\nexport type stateType = {\n lexicon: Array<{lexeme: string, epoch: epochType}>,\n epochs: Array,\n phones: {[key: string]: phoneType},\n options: {output: string, save: boolean},\n results: [],\n errors: {},\n features: featureType\n}\n\ntype epochType = {\n name: string, changes: Array\n}\n\ntype phoneType = {\n grapheme: string,\n features: {[key: string]: boolean}\n}\n\ntype featureType = {\n [key: string]: {[key: string]: Array}\n}\n\ntype actionType = featureAction | epochAction | initAction | resultsAction | lexiconAction\n\nexport const stateReducer = (state: stateType, action: actionType): stateType => {\n switch (action.type) {\n case 'INIT': {\n return initState();\n }\n \n case 'ADD_LEXEME': return addLexeme(state, action);\n \n case 'SET_LEXICON': return setLexicon(state, action);\n\n case 'ADD_EPOCH': return addEpoch(state, action);\n\n case 'SET_EPOCH': return setEpoch(state, action);\n\n case 'REMOVE_EPOCH': return removeEpoch(state, action);\n\n case 'ADD_FEATURE': return addFeature(state, action);\n\n case 'SET_OPTIONS': return setOptions(state, action);\n\n case 'RUN': return run(state, action);\n\n default: return state;\n }\n}\n","// @flow\nimport type { stateType } from './reducer';\n\nexport type epochAction = {\n type: \"ADD_EPOCH\" | \"SET_EPOCH\" | \"REMOVE_EPOCH\",\n value: {\n index?: number,\n name: string,\n changes?: Array,\n parent?: string\n }\n}\n\nexport const addEpoch = (state: stateType, action: epochAction): stateType => {\n const newEpoch = { name: action.value.name, changes: action.value.changes || [''], parent: null};\n return {...state, epochs: [...state.epochs, newEpoch]}\n}\n\nexport const setEpoch = (state: stateType, action: epochAction): stateType => {\n const index = action.value.index;\n if (typeof index !== 'number') return state;\n \n const mutatedEpochs = state.epochs;\n mutatedEpochs[index].name = action.value.name \n ? action.value.name \n : mutatedEpochs[index].name;\n\n mutatedEpochs[index].changes = action.value.changes \n ? action.value.changes \n : mutatedEpochs[index].changes;\n\n mutatedEpochs[index].parent = action.value.parent && action.value.parent !== 'none'\n ? action.value.parent\n : null\n return {...state, epochs: [...mutatedEpochs]}\n}\n\nexport const removeEpoch = (state: stateType, action: epochAction): stateType => {\n const mutatedEpochs = state.epochs.filter(epoch => epoch.name !== action.value.name )\n return {...state, epochs: [...mutatedEpochs]}\n}","// @flow\nimport type { stateType } from './reducer';\n\nexport type optionAction = {\n type: 'SET_OPTIONS',\n value: {\n option: string,\n setValue: string\n }\n};\n\nexport const setOptions = (state: stateType, action: optionAction): stateType => {\n const option = action.value.option;\n let value = action.value.setValue;\n if (value === 'true') value = true;\n if (value === 'false') value = false;\n const mutatedState = {...state};\n mutatedState.options[option] = value;\n return mutatedState;\n}","import React, { useState, useReducer } from 'react';\nimport './PhonoChangeApplier.scss';\n\nimport ProtoLang from './components/ProtoLang';\nimport Features from './components/Features';\nimport Epochs from './components/Epochs';\nimport Options from './components/Options';\nimport Output from './components/Output';\n\nimport { stateReducer } from './reducers/reducer';\nimport { initState } from './reducers/reducer.init';\n\nconst PhonoChangeApplier = () => {\n const [ state, dispatch ] = useReducer(\n stateReducer,\n {},\n initState\n )\n const { lexicon, phones, phonemes, epochs, options, features, results, errors } = state;\n\n return (\n \n );\n}\n\nexport default PhonoChangeApplier;","import React from 'react';\nimport './App.css';\nimport PhonoChangeApplier from './PhonoChangeApplier';\n\nfunction App() {\n return (\n \n
Phono Change Applier
\n
\n
\n );\n}\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.scss';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/static/js/main.826e9397.chunk.js b/static/js/main.826e9397.chunk.js
new file mode 100644
index 0000000..83f6be9
--- /dev/null
+++ b/static/js/main.826e9397.chunk.js
@@ -0,0 +1,2 @@
+(this["webpackJsonpfeature-change-applier"]=this["webpackJsonpfeature-change-applier"]||[]).push([[0],[,,,,,,,,,,,function(e,t,n){e.exports=n(28)},,,,,function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},,,,function(e,t,n){},function(e,t,n){"use strict";n.r(t);var a=n(0),r=n.n(a),o=n(5),c=n.n(o),u=(n(16),n(17),n(3)),i=(n(18),n(19),function(e){var t=e.lexicon,n=e.dispatch;return r.a.createElement("div",{className:"ProtoLang","data-testid":"ProtoLang"},r.a.createElement("h3",null,"Proto Language Lexicon"),r.a.createElement("br",null),r.a.createElement("form",{"data-testid":"ProtoLang-Lexicon"},r.a.createElement("textarea",{name:"lexicon",cols:"30",rows:"10","data-testid":"ProtoLang-Lexicon__textarea",value:function(){return t?t.map((e="lexeme",function(t){return t[e]})).join("\n"):"";var e}(),onChange:function(e){console.log(e.target.value.split(/\n/).map((function(e){return{lexeme:e.split("#")[0].trim(),epoch:e.split("#")[1]||""}}))),n({type:"SET_LEXICON",value:e.target.value.split(/\n/).map((function(e){return{lexeme:e.split("#")[0].trim(),epoch:e.split("#")[1]||""}}))})}})))}),s=n(4),l=(n(20),function(e){var t=e.phones,n=e.features,o=e.dispatch,c=Object(a.useState)("aspirated"),i=Object(u.a)(c,2),l=i[0],p=i[1],m=Object(a.useState)("t\u02b0 / p\u02b0 / k\u02b0"),h=Object(u.a)(m,2),f=h[0],v=h[1],g=Object(a.useState)("t / p / k"),d=Object(u.a)(g,2),E=d[0],b=d[1],O=function(e){return""===e?[""]:e.split("/").map((function(e){return e.trim()}))},j=function(e){var t=Object(u.a)(e,3),n=t[0],a=t[1],r=t[2];return{type:"ADD_FEATURE",value:{positivePhones:O(n),negativePhones:O(a),feature:r}}};return r.a.createElement("div",{className:"Features","data-testid":"Features"},r.a.createElement("h3",null,"Phonetic Features"),r.a.createElement("ul",{className:"Features__list","data-testid":"Features-list"},t?r.a.createElement(r.a.Fragment,null,function(e){var t=function(e){return function(t){return t[e]}};return function(e){return e.map((function(e,t){var n=Object.keys(e),a=Object(u.a)(n,1)[0],c=e[a],i=c.plus,s=c.minus;return r.a.createElement("li",{key:"feature__".concat(a)},r.a.createElement("span",{className:"feature--names-and-phones"},r.a.createElement("span",{className:"feature--feature-name"},"[+ ".concat(a,"]")),r.a.createElement("span",{className:"feature--feature-phones"},i)),r.a.createElement("span",{className:"feature--names-and-phones"},r.a.createElement("span",{className:"feature--feature-name"},"[- ".concat(a,"]")),r.a.createElement("span",{className:"feature--feature-phones"},s)),r.a.createElement("button",{className:"delete-feature",onClick:function(e){return function(e,t){return e.preventDefault(),o({type:"DELETE_FEATURE",value:t})}(e,a)}},"X"))}))}(function(e){return Object.keys(e).map((function(n){var a=e[n].positive.map(t("grapheme")).join(" / "),r=e[n].negative.map(t("grapheme")).join(" / ");return Object(s.a)({},n,{plus:a,minus:r})}))}(e))}(n)):r.a.createElement(r.a.Fragment,null)),r.a.createElement("form",{className:"Features__form","data-testid":"Features-form"},r.a.createElement("input",{type:"text",name:"feature",value:l,onChange:function(e){return p(e.target.value)}}),r.a.createElement("label",{htmlFor:"positive-phones"},"+",r.a.createElement("input",{id:"positive-phones",type:"text",name:"phonemes",value:f,onChange:function(e){return v(e.target.value)}})),r.a.createElement("label",{htmlFor:"negative-phones"},"-",r.a.createElement("input",{id:"negative-phones",type:"text",name:"phonemes",value:E,onChange:function(e){return b(e.target.value)}})),r.a.createElement("input",{className:"form form--add",type:"submit",onClick:function(e){return function(e){return function(t){return function(n){return function(a){return e.preventDefault(),t(n(a))}}}}(e)(o)(j)([f,E,l])},value:"Add feature"})))}),p=(n(21),n(2)),m=(n(22),function(e){var t=e.epochIndex,n=e.error,o=e.removeEpoch,c=e.epochs,i=Object(a.useState)(e.epoch?e.epoch:{name:"",changes:[""],parent:"none"}),s=Object(u.a)(i,2),l=s[0],m=s[1],h=function(n,a){a(n),e.updateEpoch(l,t)};Object(a.useEffect)((function(){e.updateEpoch(l,t)}),[l]);var f=function(e){return r.a.createElement("option",{key:"".concat(l.name,"__parent-option--").concat(e.name),value:e.name},e.name)},v=function(e){return e.name===l.name?{name:"none"}:e},g=function(e){return!e.parent||e.parent!==l.name};return r.a.createElement(r.a.Fragment,null,r.a.createElement("h4",null,l.name),n?r.a.createElement("p",{className:"error"},n):r.a.createElement(r.a.Fragment,null),r.a.createElement("form",{className:"SoundChangeSuite__form","data-testid":"".concat(l.name,"_SoundChangeSuite_changes")},r.a.createElement("label",{htmlFor:"".concat(l.name,"-name")},"Name:"),r.a.createElement("input",{type:"text",name:"epoch",id:"".concat(l.name,"-name"),cols:"30",rows:"1",value:l.name,onChange:function(e){return h(e,(function(){m(Object(p.a)({},l,{name:e.target.value}))}))}}),t?r.a.createElement(r.a.Fragment,null,r.a.createElement("label",{htmlFor:"".concat(l.name,"-parent")},"Parent Epoch:"),r.a.createElement("select",{name:"parent",list:"".concat(l.name,"-parents-list"),value:l.parent||"none",onChange:function(e){return h(e,(function(){console.log(e.target.value),m(Object(p.a)({},l,{parent:e.target.value}))}))}},c.map(v).filter(g).map(f))):r.a.createElement(r.a.Fragment,null),r.a.createElement("textarea",{name:"changes",id:"",cols:"30",rows:"10",value:l.changes.join("\n"),onChange:function(e){return h(e,(function(){return m(Object(p.a)({},l,{changes:e.target.value.split(/\n/).map((function(e){return" "===e?"[+ feature]>[- feature]/_#":e}))}))}))}})),r.a.createElement("form",{onSubmit:function(e){return o(e,l.name)}},r.a.createElement("input",{className:"form form--remove",type:"submit",name:"remove-epoch",value:"remove ".concat(l.name)})))}),h=function(e){var t=e.epochs,n=e.errors,a=e.dispatch,o=function(e,t){e.preventDefault(),a({type:"REMOVE_EPOCH",value:{name:t}})},c=function(e,t){var n={name:e.name,index:t,changes:e.changes,parent:e.parent};a({type:"SET_EPOCH",value:n})},u=function(e){return e===t.length-1?r.a.createElement("form",{onSubmit:function(e){return function(e){e.preventDefault();var n=t.length+1;a({type:"ADD_EPOCH",value:{name:"Epoch ".concat(n)}})}(e)}},r.a.createElement("input",{className:"form form--add",type:"submit",name:"add-epoch",value:"Add Epoch"})):r.a.createElement(r.a.Fragment,null)};return r.a.createElement(r.a.Fragment,null,t.length?t.map((function(e,a){var i=n.epoch?n.error:null;return r.a.createElement("div",{className:"SoundChangeSuite","data-testid":"".concat(e.name,"_SoundChangeSuite"),key:"epoch-".concat(a)},r.a.createElement(m,{epochIndex:a,epoch:e,updateEpoch:c,removeEpoch:o,epochs:t,error:i}),u(a))})):u(-1))},f=(n(23),n(24),function(e){var t=e.options,n=e.dispatch,o=Object(a.useState)(""),c=Object(u.a)(o,2);c[0],c[1];return r.a.createElement("div",{className:"Options","data-testid":"Options"},r.a.createElement("h3",null,"Modeling Options"),r.a.createElement("form",{onSubmit:function(e){return function(e,t){e.preventDefault(),n({type:"RUN",value:t})}(e,t)},"data-testid":"Options-form"},r.a.createElement("input",{type:"radio",name:"output",id:"default",checked:!t||"default"===t.output,onChange:function(e){return function(e){var t=e.target,a=t.name,r=t.id;n({type:"SET_OPTIONS",value:{option:a,setValue:r}})}(e)}}),r.a.createElement("label",{htmlFor:"default"},"Default",r.a.createElement("span",{className:"Options__output-example"}," output")),r.a.createElement("input",{className:"form form--add",type:"submit",value:"Run Changes"}),r.a.createElement("input",{className:"form form--remove",type:"button",value:"Clear Output",onClick:function(e){return function(e){e.preventDefault(),console.log("clearing"),n({type:"CLEAR",value:{}})}(e)}})))}),v=(n(27),function(e){var t=e.results,n=e.options,a=(e.errors,function(){return t.map((function(e,t){var n=e.lexicon.map((function(t,n){return r.a.createElement("span",{key:"".concat(e.pass,"-").concat(n)},t)}));return r.a.createElement("div",{key:"epoch-".concat(t),className:"Output-epoch"},r.a.createElement("h5",null,e.pass),r.a.createElement("p",{className:"lexicon"},n))}))});return r.a.createElement("div",{className:"Output","data-testid":"Output"},r.a.createElement("h3",null,"Results of Run"),r.a.createElement("div",{"data-testid":"Output-lexicon",className:"Output__container"},t&&t.length?function(){switch(n.output){case"default":return a();default:return r.a.createElement(r.a.Fragment,null)}}():r.a.createElement(r.a.Fragment,null)))}),g=n(1),d=function(e,t,n){var a={lexeme:e,epoch:n.epochs[0]};if(t){var r=n.epochs.findIndex((function(e){return e.name===t}));r>0&&(a.epoch=n.epochs[r])}return a},E=function(e,t){return t.split("").reduce((function(t,n,a){return t=0===a?e[n]:t[n]}),{})},b=function(e,t,n,a){var r={};return t.split("").forEach((function(o,c){r=0===c?e[o]:r[o],c===t.split("").length-1&&(r.features=Object(p.a)({},r.features,Object(s.a)({},n,a)))})),e},O=n(10),j=n(6);function x(){var e=Object(j.a)(["Error in line ",": ",""]);return x=function(){return e},e}function _(){var e=Object(j.a)(["Error in line ",": ",""]);return _=function(){return e},e}var w=function(e){return function(t){return t[e]}},y=function(e,t,n){var a=Object(u.a)(e,2),r=a[0],o=a[1];return"".concat(r).concat(t).concat(o).concat(n)},N=function(e,t){try{var n=function(e){if(!e.match(/>/g))throw"Insert '>' operator between target and result";if(!e.match(/\//g))throw"Insert '/' operator between change and environment";if(!e.match(/_/g))throw"Insert '_' operator in environment";if(e.match(/>/g).length>1)throw"Too many '>' operators";if(e.match(/\//g).length>1)throw"Too many '/' operators";if(e.match(/_/g).length>1)throw"Too many '_' operators";return e.split(/>|\/|_/g)}(e),a=Object(u.a)(n,4),r=a[0],o=a[1];return{environment:{pre:a[2],position:r,post:a[3]},newFeatures:o}}catch(c){throw y(_(),t+1,c)}},F=function(e){return"-"!==e&&"+"!==e&&"]"!==e&&"["!==e&&" "!==e},C=function(e,t){try{var n=t?/(?=\+.).*(?<=\-)|(?=\+.).*(?!\-).*(?<=\])/g:/(?=\-.).*(?<=\+)|(?=\-.).*(?!\+).*(?<=\])/g,a=e.match(n)||[null],r=Object(u.a)(a,1)[0];return r?(function(e){var t=e.match(/\W/g).filter(F);if(t.length)throw"Unknown token '".concat(t[0],"'")}(r),r.trim().match(/\w+/g).reduce((o=t,function(e,t){return Object(p.a)({},e,Object(s.a)({},t,o))}),{})):{}}catch(c){throw c}var o},k=function(e){return Object(p.a)({},C(e,!0),{},C(e,!1))},S=function(e,t){if(e){if("."===e)return[];if("#"===e)return["#"];if("0"===e)return[];var n=e.match(/\[.*\]/);try{return n?e.split("[").filter((function(e){return e})).map(k):function(e,t){var n=[],a=t.length-1,r={};return Object(g.a)(t).forEach((function(t,o){return o||a||n.push(e[t].features),o?o===a?r[t]?n.push(r[t]):n.push(r,e[t]):!r[t]&&r.features?(n.push(r),r=e[t]):r[t]?void 0:r=r[t]:r=e[t]})),n}(t,e)}catch(a){throw a}}return{}},P=function(e,t){var n=e.changes;try{return n.map(N).map(function(e){return function(t,n){try{var a=t.newFeatures,r=t.environment,o=r.pre,c=r.position,u=r.post;return{environment:{pre:S(o,e),position:S(c,e),post:S(u,e)},newFeatures:S(a,e)}}catch(i){throw y(x(),n+1,i)}}}(t))}catch(a){throw{epoch:e.name,error:a}}},D=function(e,t){return!t||t.filter(function(e){return function(t,n){var a=e[n].features;return Object.entries(t).reduce((function(e,t){var n=Object(u.a)(t,2),r=n[0],o=n[1];return!!e&&(!!a.hasOwnProperty(r)&&(!a[r]&&!o||a[r]===o))}),!0)}}(e)).length===t.length},A=function(e){return Object.entries(e)},T=function(e,t){var n=Object(u.a)(t,2),a=n[0],r=n[1];return Object(p.a)({},e,Object(s.a)({},a,r))},L=function(e,t,n){if(!t)return{};var a=A(t).reduce(T,Object(p.a)({},e.features)),r=A(a).map(function(e){return function(t){var n=Object(u.a)(t,2),a=n[0],r=n[1];return e[a][r?"positive":"negative"]}}(n));return r.reduce((function(e,t,n,a){return e.filter(function(e,t){return function(n){return e.map(w(t)).includes(n[t])}}(t,"grapheme"))}),r[r.length-1])[0]},R=function(e,t,n){var a=t.environment,r=a.pre,o=a.post,c=a.position;return e.reduce((function(a,u,i){if(r.find((function(e){return"#"===e})))return function(e,t,n,a,r,o,c,u,i){if(o!==t.length-1)return[].concat(Object(g.a)(e),[r]);if(!D([r],a))return[].concat(Object(g.a)(e),[r]);if(!D(c.slice(o+a.length,o+n.length+a.length),n))return[].concat(Object(g.a)(e),[r]);var s=L(r,u[0],i);return s.grapheme?[].concat(Object(g.a)(e),[s]):Object(g.a)(e)}(a,r,o,c,u,i,e,t.newFeatures,n);if(o.find((function(e){return"#"===e})))return function(e,t,n,a,r,o,c,u,i){if(o+n.length!==c.length)return[].concat(Object(g.a)(e),[r]);if(!D(c.slice(o-t.length,o),t))return[].concat(Object(g.a)(e),[r]);if(!D([r],a))return[].concat(Object(g.a)(e),[r]);var s=L(r,u[0],i);return s.grapheme?[].concat(Object(g.a)(e),[s]):Object(g.a)(e)}(a,r,o,c,u,i,e,t.newFeatures,n);if(i=e.length-o.length)return[].concat(Object(g.a)(a),[u]);if(!D(e.slice(i-r.length,i),r))return[].concat(Object(g.a)(a),[u]);if(!D([u],c))return[].concat(Object(g.a)(a),[u]);if(!D(e.slice(i,i+o.length),o))return[].concat(Object(g.a)(a),[u]);var s=L(u,t.newFeatures[0],n);return s&&s.grapheme?[].concat(Object(g.a)(a),[s]):Object(g.a)(a)}),[])},I=function(e){return function(t){return e.map((function(e){var n=e.lexeme;return function(e,t){var n=[],a=t.length-1,r={};return Object(g.a)(t).forEach((function(t,o){return o?o===a?r[t]?n.push(r[t]):n.push(r,e[t]):!r[t]&&r.features?(n.push(r),r=e[t]):r[t]?void 0:r=r[t]:r=e[t]})),n}(t,n)}))}},U=function(e){return e.map(w("grapheme")).join("")},H=function(e){var t=e.lexicon,n=Object(O.a)(e,["lexicon"]);return Object(p.a)({},n,{lexicon:t.map(U)})},M=function(e,t){try{var n=e.epochs.reduce((function(t,n,a){var r,o=e.phones,c=e.features,u=e.lexicon;n.parent&&(r=t.find((function(e){return e.pass===n.parent})).lexicon),n.parent||(r=I(u)(o));var i=P(n,o),s=function(e){return function(t){return function(n){return e.map((function(e){return t.reduce((function(e,t,a){return R(e,t,n)}),e)}))}}}(r)(i)(c),l={pass:n.name,lexicon:s};return n.parent&&(l.parent=n.parent),[].concat(Object(g.a)(t),[l])}),[]).map(H);return Object(p.a)({},e,{results:n,errors:{}})}catch(a){return console.log(a),Object(p.a)({},e,{errors:a,results:[]})}},V=function(e){var t={epochs:[{name:"epoch 1",changes:["[+ occlusive - nasal]>[+ occlusive + nasal]/n_.","a>\u026f/._#","[+ sonorant - low rounded high back]>0/._.","[+ obstruent]>[+ obstruent aspirated ]/#_.","[+ sonorant - rounded]>[+ sonorant + rounded]/._#"]}],phones:{a:{grapheme:"a",features:{sonorant:!0,back:!0,low:!0,high:!1,rounded:!1}},u:{grapheme:"u",features:{sonorant:!0,back:!0,low:!1,high:!0,rounded:!0}},"\u026f":{grapheme:"\u026f",features:{sonorant:!0,back:!0,low:!1,high:!0,rounded:!1}},"\u0259":{grapheme:"\u0259",features:{sonorant:!0,low:!1,rounded:!1,high:!1,back:!1}},t:{grapheme:"t",features:{occlusive:!0,coronal:!0,obstruent:!0,nasal:!1},"\u02b0":{grapheme:"t\u02b0",features:{occlusive:!0,coronal:!0,obstruent:!0,aspirated:!0}}},n:{grapheme:"n",features:{sonorant:!0,nasal:!0,occlusive:!0,coronal:!0}}},options:{output:"default",save:!1},results:[],errors:{},features:{},lexicon:[]};return t.features={sonorant:{positive:[t.phones.a,t.phones.u,t.phones.\u026f,t.phones.\u0259,t.phones.n],negative:[]},back:{positive:[t.phones.a,t.phones.u,t.phones.\u026f],negative:[t.phones.\u0259]},low:{positive:[t.phones.a],negative:[t.phones.u,t.phones.\u026f,t.phones.\u0259]},high:{positive:[t.phones.u,t.phones.\u026f],negative:[t.phones.a,t.phones.\u0259]},rounded:{positive:[t.phones.u],negative:[t.phones.a,t.phones.\u026f,t.phones.\u0259]},occlusive:{positive:[t.phones.t,t.phones.n,t.phones.t.\u02b0],negative:[]},coronal:{positive:[t.phones.t,t.phones.n,t.phones.t.\u02b0],negative:[]},obstruent:{positive:[t.phones.t,t.phones.n,t.phones.t.\u02b0],negative:[]},nasal:{positive:[t.phones.n],negative:[t.phones.t,t.phones.t.\u02b0]},aspirated:{positive:[t.phones.t.\u02b0],negative:[t.phones.t]}},t.lexicon=[{lexeme:"anta",epoch:t.epochs[0]},{lexeme:"anat",epoch:t.epochs[0]},{lexeme:"an\u0259t",epoch:t.epochs[0]},{lexeme:"anna",epoch:t.epochs[0]},{lexeme:"tan",epoch:t.epochs[0]},{lexeme:"\u0259nta",epoch:t.epochs[0]}],e>-1&&(t.epochs[0].changes=t.epochs[0].changes.splice(0,e)),t},X=function(e,t){switch(t.type){case"INIT":return V();case"ADD_LEXEME":return function(e,t){var n=d(t.value.lexeme,t.value.epoch,e);return Object(p.a)({},e,{lexicon:[].concat(Object(g.a)(e.lexicon),[n])})}(e,t);case"SET_LEXICON":return function(e,t){var n=t.value;return n=n.map((function(t){return d(t.lexeme,t.epoch,e)})),Object(p.a)({},e,{lexicon:n})}(e,t);case"ADD_EPOCH":return function(e,t){var n={name:t.value.name,changes:t.value.changes||[""],parent:null};return Object(p.a)({},e,{epochs:[].concat(Object(g.a)(e.epochs),[n])})}(e,t);case"SET_EPOCH":return function(e,t){var n=t.value.index;if("number"!==typeof n)return e;var a=e.epochs;return a[n].name=t.value.name?t.value.name:a[n].name,a[n].changes=t.value.changes?t.value.changes:a[n].changes,a[n].parent=t.value.parent&&"none"!==t.value.parent?t.value.parent:null,Object(p.a)({},e,{epochs:Object(g.a)(a)})}(e,t);case"REMOVE_EPOCH":return function(e,t){var n=e.epochs.filter((function(e){return e.name!==t.value.name}));return Object(p.a)({},e,{epochs:Object(g.a)(n)})}(e,t);case"ADD_FEATURE":return function(e,t){var n=t.value.positivePhones||[],a=t.value.negativePhones||[],r=t.value.feature,o=[].concat(Object(g.a)(n),Object(g.a)(a)).reduce((function(e,t){return function(e,t){var n={};return t.split("").forEach((function(a,r){r&&(n[a]={}),r||e[a]||(e[a]={}),n=0===r?e[a]:n[a],r===t.length-1&&(n.grapheme=t)})),e}(e,t)}),e.phones);n&&(n.reduce((function(e,t){return b(e,t,r,!0)}),o),n=n.map((function(e){return E(o,e)}))),a&&(a.reduce((function(e,t){return b(e,t,r,!1)}),o),a=a.map((function(e){return E(o,e)})));var c=Object(s.a)({},t.value.feature,{positive:n,negative:a});return Object(p.a)({},e,{features:Object(p.a)({},e.features,{},c),phones:o})}(e,t);case"DELETE_FEATURE":return function(e,t){console.log("deleting");var n=t.value;return delete e.features[n],console.log(e),Object(p.a)({},e)}(e,t);case"SET_OPTIONS":return function(e,t){var n=t.value.option,a=t.value.setValue;"true"===a&&(a=!0),"false"===a&&(a=!1);var r=Object(p.a)({},e);return r.options[n]=a,r}(e,t);case"CLEAR":return function(e,t){return Object(p.a)({},e,{results:[],errors:{}})}(e);case"RUN":return M(e);default:return e}},W=function(){var e=Object(a.useReducer)(X,{},V),t=Object(u.a)(e,2),n=t[0],o=t[1],c=n.lexicon,s=n.phones,p=(n.phonemes,n.epochs),m=n.options,g=n.features,d=n.results,E=n.errors;return r.a.createElement("div",{className:"PhonoChangeApplier","data-testid":"PhonoChangeApplier"},r.a.createElement(i,{lexicon:c,dispatch:o}),r.a.createElement(l,{phones:s,features:g,dispatch:o}),r.a.createElement(h,{epochs:p,errors:E,dispatch:o}),r.a.createElement(f,{options:m,dispatch:o}),r.a.createElement(v,{results:d,options:m,dispatch:o}))};var B=function(){return r.a.createElement("div",{className:"App","data-testid":"App"},r.a.createElement("h1",null,"Phono Change Applier"),r.a.createElement(W,null))};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));c.a.render(r.a.createElement(B,null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))}],[[11,1,2]]]);
+//# sourceMappingURL=main.826e9397.chunk.js.map
\ No newline at end of file
diff --git a/static/js/main.826e9397.chunk.js.map b/static/js/main.826e9397.chunk.js.map
new file mode 100644
index 0000000..2ec7ef2
--- /dev/null
+++ b/static/js/main.826e9397.chunk.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["components/ProtoLang.js","components/Features.js","components/SoundChangeSuite.js","components/Epochs.js","components/Options.js","components/Output.js","reducers/reducer.lexicon.js","reducers/reducer.features.js","reducers/reducer.results.js","reducers/reducer.init.js","reducers/reducer.js","reducers/reducer.epochs.js","reducers/reducer.options.js","reducers/reducer.clear.js","PhonoChangeApplier.js","App.js","serviceWorker.js","index.js"],"names":["ProtoLang","lexicon","dispatch","className","data-testid","name","cols","rows","value","map","property","object","join","renderLexicon","onChange","e","console","log","target","split","line","lexeme","trim","epoch","type","Features","phones","features","useState","feature","setFeature","newPositivePhones","setNewPositivePhones","newNegativePhones","setNewNegativePhones","parseNewPhones","somePhones","phone","buildAddFeatureAction","positivePhones","negativePhones","featureObject","getProperty","featureMap","index","Object","keys","featureName","plus","minus","key","onClick","preventDefault","handleDeleteClick","getFeatureMapJSX","plusPhones","positive","minusPhones","negative","getFeatureMap","parsePhonesFromFeatureObject","htmlFor","id","dispatchFunction","actionBuilder","actionParameters","handleClickDispatch","SoundChangeSuite","props","epochIndex","error","removeEpoch","epochs","changes","parent","setEpoch","changeHandler","cb","updateEpoch","useEffect","renderOptionFromEpoch","thisEpoch","replaceCurrentEpoch","isViableParent","list","filter","change","onSubmit","Epochs","errors","epochName","dispatchValue","renderAddEpochButton","length","addEpoch","epochError","Options","options","handleFormSubmit","checked","output","option","setValue","handleRadioChange","handleOutputClearSubmit","Output","results","renderDefault","i","pass","renderResults","makeLexeme","state","newLexeme","findIndex","findPhone","reduce","node","graph","addFeatureToPhone","featureKey","featureValue","forEach","errorMessage","location","err","prefix","separator","decomposeRule","rule","match","lintRule","position","newFeatures","environment","pre","post","isUnknownFeatureToken","token","getFeatures","phoneme","featureBoolean","featureMatch","unknownTokens","doesFeatureRuleContainUnknownToken","bool","mapToPositiveAndNegativeFeatures","mapStringToFeatures","ruleString","ruleBrackets","v","featureBundle","lastIndex","push","findFeaturesFromGrapheme","decomposeRules","ruleBundle","mapRuleBundleToFeatureBundle","isEnvironmentBoundByRule","phonemeFeatures","ruleFeatures","ruleFeature","entries","hasOwnProperty","isPhonemeBoundByRule","getEntries","reduceFeatureValues","newPhoneme","newFeature","newValue","transformPhoneme","newPhonemeFeatures","newPhonemeCandidates","transformFeatureValues","candidates","candidatesSubset","array","candidate","includes","isObjectWithPropertyInArray","transformLexeme","lexemeBundle","find","val","slice","grapheme","transformLexemeInitial","transformLexemeCoda","formBundleFromLexicon","findFeaturesFromLexeme","stringifyLexeme","stringifyResults","passResults","run","action","_","lexiconBundle","result","transformLexicon","initState","changesArgument","a","sonorant","back","low","high","rounded","u","ɯ","ə","t","occlusive","coronal","obstruent","nasal","ʰ","aspirated","n","save","splice","stateReducer","addLexeme","newLexicon","setLexicon","newEpoch","mutatedEpochs","newFeatureName","newPhoneObject","phoneObject","addPhones","positivePhone","negativePhone","addFeature","deletedFeature","deleteFeature","mutatedState","setOptions","clearOutput","PhonoChangeApplier","useReducer","phonemes","App","Boolean","window","hostname","ReactDOM","render","document","getElementById","navigator","serviceWorker","ready","then","registration","unregister"],"mappings":"yZA6CeA,G,YA1CG,SAAC,GAA2B,IAAzBC,EAAwB,EAAxBA,QAASC,EAAe,EAAfA,SAS5B,OACE,yBAAKC,UAAU,YAAYC,cAAY,aACrC,sDACA,6BACA,0BAAMA,cAAY,qBAChB,8BACEC,KAAK,UACLC,KAAK,KACLC,KAAK,KACLH,cAAY,8BACZI,MAjBc,WACpB,OAAKP,EAGEA,EAAQQ,KALGC,EAKa,SALD,SAAAC,GAAM,OAAIA,EAAOD,MAKLE,KAAK,MAH1B,GAFH,IAAAF,EAkBLG,GACPC,SAAU,SAAAC,GACRC,QAAQC,IAAIF,EAAEG,OAAOV,MAAMW,MAAM,MAAMV,KAAI,SAAAW,GAGzC,MAAO,CAAEC,OAFMD,EAAKD,MAAM,KAAK,GAAGG,OAEjBC,MADHH,EAAKD,MAAM,KAAK,IAAM,QAGtCjB,EAAS,CACPsB,KAA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A,EAAS/F,SAAUA,MCb7C+O,MATf,WACE,OACE,yBAAK9O,UAAU,MAAMC,cAAY,OAC/B,oDACA,kBAAC,EAAD,QCIc8O,QACW,cAA7BC,OAAOvH,SAASwH,UAEe,UAA7BD,OAAOvH,SAASwH,UAEhBD,OAAOvH,SAASwH,SAASlH,MACvB,2DCZNmH,IAASC,OAAO,kBAAC,EAAD,MAASC,SAASC,eAAe,SD2H3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAMC,MAAK,SAAAC,GACjCA,EAAaC,kB","file":"static/js/main.826e9397.chunk.js","sourcesContent":["import React from 'react';\nimport './ProtoLang.scss';\n\nconst ProtoLang = ({ lexicon, dispatch }) => {\n const getProperty = property => object => object[property];\n const renderLexicon = () => {\n if (!lexicon) return '';\n // Code for optionally rendering epoch name with lexeme\n // `\\t#${lexeme.epoch.name}`\n return lexicon.map(getProperty('lexeme')).join('\\n');\n }\n\n return (\n \n
Proto Language Lexicon
\n
\n \n \n );\n}\n\nexport default ProtoLang;","// @flow\nimport React, {useState} from 'react';\nimport './Features.scss';\n\nimport type { featureAction } from '../reducers/reducer.features';\n\n\nconst Features = ({ phones, features, dispatch }) => {\n const [feature, setFeature] = useState('aspirated')\n const [ newPositivePhones, setNewPositivePhones ] = useState('tʰ / pʰ / kʰ');\n const [ newNegativePhones, setNewNegativePhones ] = useState('t / p / k');\n \n const newFeaturesSubmit = e => {\n e.preventDefault();\n setFeature('');\n setNewPositivePhones('');\n setNewNegativePhones('');\n }\n \n const handleDeleteClick = (e, feature) => {\n e.preventDefault();\n const deleteFeatureAction = {\n type: \"DELETE_FEATURE\",\n value: feature\n }\n return dispatch(deleteFeatureAction);\n }\n \n const parsePhonesFromFeatureObject = featureObject => {\n const getProperty = property => object => object[property]\n \n const getFeatureMap = (featureObject) => {\n return Object.keys(featureObject).map(feature => {\n const plusPhones = featureObject[feature].positive.map(getProperty('grapheme')).join(' / ');\n const minusPhones = featureObject[feature].negative.map(getProperty('grapheme')).join(' / ');\n return {[feature]: {plus: plusPhones, minus: minusPhones}}\n })\n }\n \n const getFeatureMapJSX = (featureMap) => {\n return featureMap.map((feature, index) => {\n const [featureName] = Object.keys(feature);\n const { plus, minus } = feature[featureName];\n return (\n \n \n \n {`[+ ${featureName}]`}\n \n \n {plus}\n \n \n \n \n {`[- ${featureName}]`}\n \n \n {minus}\n \n \n \n \n )\n })\n }\n \n const featureMap = getFeatureMap(featureObject);\n const featureMapJSX = getFeatureMapJSX(featureMap);\n return featureMapJSX;\n }\n \n const parseNewPhones = somePhones => {\n if (somePhones === '') return [''];\n return somePhones.split('/').map(phone => phone.trim());\n }\n \n const handleClickDispatch = e => dispatchFunction => actionBuilder => actionParameters => {\n e.preventDefault();\n return dispatchFunction(actionBuilder(actionParameters));\n }\n \n const buildAddFeatureAction = ([newPositivePhones, newNegativePhones, feature]): featureAction => (\n {\n type: \"ADD_FEATURE\",\n value: {\n positivePhones: parseNewPhones(newPositivePhones),\n negativePhones: parseNewPhones(newNegativePhones),\n feature\n }\n }\n )\n\n return (\n \n );\n}\n\nexport default Features;","import React, { useState, useEffect } from 'react';\nimport './SoundChangeSuite.scss';\n\nconst SoundChangeSuite = props => {\n const { epochIndex, error, removeEpoch, epochs } = props;\n const [ epoch, setEpoch ] = useState(props.epoch ? props.epoch : {name:'', changes:[''], parent:'none'});\n \n const changeHandler = (e,cb) => {\n cb(e);\n props.updateEpoch(epoch, epochIndex);\n }\n \n useEffect(() => {\n props.updateEpoch(epoch, epochIndex);\n }, [epoch])\n\n const renderOptionFromEpoch = thisEpoch => (\n \n )\n\n const replaceCurrentEpoch = thisEpoch => {\n if (thisEpoch.name === epoch.name) return {name: 'none'}\n return thisEpoch;\n }\n\n const isViableParent = thisEpoch => {\n if (thisEpoch.parent && thisEpoch.parent === epoch.name) return false;\n return true;\n }\n\n const parentsOptions = () => {\n return epochs.map(replaceCurrentEpoch).filter(isViableParent).map(renderOptionFromEpoch)\n }\n\n const renderParentInput = () => {\n if (epochIndex) return (\n <>\n \n \n >\n )\n return <>>\n }\n\n const renderError = () => {\n if (error) return (\n {error}
\n )\n return <>>\n }\n\n return (\n <>\n {epoch.name}
\n {renderError()}\n \n \n >\n );\n}\n\nexport default SoundChangeSuite;","import React from 'react';\nimport './Epochs.scss';\n\nimport SoundChangeSuite from './SoundChangeSuite';\nimport { render } from 'react-dom';\n\n\n\nconst Epochs = ({epochs, errors, dispatch}) => {\n \n const addEpoch = e => {\n e.preventDefault()\n let index = epochs.length + 1;\n dispatch({\n type: 'ADD_EPOCH',\n value: {name: `Epoch ${index}`}\n })\n }\n\n const removeEpoch = (e, epochName) => {\n e.preventDefault()\n dispatch({\n type: 'REMOVE_EPOCH',\n value: {name: epochName}\n });\n }\n\n const updateEpoch = (epoch, epochIndex) => {\n const dispatchValue = {\n name: epoch.name,\n index: epochIndex,\n changes: epoch.changes,\n parent: epoch.parent\n }\n dispatch({\n type: \"SET_EPOCH\",\n value: dispatchValue\n })\n }\n \n const renderAddEpochButton = index => {\n if (index === epochs.length - 1 ) return (\n \n )\n return <>>\n }\n\n const renderEpochs = () => {\n if (epochs.length) return epochs.map((epoch, index) => {\n const epochError = errors.epoch ? errors.error : null\n return (\n \n \n {renderAddEpochButton(index)}\n
\n )});\n return renderAddEpochButton(-1)\n }\n\n return (\n <>\n { renderEpochs() }\n >\n );\n}\n\nexport default Epochs;","import React, { useState } from 'react';\nimport './Options.scss';\nimport ls from 'local-storage';\n\nconst Options = ({ options, dispatch }) => {\n const [ load, setLoad ] = useState('');\n\n const handleRadioChange = e => {\n const { name, id } = e.target;\n dispatch({\n type: 'SET_OPTIONS',\n value: {\n option: name,\n setValue: id\n }\n });\n }\n \n const handleFormSubmit = (e, options) => {\n e.preventDefault();\n dispatch({\n type: 'RUN',\n value: options\n });\n }\n\n const handleOutputClearSubmit = e => {\n e.preventDefault();\n console.log('clearing')\n dispatch({\n type: 'CLEAR',\n value: {}\n });\n }\n\n return (\n \n
Modeling Options
\n\n \n\n\n {/* */}\n \n );\n}\n\nexport default Options;","import React from 'react';\nimport './Output.scss';\n\nconst Output = props => {\n const { results, options, errors } = props;\n const renderResults = () => {\n switch(options.output) {\n case 'default':\n return renderDefault();\n default:\n return <>>\n }\n }\n\n const renderDefault = () => {\n return results.map((epoch, i) => {\n const lexicon = epoch.lexicon.map((lexeme, i) => {lexeme});\n return (\n \n
{epoch.pass}
\n
{lexicon}
\n
\n )\n })\n }\n\n return (\n \n
Results of Run
\n
\n {results && results.length ? renderResults() : <>>}\n
\n
\n );\n}\n\nexport default Output;","// @flow\nimport type { stateType } from './reducer';\n\ntype lexemeType = {\n lexeme: string,\n epoch?: string\n}\n\ntype addLexemeAction = {\n type: 'ADD_LEXEME',\n value: lexemeType\n}\n\ntype setLexiconAction = {\n type: 'SET_LEXICON',\n value: Array\n}\n\nconst makeLexeme = (lexeme: string, epochName: ?string, state: stateType) => {\n const newLexeme = {lexeme: lexeme, epoch: state.epochs[0]};\n if (epochName) {\n const epochIndex = state.epochs.findIndex(epoch => epoch.name === epochName);\n if (epochIndex > 0) {\n newLexeme.epoch = state.epochs[epochIndex];\n };\n }\n return newLexeme;\n}\n\nexport type lexiconAction = addLexemeAction | setLexiconAction\n\nexport const addLexeme = (state: stateType, action: addLexemeAction): stateType => {\n const newLexeme = makeLexeme(action.value.lexeme, action.value.epoch, state);\n return {...state, lexicon:[...state.lexicon, newLexeme]}\n}\n\nexport const setLexicon = (state: stateType, action: setLexiconAction): stateType => {\n let newLexicon = action.value;\n newLexicon = newLexicon.map(lexeme => makeLexeme(lexeme.lexeme, lexeme.epoch, state));\n return {...state, lexicon: newLexicon}\n}","// @flow\nimport type { stateType } from './reducer';\n\nexport type featureAction = {\n type: \"ADD_FEATURE\",\n value: {\n positivePhones: Array,\n negativePhones: Array,\n feature: string\n }\n}\n\nconst addPhones = (phones: {}, phone: string): {} => {\n let node = {};\n\n phone.split('').forEach((graph, index) => {\n if (index) node[graph] = {}\n if (!index && !phones[graph]) phones[graph] = {} \n node = index === 0 ? phones[graph] : node[graph];\n if (index === phone.length - 1) node.grapheme = phone;\n })\n\n return phones;\n}\n\nconst findPhone = (phones: {}, phone: string): {} => {\n return phone\n .split('')\n .reduce((node, graph, index) => {\n node = index === 0 ? phones[graph] : node[graph];\n return node;\n }, {});\n}\n\nconst addFeatureToPhone = (\n phones: {}, phone: string, featureKey: string, featureValue: boolean\n): {} => {\n let node = {}\n phone.split('').forEach((graph, index) => {\n node = index === 0 ? phones[graph] : node[graph];\n \n if (index === phone.split('').length - 1) {\n node.features = {...node.features, [featureKey]: featureValue}\n }\n });\n return phones;\n}\n\nexport const addFeature = (state: stateType, action: featureAction): stateType => {\n let positivePhones = action.value.positivePhones || [];\n let negativePhones = action.value.negativePhones || [];\n let newFeatureName = action.value.feature;\n let newPhoneObject = [\n ...positivePhones, ...negativePhones\n ]\n .reduce((phoneObject, phone) => addPhones(phoneObject, phone), state.phones)\n \n if (positivePhones) {\n\n positivePhones.reduce(\n (phoneObject, positivePhone) => addFeatureToPhone(phoneObject, positivePhone, newFeatureName, true)\n , newPhoneObject\n );\n\n positivePhones = positivePhones.map( positivePhone => findPhone(newPhoneObject, positivePhone) )\n }\n \n if (negativePhones) {\n \n negativePhones.reduce(\n (phoneObject, positivePhone) => addFeatureToPhone(phoneObject, positivePhone, newFeatureName, false)\n , newPhoneObject\n );\n \n negativePhones = negativePhones.map( negativePhone => findPhone(newPhoneObject, negativePhone) )\n }\n \n let newFeature = {[action.value.feature]: {positive: positivePhones, negative: negativePhones}};\n return {...state, features:{...state.features, ...newFeature}, phones: newPhoneObject}\n}\n\nexport const deleteFeature = (state, action) => {\n console.log('deleting')\n const deletedFeature = action.value;\n delete state.features[deletedFeature];\n console.log(state)\n return {...state}\n}","// @flow\nimport type { stateType, epochType, phoneType } from './reducer';\n\nexport type resultsAction = {\n type: 'RUN'\n}\n\nexport type decomposedRulesType = [\n {\n environment: {\n pre: [{[key: string]: boolean}],\n position: [{[key: string]: boolean}],\n post: [{[key: string]: boolean}]\n },\n newFeatures: [{[key: string]: boolean}]\n }\n]\n\ntype ruleBundle = {\n environment: {\n pre: string,\n position: string,\n post: string\n },\n newFeatures: string\n}\n\nconst getProperty = property => object => object[property]\n\nconst findFeaturesFromLexeme = (phones: {}, lexeme:string): [] => {\n let featureBundle = []\n let lastIndex = lexeme.length - 1;\n let node = {};\n [...lexeme].forEach((graph, index) => {\n if (!index) return node = phones[graph]\n if (index === lastIndex) return node[graph] \n ? featureBundle.push(node[graph])\n : featureBundle.push(node, phones[graph])\n if (!node[graph] && node.features) {\n featureBundle.push(node)\n return node = phones[graph]\n }\n if (!node[graph])\n return node = node[graph]\n })\n return featureBundle;\n}\n\nconst findFeaturesFromGrapheme = (phones: {}, lexeme:string): [] => {\n let featureBundle = []\n let lastIndex = lexeme.length - 1;\n let node = {};\n [...lexeme].forEach((graph, index) => {\n if (!index && !lastIndex) featureBundle.push(phones[graph].features)\n if (!index) return node = phones[graph]\n if (index === lastIndex) return node[graph] \n ? featureBundle.push(node[graph])\n : featureBundle.push(node, phones[graph])\n if (!node[graph] && node.features) {\n featureBundle.push(node)\n return node = phones[graph]\n }\n if (!node[graph])\n return node = node[graph]\n })\n return featureBundle;\n}\n\nconst errorMessage = ([prefix, separator], location, err) => `${prefix}${location}${separator}${err}`\n\nconst lintRule = (rule) => {\n if (!rule.match(/>/g)) throw `Insert '>' operator between target and result`\n if (!rule.match(/\\//g)) throw `Insert '/' operator between change and environment`\n if (!rule.match(/_/g)) throw `Insert '_' operator in environment`\n if (rule.match(/>/g).length > 1) throw `Too many '>' operators`\n if (rule.match(/\\//g).length > 1) throw `Too many '/' operators`\n if (rule.match(/_/g).length > 1) throw `Too many '_' operators`\n return rule.split(/>|\\/|_/g);\n}\n\nconst decomposeRule = (rule: string, index: number): ruleBundle => {\n try {\n // splits rule at '>' '/' and '_' substrings resulting in array of length 4\n const [position, newFeatures, pre, post] = lintRule(rule); \n return { environment: { pre, position, post }, newFeatures }\n } catch (err) {\n throw errorMessage`Error in line ${index + 1}: ${err}`;\n }\n}\n\nconst isUnknownFeatureToken = token => token !== '-' && token !== '+' && token !== ']' && token !== '[' && token !== ' ';\n\nconst doesFeatureRuleContainUnknownToken = features => {\n const unknownTokens = features\n .match(/\\W/g)\n .filter(isUnknownFeatureToken)\n if (unknownTokens.length) throw `Unknown token '${unknownTokens[0]}'`;\n return true\n}\n\nconst reduceFeaturesToBoolean = bool => (map, feature) => ({...map, [feature]: bool})\n\nconst getFeatures = (phoneme: string, featureBoolean): {} => {\n try {\n const featureMatch = featureBoolean\n // regEx to pull positive features\n ? /(?=\\+.).*(?<=\\-)|(?=\\+.).*(?!\\-).*(?<=\\])/g \n // regEx to pull negative features\n : /(?=\\-.).*(?<=\\+)|(?=\\-.).*(?!\\+).*(?<=\\])/g\n const [ features ] = phoneme.match(featureMatch) || [ null ];\n if (features) {\n doesFeatureRuleContainUnknownToken(features)\n return features\n .trim()\n .match(/\\w+/g)\n .reduce(reduceFeaturesToBoolean(featureBoolean), {})\n }\n return {}\n } catch (err) {\n throw err;\n }\n}\n\nconst mapToPositiveAndNegativeFeatures = phoneme => (\n { ...getFeatures(phoneme, true), ...getFeatures(phoneme, false) } )\n\nconst mapStringToFeatures = (ruleString, phones) => {\n if (ruleString) {\n if (ruleString === '.') return [];\n if (ruleString === '#') return ['#']\n if (ruleString === '0') return [];\n const ruleBrackets = ruleString.match(/\\[.*\\]/)\n try {\n if (ruleBrackets) {\n return ruleString\n .split('[')\n // filter out empty strings\n .filter(v => v)\n .map(mapToPositiveAndNegativeFeatures)\n }\n return findFeaturesFromGrapheme(phones, ruleString);\n } catch (err) {\n throw err;\n }\n }\n return {};\n}\n\nconst mapRuleBundleToFeatureBundle = phones => ( ruleBundle, index ) => {\n // for each object in ruleBundle, map values to array of objects with feature-boolean key-value pairs\n try {\n const { newFeatures, environment:{ pre, position, post } } = ruleBundle;\n return {\n environment: {\n pre: mapStringToFeatures(pre, phones),\n position: mapStringToFeatures(position, phones),\n post: mapStringToFeatures(post, phones),\n },\n newFeatures: mapStringToFeatures(newFeatures, phones)\n }\n } catch (err) {\n throw errorMessage`Error in line ${index + 1}: ${err}`;\n }\n}\n\nexport const decomposeRules = (epoch: epochType, phones: {[key: string]: phoneType}): decomposedRulesType => {\n const { changes } = epoch\n try {\n return changes\n .map(decomposeRule)\n .map(mapRuleBundleToFeatureBundle(phones));\n } catch (err) {\n const ruleError = {epoch: epoch.name, error: err}\n throw ruleError;\n }\n}\n\nconst isPhonemeBoundByRule = phonemeFeatures => (ruleFeature, index) => {\n const phoneme = phonemeFeatures[index].features;\n return Object.entries(ruleFeature).reduce((bool, [feature, value]) => {\n if (!bool) return false;\n if (!phoneme.hasOwnProperty(feature)) return false;\n if (!phoneme[feature] && !value) return true;\n if (phoneme[feature] !== value) return false;\n return true;\n }, true);\n} \n\nconst isEnvironmentBoundByRule = (phonemeFeatures, ruleFeatures) => {\n if (!ruleFeatures) return true;\n return ruleFeatures.filter(isPhonemeBoundByRule(phonemeFeatures)).length === ruleFeatures.length;\n}\n\nconst getEntries = object => Object.entries(object);\nconst isObjectWithPropertyInArray = (array, property) => candidate => array.map(getProperty(property)).includes(candidate[property]);\nconst transformFeatureValues = features => ([newFeature, newValue]) => features[newFeature][newValue ? 'positive': 'negative'];\nconst reduceFeatureValues = (newPhoneme, [newFeature, newValue]) => ({ ...newPhoneme, [newFeature]: newValue })\n\nconst transformPhoneme = (phoneme, newFeatures, features) => {\n if (!newFeatures) return {}\n const newPhonemeFeatures = getEntries(newFeatures).reduce(reduceFeatureValues, {...phoneme.features});\n const newPhonemeCandidates = getEntries(newPhonemeFeatures).map(transformFeatureValues(features));\n return newPhonemeCandidates\n .reduce((candidates, candidatesSubset, index, array) => candidates.filter(isObjectWithPropertyInArray(candidatesSubset, 'grapheme'))\n , newPhonemeCandidates[newPhonemeCandidates.length - 1])[0];\n}\n\nconst transformLexemeInitial = (newLexeme, pre, post, position, phoneme, index, lexemeBundle, newFeatures, features) => {\n if (index !== pre.length - 1) return [...newLexeme, phoneme];\n if (!isEnvironmentBoundByRule([phoneme], position)) return [...newLexeme, phoneme];\n if (!isEnvironmentBoundByRule(lexemeBundle.slice(index + position.length, index + post.length + position.length), post)) return [...newLexeme, phoneme];\n const newPhoneme = transformPhoneme(phoneme, newFeatures[0], features);\n // if deletion occurs\n if (!newPhoneme.grapheme) return [ ...newLexeme] ;\n return [...newLexeme, newPhoneme];\n}\n\nconst transformLexemeCoda = (newLexeme, pre, post, position, phoneme, index, lexemeBundle, newFeatures, features) => {\n if (index + post.length !== lexemeBundle.length) return [...newLexeme, phoneme];\n if (!isEnvironmentBoundByRule(lexemeBundle.slice(index - pre.length, index), pre)) return [...newLexeme, phoneme];\n if (!isEnvironmentBoundByRule([phoneme], position)) return [...newLexeme, phoneme];\n const newPhoneme = transformPhoneme(phoneme, newFeatures[0], features);\n // if deletion occurs\n if (!newPhoneme.grapheme) return [ ...newLexeme] ;\n return [...newLexeme, newPhoneme];\n}\n\nexport const transformLexeme = (lexemeBundle, rule, features) => {\n const {pre, post, position} = rule.environment;\n const newLexeme = lexemeBundle.reduce((newLexeme, phoneme, index) => {\n if (pre.find(val => val === '#')) return transformLexemeInitial(newLexeme, pre, post, position, phoneme, index, lexemeBundle, rule.newFeatures, features);\n if (post.find(val => val === '#')) return transformLexemeCoda(newLexeme, pre, post, position, phoneme, index, lexemeBundle, rule.newFeatures, features);\n if ( index < pre.length || index >= lexemeBundle.length - post.length ) return [...newLexeme, phoneme];\n if (!isEnvironmentBoundByRule(lexemeBundle.slice(index - pre.length, index), pre)) return [...newLexeme, phoneme];\n if (!isEnvironmentBoundByRule([phoneme], position)) return [...newLexeme, phoneme];\n if (!isEnvironmentBoundByRule(lexemeBundle.slice(index, index + post.length), post)) return [...newLexeme, phoneme];\n const newPhoneme = transformPhoneme(phoneme, rule.newFeatures[0], features);\n // if deletion occurs\n if (!newPhoneme || !newPhoneme.grapheme) return [ ...newLexeme] ;\n return [...newLexeme, newPhoneme];\n }, [])\n return newLexeme;\n}\n\nconst formBundleFromLexicon = lexicon => phones => lexicon.map(({lexeme}) => findFeaturesFromLexeme(phones, lexeme))\n\nconst transformLexicon = lexiconBundle => \n ruleBundle => \n features => \n lexiconBundle.map(lexemeBundle => ruleBundle.reduce(\n (lexeme, rule, i) => transformLexeme(lexeme, rule, features)\n , lexemeBundle\n ))\n\nconst getGraphemeFromEntry = ([_, phoneme]) => phoneme.grapheme\nconst stringifyLexeme = (lexeme) => lexeme.map(getProperty('grapheme')).join('')\nconst stringifyResults = ({lexicon, ...passResults}) => ({...passResults, lexicon: lexicon.map(stringifyLexeme)})\n\nexport const run = (state: stateType, action: resultsAction): stateType => {\n\n // TODO iterate through each epoch\n try {\n const passResults = state.epochs.reduce((results, epoch, _) => {\n const { phones, features, lexicon } = state;\n let lexiconBundle;\n if ( epoch.parent ) {\n lexiconBundle = results.find(result => result.pass === epoch.parent).lexicon\n }\n if (!epoch.parent) {\n lexiconBundle = formBundleFromLexicon(lexicon)(phones); \n }\n const ruleBundle = decomposeRules(epoch, phones);\n const passResults = transformLexicon(lexiconBundle)(ruleBundle)(features)\n const pass = { pass: epoch.name, lexicon: passResults }\n if ( epoch.parent ) pass.parent = epoch.parent;\n return [...results, pass];\n }, []);\n \n const results = passResults.map(stringifyResults);\n return {...state, results, errors: {} }\n } catch (err) {\n console.log(err)\n return {...state, errors: err, results:[] };\n }\n}","// @flow\nimport type { stateType } from './reducer';\n\nexport type initAction = {\n type: \"INIT\"\n}\n\nexport const initState = (changesArgument: number): stateType => {\n const state = {\n epochs: [\n {\n name: 'epoch 1',\n changes: [\n '[+ occlusive - nasal]>[+ occlusive + nasal]/n_.',\n 'a>ɯ/._#',\n '[+ sonorant - low rounded high back]>0/._.',\n '[+ obstruent]>[+ obstruent aspirated ]/#_.',\n '[+ sonorant - rounded]>[+ sonorant + rounded]/._#',\n // 'at>ta/._#'\n ]\n }\n ],\n phones: {\n a: {\n grapheme: 'a', features: {\n sonorant: true, back: true, low: true, high: false, rounded: false\n }\n },\n u: {\n grapheme: 'u', features: {\n sonorant: true, back: true, low: false, high: true, rounded: true, \n }\n },\n ɯ: {\n grapheme: 'ɯ', features: {\n sonorant: true, back: true, low: false, high: true, rounded: false,\n }\n },\n ə: {\n grapheme: 'ə', features: {\n sonorant: true, low: false, rounded: false, high: false, back: false\n }\n },\n t: {\n grapheme: 't', features: {\n occlusive: true, coronal: true, obstruent: true, nasal: false\n },\n ʰ: {\n grapheme: 'tʰ', features: {\n occlusive: true, coronal: true, obstruent: true, aspirated: true\n }\n }\n },\n n: {\n grapheme: 'n', features: {\n sonorant: true, nasal: true, occlusive: true, coronal: true\n }\n }\n },\n options: {\n output: 'default', save: false\n },\n results: [],\n errors: {},\n features: {},\n lexicon: []\n };\n state.features = {\n sonorant: { positive:[ state.phones.a, state.phones.u, state.phones.ɯ, state.phones.ə, state.phones.n], negative: [] },\n back: { positive:[ state.phones.a, state.phones.u, state.phones.ɯ ], negative: [ state.phones.ə ] },\n low: { positive:[ state.phones.a ], negative: [ state.phones.u, state.phones.ɯ, state.phones.ə ] },\n high: { positive:[ state.phones.u, state.phones.ɯ ], negative: [ state.phones.a, state.phones.ə ] },\n rounded: { positive:[ state.phones.u ], negative: [ state.phones.a, state.phones.ɯ, state.phones.ə ] },\n occlusive: { positive:[ state.phones.t, state.phones.n, state.phones.t.ʰ ], negative: [] },\n coronal: { positive:[ state.phones.t, state.phones.n, state.phones.t.ʰ ], negative: [] },\n obstruent: { positive:[ state.phones.t, state.phones.n, state.phones.t.ʰ ], negative: [] },\n nasal: { positive:[ state.phones.n ], negative: [state.phones.t, state.phones.t.ʰ] },\n aspirated: { positive:[ state.phones.t.ʰ ], negative: [ state.phones.t ] },\n }\n state.lexicon = [\n {lexeme: 'anta', epoch: state.epochs[0]}, \n {lexeme: 'anat', epoch: state.epochs[0]},\n {lexeme: 'anət', epoch: state.epochs[0]},\n {lexeme: 'anna', epoch: state.epochs[0]}, \n {lexeme: 'tan', epoch: state.epochs[0]},\n {lexeme: 'ənta', epoch: state.epochs[0]}\n ]\n\n if(changesArgument > -1) state.epochs[0].changes = state.epochs[0].changes.splice(0, changesArgument)\n\n return state;\n}","// @flow\nimport { addLexeme, setLexicon } from './reducer.lexicon';\nimport type { lexiconAction } from './reducer.lexicon';\nimport { addEpoch, setEpoch, removeEpoch } from './reducer.epochs';\nimport type { epochAction } from './reducer.epochs';\nimport { addFeature, deleteFeature } from './reducer.features';\nimport type { featureAction } from './reducer.features';\nimport type { optionsAction } from './reducer.options';\nimport { setOptions } from './reducer.options';\nimport { run } from './reducer.results';\nimport type { resultsAction } from './reducer.results'\nimport { initState } from './reducer.init';\nimport type { initAction } from './reducer.init';\nimport { clearOutput } from './reducer.clear';\n\nexport type stateType = {\n lexicon: Array<{lexeme: string, epoch: epochType}>,\n epochs: Array,\n phones: {[key: string]: phoneType},\n options: {output: string, save: boolean},\n results: [],\n errors: {},\n features: featureType\n}\n\ntype epochType = {\n name: string, changes: Array\n}\n\ntype phoneType = {\n grapheme: string,\n features: {[key: string]: boolean}\n}\n\ntype featureType = {\n [key: string]: {[key: string]: Array}\n}\n\ntype actionType = featureAction | epochAction | initAction | resultsAction | lexiconAction\n\nexport const stateReducer = (state: stateType, action: actionType): stateType => {\n switch (action.type) {\n case 'INIT': {\n return initState();\n }\n \n case 'ADD_LEXEME': return addLexeme(state, action);\n \n case 'SET_LEXICON': return setLexicon(state, action);\n\n case 'ADD_EPOCH': return addEpoch(state, action);\n\n case 'SET_EPOCH': return setEpoch(state, action);\n\n case 'REMOVE_EPOCH': return removeEpoch(state, action);\n\n case 'ADD_FEATURE': return addFeature(state, action);\n\n case 'DELETE_FEATURE': return deleteFeature(state, action);\n\n case 'SET_OPTIONS': return setOptions(state, action);\n\n case 'CLEAR': return clearOutput(state, action);\n\n case 'RUN': return run(state, action);\n\n default: return state;\n }\n}\n","// @flow\nimport type { stateType } from './reducer';\n\nexport type epochAction = {\n type: \"ADD_EPOCH\" | \"SET_EPOCH\" | \"REMOVE_EPOCH\",\n value: {\n index?: number,\n name: string,\n changes?: Array,\n parent?: string\n }\n}\n\nexport const addEpoch = (state: stateType, action: epochAction): stateType => {\n const newEpoch = { name: action.value.name, changes: action.value.changes || [''], parent: null};\n return {...state, epochs: [...state.epochs, newEpoch]}\n}\n\nexport const setEpoch = (state: stateType, action: epochAction): stateType => {\n const index = action.value.index;\n if (typeof index !== 'number') return state;\n \n const mutatedEpochs = state.epochs;\n mutatedEpochs[index].name = action.value.name \n ? action.value.name \n : mutatedEpochs[index].name;\n\n mutatedEpochs[index].changes = action.value.changes \n ? action.value.changes \n : mutatedEpochs[index].changes;\n\n mutatedEpochs[index].parent = action.value.parent && action.value.parent !== 'none'\n ? action.value.parent\n : null\n return {...state, epochs: [...mutatedEpochs]}\n}\n\nexport const removeEpoch = (state: stateType, action: epochAction): stateType => {\n const mutatedEpochs = state.epochs.filter(epoch => epoch.name !== action.value.name )\n return {...state, epochs: [...mutatedEpochs]}\n}","// @flow\nimport type { stateType } from './reducer';\n\nexport type optionAction = {\n type: 'SET_OPTIONS',\n value: {\n option: string,\n setValue: string\n }\n};\n\nexport const setOptions = (state: stateType, action: optionAction): stateType => {\n const option = action.value.option;\n let value = action.value.setValue;\n if (value === 'true') value = true;\n if (value === 'false') value = false;\n const mutatedState = {...state};\n mutatedState.options[option] = value;\n return mutatedState;\n}","export const clearOutput = (state, action) => {\n return { ...state, results: [], errors: {} };\n}","import React, { useState, useReducer } from 'react';\nimport './PhonoChangeApplier.scss';\n\nimport ProtoLang from './components/ProtoLang';\nimport Features from './components/Features';\nimport Epochs from './components/Epochs';\nimport Options from './components/Options';\nimport Output from './components/Output';\n\nimport { stateReducer } from './reducers/reducer';\nimport { initState } from './reducers/reducer.init';\n\nconst PhonoChangeApplier = () => {\n const [ state, dispatch ] = useReducer(\n stateReducer,\n {},\n initState\n )\n const { lexicon, phones, phonemes, epochs, options, features, results, errors } = state;\n\n return (\n \n );\n}\n\nexport default PhonoChangeApplier;","import React from 'react';\nimport './App.css';\nimport PhonoChangeApplier from './PhonoChangeApplier';\n\nfunction App() {\n return (\n \n
Phono Change Applier
\n
\n
\n );\n}\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.scss';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}
\ No newline at end of file