feature-change-applier/static/js/main.e83b5fcd.chunk.js.map
2020-02-27 14:50:47 -08:00

1 line
No EOL
64 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"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","removeEpoch","epochs","changes","parent","setEpoch","changeHandler","cb","updateEpoch","useEffect","renderOptionFromEpoch","thisEpoch","replaceCurrentEpoch","isViableParent","list","filter","change","onSubmit","Epochs","epochName","dispatchValue","renderAddEpochButton","length","addEpoch","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","errors","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,OAFM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kB","file":"static/js/main.e83b5fcd.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 <div className=\"ProtoLang\" data-testid=\"ProtoLang\">\n <h3>Proto Language Lexicon</h3>\n <br />\n <form data-testid=\"ProtoLang-Lexicon\">\n <textarea\n name=\"lexicon\" \n cols=\"30\"\n rows=\"10\"\n data-testid=\"ProtoLang-Lexicon__textarea\"\n value={renderLexicon()}\n onChange={e=> {\n console.log(e.target.value.split(/\\n/).map(line => {\n const lexeme = line.split('#')[0].trim();\n const epoch = line.split('#')[1] || '';\n return { lexeme, epoch }\n }))\n dispatch({\n type: 'SET_LEXICON', \n value: e.target.value.split(/\\n/).map(line => {\n const lexeme = line.split('#')[0].trim();\n const epoch = line.split('#')[1] || '';\n return { lexeme, epoch }\n })\n })\n }\n }>\n </textarea>\n </form>\n </div>\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 <li key={`feature__${featureName}`}>\n <span className=\"feature--names-and-phones\">\n <span className=\"feature--feature-name\"> \n {`[+ ${featureName}]`}\n </span>\n <span className=\"feature--feature-phones\">\n {plus}\n </span>\n </span>\n <span className=\"feature--names-and-phones\">\n <span className=\"feature--feature-name\"> \n {`[- ${featureName}]`}\n </span>\n <span className=\"feature--feature-phones\">\n {minus}\n </span>\n </span>\n </li>\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 <div className=\"Features\" data-testid=\"Features\">\n \n <h3>Phonetic Features</h3>\n \n <ul className=\"Features__list\" data-testid=\"Features-list\">\n {phones ? <>{parsePhonesFromFeatureObject(features)}</> : <></>}\n </ul>\n\n <form className=\"Features__form\" data-testid=\"Features-form\">\n <input \n type=\"text\" name=\"feature\" \n value={feature} onChange={e=> setFeature(e.target.value)}\n ></input>\n\n {/* ! Positive Phones */}\n <label htmlFor=\"positive-phones\">+\n <input \n id=\"positive-phones\"\n type=\"text\" name=\"phonemes\" \n value={newPositivePhones} onChange={e=> setNewPositivePhones(e.target.value)}\n ></input>\n </label>\n \n {/* ! Negative Phones */}\n <label htmlFor=\"negative-phones\">-\n <input \n id=\"negative-phones\"\n type=\"text\" name=\"phonemes\" \n value={newNegativePhones} onChange={e=> setNewNegativePhones(e.target.value)}\n ></input>\n </label>\n\n <input \n type=\"submit\" \n onClick={e => handleClickDispatch(e)(dispatch)(buildAddFeatureAction)([newPositivePhones, newNegativePhones, feature])} \n value=\"Add feature\"\n ></input>\n </form>\n\n </div>\n );\n}\n\nexport default Features;","import React, { useState, useEffect } from 'react';\nimport './SoundChangeSuite.scss';\n\nconst SoundChangeSuite = props => {\n const { epochIndex, 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 <option \n key={`${epoch.name}__parent-option--${thisEpoch.name}`}\n value={thisEpoch.name}\n >\n {thisEpoch.name}\n </option>\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 <label htmlFor={`${epoch.name}-parent`}>\n Parent Epoch:\n </label>\n <select \n name=\"parent\"\n list={`${epoch.name}-parents-list`}\n value={epoch.parent}\n onChange={e=>changeHandler(\n e, ()=>{\n setEpoch({...epoch, parent:e.target.value})\n })\n }\n >\n {parentsOptions()}\n </select>\n </>\n )\n return <></>\n }\n\n return (\n <>\n <h4>{epoch.name}</h4>\n <form className=\"SoundChangeSuite__form\" data-testid={`${epoch.name}_SoundChangeSuite_changes`}>\n <label htmlFor={`${epoch.name}-name`}>\n Name: \n </label>\n <input type=\"text\" \n name=\"epoch\" \n id={`${epoch.name}-name`} cols=\"30\" rows=\"1\" \n value={epoch.name} \n onChange={e=>changeHandler(\n e, () => {\n setEpoch({...epoch, name:e.target.value})\n }\n )} \n ></input>\n {renderParentInput()}\n \n <textarea \n name=\"changes\" \n id=\"\" cols=\"30\" rows=\"10\" \n value={epoch.changes.join('\\n')} \n onChange={e=> changeHandler(\n e, ()=>setEpoch(\n {...epoch, changes:e.target.value.split(/\\n/).map(change=>change === ' ' \n ? '[+ feature]>[- feature]/_#' \n : change\n )}\n )\n )}\n ></textarea>\n </form>\n <form onSubmit={e=>removeEpoch(e, epoch.name)}>\n <input type=\"submit\" name=\"remove-epoch\" value={`remove ${epoch.name}`}></input>\n </form>\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, 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 <form onSubmit={e=>addEpoch(e)}>\n <input type=\"submit\" name=\"add-epoch\" value=\"Add Epoch\" ></input>\n </form>\n )\n return <></>\n }\n\n const renderEpochs = () => {\n if (epochs.length) return epochs.map((epoch, index) => (\n <div \n className=\"SoundChangeSuite\" \n data-testid={`${epoch.name}_SoundChangeSuite`}\n key={`epoch-${index}`}\n >\n <SoundChangeSuite \n epochIndex={index} epoch={epoch} \n updateEpoch={updateEpoch} removeEpoch={removeEpoch}\n epochs={epochs}\n // error={errors[epoch.name]}\n />\n {renderAddEpochButton(index)}\n </div>\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 <div className=\"Options\" data-testid=\"Options\">\n <h3>Modeling Options</h3>\n\n <form onSubmit={e=>handleFormSubmit(e, options)} data-testid=\"Options-form\">\n \n {/* <h5>Output</h5> */}\n\n <input \n type=\"radio\" name=\"output\" id=\"default\" \n checked={options ? options.output === 'default' : true}\n onChange={e=>handleRadioChange(e)}\n />\n <label htmlFor=\"default\">Default \n <span className=\"Options__output-example\"> output</span>\n </label>\n \n <input \n type=\"radio\" name=\"output\" id=\"proto\" \n checked={options ? options.output === 'proto' : false}\n onChange={e=>handleRadioChange(e)}\n />\n <label htmlFor=\"proto\">Proto \n <span className=\"Options__output-example\"> output [proto]</span>\n </label>\n \n <input \n type=\"radio\" name=\"output\" id=\"diachronic\" \n checked={options ? options.output === 'diachronic' : false}\n onChange={e=>handleRadioChange(e)}\n />\n <label htmlFor=\"diachronic\">Diachronic \n <span className=\"Options__output-example\"> *proto > *epoch > output</span>\n </label>\n \n <input type=\"submit\" value=\"Run Changes\"></input>\n </form>\n\n\n <form onSubmit={()=>{}}>\n <label>\n Load from a prior run:\n <select value={load} onChange={e=>setLoad(e.target.value)}>\n {localStorage.phonoChange \n ? ls.get('phonoChange').map(priorRun => {\n return <option key={priorRun.name} value={priorRun.name}>{priorRun.name}</option>\n }\n ) : <></>}\n </select>\n </label>\n <input type=\"submit\" value=\"Submit\" />\n </form>\n </div>\n );\n}\n\nexport default Options;","import React from 'react';\nimport './Output.scss';\n\nconst Output = props => {\n const { results, options } = 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) => <span key={`${epoch.pass}-${i}`}>{lexeme}</span>);\n return (\n <div key={`epoch-${i}`} className=\"Output-epoch\">\n <h5>{epoch.pass}</h5>\n <p className=\"lexicon\">{lexicon}</p>\n </div>\n )\n })\n }\n return (\n <div className=\"Output\" data-testid=\"Output\">\n <h3>Results of Run</h3>\n\n <div data-testid=\"Output-lexicon\" className=\"Output__container\">\n {results && results.length ? renderResults() : <></>}\n </div>\n </div>\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<lexemeType>\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<string>,\n negativePhones: Array<string>,\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 return err;\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 }\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<epochType>,\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<string>\n}\n\ntype phoneType = {\n grapheme: string,\n features: {[key: string]: boolean}\n}\n\ntype featureType = {\n [key: string]: {[key: string]: Array<phoneType>}\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<string>,\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 || [''] };\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 } = state;\n\n return (\n <div className=\"PhonoChangeApplier\" data-testid=\"PhonoChangeApplier\">\n <ProtoLang lexicon={lexicon} dispatch={dispatch}/>\n <Features phones={phones} features={features} dispatch={dispatch}/>\n <Epochs epochs={epochs} dispatch={dispatch} />\n <Options options={options} dispatch={dispatch}/>\n <Output results={results} options={options} dispatch={dispatch}/>\n </div>\n );\n}\n\nexport default PhonoChangeApplier;","import React from 'react';\nimport './App.css';\nimport PhonoChangeApplier from './PhonoChangeApplier';\n\nfunction App() {\n return (\n <div className=\"App\" data-testid=\"App\">\n <h1>Phono Change Applier</h1>\n <PhonoChangeApplier />\n </div>\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(<App />, 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":""}