Package: dmengine
DM-engine is a Python implementation ofDistributed Morphology(DM).Distributed Morphology is a framework from theoretical linguistics that is used
to describe the morphology (word structure) of natural languages. This package
provides an engine that calculates the word forms that are generated by a given
DM analysis.Analyses are entered as plain-text files in the human-friendlyYAMLformat.
Minimally, they consist of atitle, an inventory offeature values, a
list of insertablevocabulary items(VIs), and a list ofinputsto be
processed (see the example below). Thedmenginecommand-line tool calculates
the results and generates a detailed transcript of all calculations for later
inspection. The resulting YAML file can be converted into a LaTeX-based report
that can directly be compiled into a PDF file.LinksGitHub:https://github.com/xflr6/dmenginePyPI:https://pypi.org/project/dmengine/Issue Tracker:https://github.com/xflr6/dmengine/issuesDownload:https://pypi.org/project/dmengine/#filesInstallationThis package runs under Python 3.7+, usepipto install:$pipinstalldmengineThis will also install thePyYAMLandosetpackages from PyPI as required
dependencies.Converting the results to aPDF reportalso requires aLaTeX
distribution(TeX LiveandMikTeXshould work). Make sure its executables
are on your systems’ path.UsageCreate aplain text filethat defines your analysis:# example.yaml - simple demonstration of the analysis definition syntaxtitle:English verbal agreementfeatures:-value:Vcategory:pos-value:Nomcategory:case-value:+1category:person-value:+2category:person-value:+3category:person-value:-plcategory:number-value:+plcategory:numbervis:-exponent:sleepfeatures:[V]-exponent:-sfeatures:[Nom,+3,-pl]-exponent:-Øfeatures:[Nom]paradigms:-name:Intransitive paradigmheaders:[[1,2,3],[sg,pl]]inputs:-[[V],[Nom,+1,-pl]]-[[V],[Nom,+1,+pl]]-[[V],[Nom,+2,-pl]]-[[V],[Nom,+2,+pl]]-[[V],[Nom,+3,-pl]]-[[V],[Nom,+3,+pl]]Save your analysis definition to a file ending with.yaml(e.g.example.yaml).Open a shell (command line window) and navigate to the directory of your
definition file.Calculate the results of the analyis with thedmenginecommand creating a
PDF report:$dmengineexample.yaml--pdfThis will create three files:example-results.yaml– plain-text file with the results in YAML formatexample-results.tex– LaTeX source for the result reportexample-results.pdf– PDF output of the report compiled withpdflatexResultsGo to theoutputs sectionof the report. It provides aparadigm tableof the calculated results:Thelog sectionof the report contains detailed information about each
individual input and thederivation of the output.Invocation optionsCheck theusageof thedmenginecommand:$dmengine--helpusage:dmengine[-h][--version][--report][--pdf][--view]filename[directory]CalculatesagivenDistributedMorphology(DM)analysispositionalarguments:filenamedmanalysis.yamldefinitionfiledirectoryanalysisresultsoutputdirectoryoptionalarguments:-h,--helpshowthishelpmessageandexit--versionshowprogram'sversionnumberandexit--reportcreateaLaTeXreportfromtheresults--pdfrenderthereporttoPDF(implies--report)--viewopenthereportinviewerapp(implies--pdf)RulesAnalyses can use the following types ofrulesthat manipulate the inputbeforeinsertion:impoverishment– feature deletionobliteration– head removalfission– head feature extractionfusion– head mergingcopy– head duplicationadd– features additionmetathesis– head position swappingThe following types ofreadjustment rulesare supported (manipulating  the
outputafterinsertion):delete– exponent removalcopy– exponent duplicationmetathesis– exponent position swappingtransform– regular expression search & replaceContextsThe insertion of vocabulary items and the application of pre-insertion rules can
be restricted to the following context types:this_head– the processed head must have the featuresleft_head– the left-adjacent head must have the featuresright_head– the right-adjacent head must have the featuresany_head– any input head must have the featuresanywhere– features must be matched somewhere in the inputTODOcheck expected spell-out for each inputdelete_matching: yes/nodelete_other: all, given, noneset_delete: global, slot, viSee alsoRaphael Finkel providesweb-based enginesfor calculating Paradigm Function
Morphology and Network Morphology analyses.Licensedmengineis distributed under theMIT license.