3
V'íc
1 ã @ sb d Z ddlmZmZmZmZ ddlmZmZm Z m
Z
mZmZm
Z
mZmZ dgZG dd deZdS )z¾
pygments.lexers.praat
~~~~~~~~~~~~~~~~~~~~~
Lexer for Praat
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
é )Ú
RegexLexerÚwordsÚbygroupsÚinclude) ÚNameÚTextÚCommentÚKeywordÚStringÚPunctuationÚNumberÚOperatorÚ
WhitespaceÚ
PraatLexerc @ s e Zd ZdZdZdZdgZdddgZd´ZdµZ d¶Z
d·Zd¸Zd¹Z
dºZd»Zdgeeejfdhejfdiejfdjefdkedlfdmednfdoejdnfedpeedqdrefdseeeedtfdueeedvfdweeeejfedxeddyed8feedzdrejdvfd{ed|fd}efgd~efedded¼fded½fd
edfgdjefdeejeejedfdejd¾fgd
efdeejedfdeejedfgee ddrejdfeeddrejdfee
ddrejdfgdjefded¿fdedÀfgdeeefdeeeedfdjefdyed8fdefedpedxededdefdefgdedfedxededdyed8fdefgdedfdefgeddejfeeddejdfdejfdedfgededeeddrej j!fee
ddrej j!feedqddeejejd fd¡efd¢edfedgd£e"fd¤e"j#fgd¥ej$fgd¦eeefdedfd
efedd§efd¨efgd¦eeefdyedfedd§efd©efgdgeeejfdjefdªeeeeeedfd«eeedvfd¬eeeedvfdeeeeeeeefd®eeeej fd¯eeee"efd°eeedvfd±edfg
d²Z%d³S (Á r z7
For Praat scripts.
.. versionadded:: 2.1
ZPraatzhttp://www.praat.orgZpraatz*.praatz*.procz*.pscÚifÚthenÚelseÚelsifÚelifÚendifÚfiÚforÚfromÚtoÚendforÚendprocÚwhileÚendwhileÚrepeatÚuntilÚselectÚplusÚminusÚdemoÚassertÚ stopwatchÚnocheckÚnowarnÚ
noprogressÚeditorÚ endeditorÚ clearinfoÚbackslashTrigraphsToUnicodeÚchooseDirectoryÚchooseReadFileÚchooseWriteFileÚdateÚdemoKeyÚdoÚenvironmentÚextractLineÚextractWordÚfixedÚinfoÚleftÚmidÚpercentÚreadFileÚreplaceÚ
replace_regexÚrightÚselectedÚstringÚunicodeToBackslashTrigraphsÚabsÚ
appendFileÚappendFileLineÚ
appendInfoÚappendInfoLineÚarccosÚarccoshÚarcsinÚarcsinhÚarctanÚarctan2ÚarctanhÚbarkToHertzÚ
beginPauseÚbeginSendPraatÚbesselIÚbesselKÚbetaÚbeta2Ú binomialPÚ binomialQÚbooleanÚceilingÚ
chiSquarePÚ
chiSquareQÚchoiceÚcommentÚcosÚcoshÚcreateDirectoryÚ
deleteFileÚdemoClickedÚ
demoClickedInÚdemoCommandKeyPressedÚdemoExtraControlKeyPressedÚ demoInputÚdemoKeyPressedÚdemoOptionKeyPressedÚdemoShiftKeyPressedÚdemoShowÚdemoWaitForInputÚdemoWindowTitleÚdemoXÚdemoYÚdifferenceLimensToPhonÚendPauseÚendSendPraatÚendsWithÚerbÚ
erbToHertzÚerfÚerfcÚ
exitScriptÚexpÚ
extractNumberÚfileReadableÚfisherPÚfisherQÚfloorÚgaussPÚgaussQÚhertzToBarkÚ
hertzToErbÚ
hertzToMelÚhertzToSemitonesÚimaxÚiminÚincompleteBetaÚincompleteGammaPÚindexÚindex_regexÚintegerÚinvBinomialPÚinvBinomialQÚ
invChiSquareQÚ
invFisherQÚ invGaussQÚ
invSigmoidÚinvStudentQÚlengthÚlnÚlnBetaÚlnGammaÚlog10Úlog2ÚmaxÚ
melToHertzÚminÚminusObjectÚnaturalÚnumberÚnumberOfColumnsÚnumberOfRowsÚnumberOfSelectedÚobjectsAreIdenticalÚoptionÚ
optionMenuÚpauseScriptÚphonToDifferenceLimensÚ
plusObjectÚpositiveÚrandomBinomialÚrandomGaussÚ
randomIntegerÚ
randomPoissonÚ
randomUniformÚrealÚremoveObjectÚrindexÚrindex_regexÚroundÚ runScriptÚ runSystemÚrunSystem_nocheckÚselectObjectÚsemitonesToHertzÚsentenceÚsentencetextÚsigmoidÚsinÚsincÚsincpiÚsinhÚsoundPressureToPhonÚsqrtÚ
startsWithÚstudentPÚstudentQÚtanÚtanhÚtextÚvariableExistsÚwordÚ writeFileÚ
writeFileLineÚ writeInfoÚ
writeInfoLineÚlinearÚzeroÚ
ActivationÚAffineTransformÚ
AmplitudeTierÚArtÚArtwordÚAutosegmentÚ
BarkFilterÚBarkSpectrogramÚCCAÚ
CategoriesÚCepstrogramÚCepstrumÚ CepstrumcÚChebyshevSeriesÚClassificationTableÚCochleagramÚ
CollectionÚComplexSpectrogramÚ
ConfigurationÚ ConfusionÚContingencyTableÚCorpusÚCorrelationÚ
CovarianceÚCrossCorrelationTableÚCrossCorrelationTablesÚDTWÚDataModelerÚDiagonalizerÚDiscriminantÚ
DissimilarityÚDistanceÚ
DistributionsÚDurationTierÚEEGÚERPÚERPTierÚEditCostsTableÚEditDistanceTableÚEigenÚ
ExcitationÚExcitationsÚ
ExperimentMFCÚFFNetÚFeatureWeightsÚFileInMemoryÚ
FilesInMemoryÚFormantÚ
FormantFilterÚFormantGridÚFormantModelerÚFormantPointÚFormantTierÚGaussianMixtureÚHMMÚHMM_ObservationÚHMM_ObservationSequenceÚ HMM_StateÚHMM_StateSequenceÚHarmonicityÚISplineÚIndexÚ IntensityÚ
IntensityTierÚIntervalTierÚKNNÚ KlattGridÚ
KlattTableÚLFCCÚLPCÚLabelÚLegendreSeriesÚLinearRegressionÚLogisticRegressionÚ LongSoundÚLtasÚMFCCÚMSplineÚManPagesÚManipulationÚMatrixÚ MelFilterÚMelSpectrogramÚMixingMatrixÚMovieÚNetworkÚObjectÚ OTGrammarÚ OTHistoryÚOTMultiÚPCAÚPairDistributionÚ
ParamCurveÚPatternÚPermutationÚPhotoÚPitchÚPitchModelerÚ PitchTierÚPointProcessÚPolygonÚ
PolynomialÚPowerCepstrogramÚ
PowerCepstrumÚ
ProcrustesÚ RealPointÚRealTierÚ
ResultsMFCÚRootsÚSPINETÚSSCPÚSVDÚSalienceÚ
ScalarProductÚ
SimilarityÚSimpleStringÚSortedSetOfStringÚSoundÚSpeakerÚSpectrogramÚSpectrumÚSpectrumTierÚSpeechSynthesizerÚSpellingCheckerÚStringsÚStringsIndexÚTableÚTableOfRealÚTextGridÚTextIntervalÚ TextPointÚTextTierÚTierÚ
TransitionÚ
VocalTractÚVocalTractTierÚWeightÚWordListÚ macintoshÚwindowsÚunixÚpraatVersionÚpiÚeÚ undefinedÚtabÚshellDirectoryÚ
homeDirectoryÚpreferencesDirectoryÚnewlineÚtemporaryDirectoryÚdefaultDirectoryÚncolÚnrowÚxminÚyminÚxmaxÚymaxÚnxÚnyÚdxÚdyz(\s+)(#.*?$)z^#.*?$z;[^\n]*z\s+z
\bprocedure\bÚprocedure_definitionz\bcall\bÚprocedure_callú@Ú
function_callz\b)Úsuffixz(\bform\b)(\s+)([^\n]+)Úold_formzn(print(?:line|tab)?|echo|exit|asserterror|pause|send(?:praat|socket)|include|execute|system(?:_nocheck)?)(\s+)Ústring_unquotedz(goto|label)(\s+)(\w+)Ú
variable_nameú"z(?=\s+\S+\n)z\b[A-Z]Úcommandz
(\.{3}|[)(,])z( ?[\w()-]+ ?)Ústring_interpolatedz\.{3}ú#popÚ
old_argumentsú:Ú
comma_listz\sz([\w.]+)(?:(:)|(?:(\s*)(\()))z([\w.]+)z([\w.]+)(\s*?[(:])z([\w.]+)([^\n]*)z
\$(?=\s*[:(])Úfunctionz#(?=\s*[:(])z(?=\s*[:(])z\s*\(z(\s*\n\s*)(\.{3})z(\s*)(?:([)\]])|(\n))z\b(if|then|else|fi|endif)\bÚoperatorz[()]ú,z\nz[^\n]z\b\d+(\.\d*)?([eE][-+]?\d+)?%?z([a-z][a-zA-Z0-9_]*|\d+)z\.)Úprefixz\$z\[z"(?=[^a-zA-Z0-9_."\'$#\[:(]|\s|^|$)z(_))r rs Úobject_referencez\.?_?[a-z][\w.]*(\$|#)?z[\[\]]z!([+\/*<>=!-]=?|[&*|][&*|]?|\^|<>)z'(?<![\w.])(and|or|not|div|mod)(?![\w.])z8\'[_a-z][^\[\]\'":]*(\[([\d,]+|"[\w,]+")\])?(:[0-9]+)?\'z(\n\s*)(\.{3})ú'z[^'\n]+z [^\'"\n]+z+(optionmenu|choice)([ \t]+)(\S+)(:)([ \t]+)z(option|button)([ \t]+)z(sentence|text)([ \t]+)(\S+)z2(word)([ \t]+)(\S+)([ \t]*)(\S+)?(?:([ \t]+)(.*))?z((boolean)(\s+\S+\s*)(0|1|"?(?:yes|no)"?)zY(real|natural|positive|integer)([ \t]+\S+[ \t]*)([+-]?)(\d+(?:\.\d*)?(?:[eE][-+]?\d+)?%?)z(comment)(\s+)z\bendform\b)Úrootrx rp ro rr r~ r} r{ r r rv r ry ru r@ rt N)r r r r r r r r r r r r r r r r r r! r"