| 1 | #cxx . . $ `<file>/fon/TextGrid.h`/ifndef _TextGrid_h_ |
| 2 | #define _TextGrid_h_cxx . . $ `fon/TextGrid.h:2:9`! |
| 3 | /* TextGrid.h |
| 4 | * |
| 5 | * Copyright (C) 1992-2012,2014-2018,2020,2021,2024,2025 Paul Boersma |
| 6 | * |
| 7 | * This code is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 3 of the License, or (at |
| 10 | * your option) any later version. |
| 11 | * |
| 12 | * This code is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 15 | * See the GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | #include "AnyTier.h"cxx . . $ `<file>/fon/AnyTier.h`/ |
| 22 | #include "Label.h"cxx . . $ `<file>/fon/Label.h`/ |
| 23 | #include "Graphics.h"cxx . . $ `<file>/sys/Graphics.h`/ |
| 24 | #include "TableOfReal.h"cxx . . $ `<file>/stat/TableOfReal.h`/ |
| 25 | #include "Table.h"cxx . . $ `<file>/stat/Table.h`/ |
| 26 | |
| 27 | #include "TextGrid_def.h"cxx . . $ `<file>/fon/TextGrid_def.h`/ |
| 28 | |
| 29 | autoTextPointcxx . . $ autoTextPoint# TextPoint_createcxx . . $ TextPoint_create(629885fe1bf1a567). (double time, conststring32cxx . . $ conststring32# mark); |
| 30 | |
| 31 | void TextPoint_setTextcxx . . $ TextPoint_setText(399da00149a21463). (TextPointcxx . . $ TextPoint# me, conststring32cxx . . $ conststring32# text); |
| 32 | |
| 33 | autoTextIntervalcxx . . $ autoTextInterval# TextInterval_createcxx . . $ TextInterval_create(69da32435edc95c8). (double tmin, double tmax, conststring32cxx . . $ conststring32# text); |
| 34 | |
| 35 | void TextInterval_setTextcxx . . $ TextInterval_setText(bda04a1b3ff14567). (TextIntervalcxx . . $ TextInterval# me, conststring32cxx . . $ conststring32# text); |
| 36 | |
| 37 | autoTextTiercxx . . $ autoTextTier# TextTier_createcxx . . $ TextTier_create(2138158d9ac1ba0e). (double tmin, double tmax); |
| 38 | |
| 39 | void TextTier_addPointcxx . . $ TextTier_addPoint(1dc2b2c5408ca811). (TextTiercxx . . $ TextTier# me, double time, conststring32cxx . . $ conststring32# mark); |
| 40 | autoPointProcesscxx . . $ autoPointProcess# TextTier_getPointscxx . . $ TextTier_getPoints(d5c1a12b38b30a3a). (TextTiercxx . . $ TextTier# me, conststring32cxx . . $ conststring32# text); |
| 41 | |
| 42 | autoIntervalTiercxx . . $ autoIntervalTier# IntervalTier_create_rawcxx . . $ IntervalTier_create_raw(e1dcd17f7d4249e5). (double tmin, double tmax); |
| 43 | |
| 44 | TextIntervalcxx . . $ TextInterval# /* reference */ IntervalTier_addInterval_rawcxx . . $ IntervalTier_addInterval_raw(7a2bb4528db246e6). ( |
| 45 | IntervalTiercxx . . $ IntervalTier# me, // the tier to which the new interval shall be added |
| 46 | double tmin, // the starting time of the new interval |
| 47 | double tmax, // the end time of the new interval |
| 48 | conststring32cxx . . $ conststring32# text // the label of the new interval |
| 49 | ); |
| 50 | /* |
| 51 | This attempts to add a new interval to an existing tier. |
| 52 | Because the intervals in an IntervalTier form a sorted set, |
| 53 | the attempt will fail if there is already an interval with the same starting interval. |
| 54 | |
| 55 | This function is called "raw" because no attempt is made to keep the IntervalTier |
| 56 | in a valid state. Most notably, the caller will have to make sure |
| 57 | that after a series of calls to this function |
| 58 | the invariants of the IntervalTier (i.e. adjacent time ranges) will have to be restored. |
| 59 | |
| 60 | The return value is a reference to the new TextInterval, |
| 61 | or null of the attempt failed. |
| 62 | */ |
| 63 | |
| 64 | void IntervalTier_haveAtLeastOneIntervalcxx . . $ IntervalTier_haveAtLeastOneInterval(a0731da1ef77e236). (IntervalTiercxx . . $ IntervalTier# me); |
| 65 | |
| 66 | autoIntervalTiercxx . . $ autoIntervalTier# IntervalTier_createcxx . . $ IntervalTier_create(e1dcd17f7d4249e5). (double tmin, double tmax); |
| 67 | |
| 68 | integercxx . . $ integer# IntervalTier_timeToLowIndexcxx . . $ IntervalTier_timeToLowIndex(726d97a25667305). (IntervalTiercxx . . $ IntervalTier# me, double t); |
| 69 | integercxx . . $ integer# IntervalTier_timeToIndexcxx . . $ IntervalTier_timeToIndex(726d97a25667305). (IntervalTiercxx . . $ IntervalTier# me, double t); // obsolete |
| 70 | integercxx . . $ integer# IntervalTier_timeToHighIndexcxx . . $ IntervalTier_timeToHighIndex(726d97a25667305). (IntervalTiercxx . . $ IntervalTier# me, double t); |
| 71 | integercxx . . $ integer# IntervalTier_hasTimecxx . . $ IntervalTier_hasTime(726d97a25667305). (IntervalTiercxx . . $ IntervalTier# me, double t); |
| 72 | integercxx . . $ integer# IntervalTier_hasBoundarycxx . . $ IntervalTier_hasBoundary(726d97a25667305). (IntervalTiercxx . . $ IntervalTier# me, double t); |
| 73 | autoPointProcesscxx . . $ autoPointProcess# IntervalTier_getStartingPointscxx . . $ IntervalTier_getStartingPoints(5f42a205fcc62fa3). (IntervalTiercxx . . $ IntervalTier# me, conststring32cxx . . $ conststring32# text); |
| 74 | autoPointProcesscxx . . $ autoPointProcess# IntervalTier_getEndPointscxx . . $ IntervalTier_getEndPoints(5f42a205fcc62fa3). (IntervalTiercxx . . $ IntervalTier# me, conststring32cxx . . $ conststring32# text); |
| 75 | autoPointProcesscxx . . $ autoPointProcess# IntervalTier_getCentrePointscxx . . $ IntervalTier_getCentrePoints(5f42a205fcc62fa3). (IntervalTiercxx . . $ IntervalTier# me, conststring32cxx . . $ conststring32# text); |
| 76 | autoPointProcesscxx . . $ autoPointProcess# IntervalTier_PointProcess_startToCentrecxx . . $ IntervalTier_PointProcess_startToCentre(4b8fdeccf775251f). (IntervalTiercxx . . $ IntervalTier# tier, PointProcesscxx . . $ PointProcess# point, double phase); |
| 77 | autoPointProcesscxx . . $ autoPointProcess# IntervalTier_PointProcess_endToCentrecxx . . $ IntervalTier_PointProcess_endToCentre(4b8fdeccf775251f). (IntervalTiercxx . . $ IntervalTier# tier, PointProcesscxx . . $ PointProcess# point, double phase); |
| 78 | void IntervalTier_removeLeftBoundarycxx . . $ IntervalTier_removeLeftBoundary(7c61fdb847aa29df). (IntervalTiercxx . . $ IntervalTier# me, integercxx . . $ integer# intervalNumber); |
| 79 | void IntervalTier_moveLeftBoundarycxx . . $ IntervalTier_moveLeftBoundary(e375e9120d379c6d). (IntervalTiercxx . . $ IntervalTier# me, integercxx . . $ integer# interval, double newTime); |
| 80 | void IntervalTier_moveRightBoundarycxx . . $ IntervalTier_moveRightBoundary(e375e9120d379c6d). (IntervalTiercxx . . $ IntervalTier# me, integercxx . . $ integer# interval, double newTime); |
| 81 | |
| 82 | void TextTier_removePointcxx . . $ TextTier_removePoint(eca23ed2975f5bf6). (TextTiercxx . . $ TextTier# me, integercxx . . $ integer# pointNumber); |
| 83 | |
| 84 | autoTextGridcxx . . $ autoTextGrid# TextGrid_createWithoutTierscxx . . $ TextGrid_createWithoutTiers(eff5050e5c13b396). (double tmin, double tmax); |
| 85 | autoTextGridcxx . . $ autoTextGrid# TextGrid_createcxx . . $ TextGrid_create(2af4734b8a73c5bc). (double tmin, double tmax, conststring32cxx . . $ conststring32# tierNames, conststring32cxx . . $ conststring32# pointTiers); |
| 86 | |
| 87 | integercxx . . $ integer# TextGrid_countLabelscxx . . $ TextGrid_countLabels(2720d6cb3b81075c). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# itier, conststring32cxx . . $ conststring32# text); |
| 88 | integercxx . . $ integer# TextGrid_countIntervalsWherecxx . . $ TextGrid_countIntervalsWhere(5e91ef344be0fb21). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# tierNumber, kMelder_stringcxx . . $ kMelder_string# which, conststring32cxx . . $ conststring32# criterion); |
| 89 | integercxx . . $ integer# TextGrid_countPointsWherecxx . . $ TextGrid_countPointsWhere(5e91ef344be0fb21). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# tierNumber, kMelder_stringcxx . . $ kMelder_string# which, conststring32cxx . . $ conststring32# criterion); |
| 90 | autoPointProcesscxx . . $ autoPointProcess# TextGrid_getStartingPointscxx . . $ TextGrid_getStartingPoints(8ee1358d98d02d7a). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# tierNumber, kMelder_stringcxx . . $ kMelder_string# which, conststring32cxx . . $ conststring32# criterion); |
| 91 | autoPointProcesscxx . . $ autoPointProcess# TextGrid_getEndPointscxx . . $ TextGrid_getEndPoints(8ee1358d98d02d7a). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# tierNumber, kMelder_stringcxx . . $ kMelder_string# which, conststring32cxx . . $ conststring32# criterion); |
| 92 | autoPointProcesscxx . . $ autoPointProcess# TextGrid_getCentrePointscxx . . $ TextGrid_getCentrePoints(8ee1358d98d02d7a). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# tierNumber, kMelder_stringcxx . . $ kMelder_string# which, conststring32cxx . . $ conststring32# criterion); |
| 93 | autoPointProcesscxx . . $ autoPointProcess# TextGrid_getPointscxx . . $ TextGrid_getPoints(8ee1358d98d02d7a). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# tierNumber, kMelder_stringcxx . . $ kMelder_string# which, conststring32cxx . . $ conststring32# criterion); |
| 94 | autoPointProcesscxx . . $ autoPointProcess# TextGrid_getPoints_precededcxx . . $ TextGrid_getPoints_preceded(a7ca20866603988c). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# tierNumber, |
| 95 | kMelder_stringcxx . . $ kMelder_string# which, conststring32cxx . . $ conststring32# criterion, |
| 96 | kMelder_stringcxx . . $ kMelder_string# precededBy, conststring32cxx . . $ conststring32# criterion_precededBy); |
| 97 | autoPointProcesscxx . . $ autoPointProcess# TextGrid_getPoints_followedcxx . . $ TextGrid_getPoints_followed(a7ca20866603988c). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# tierNumber, |
| 98 | kMelder_stringcxx . . $ kMelder_string# which, conststring32cxx . . $ conststring32# criterion, |
| 99 | kMelder_stringcxx . . $ kMelder_string# followedBy, conststring32cxx . . $ conststring32# criterion_followedBy); |
| 100 | |
| 101 | Functioncxx . . $ Function# TextGrid_checkSpecifiedTierNumberWithinRangecxx . . $ TextGrid_checkSpecifiedTierNumberWithinRange(5ff027095481dd6c). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# tierNumber); |
| 102 | IntervalTiercxx . . $ IntervalTier# TextGrid_checkSpecifiedTierIsIntervalTiercxx . . $ TextGrid_checkSpecifiedTierIsIntervalTier(45438f647f7429e7). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# tierNumber); |
| 103 | TextTiercxx . . $ TextTier# TextGrid_checkSpecifiedTierIsPointTiercxx . . $ TextGrid_checkSpecifiedTierIsPointTier(f31af18a252f9ca0). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# tierNumber); |
| 104 | void AnyTextGridTier_identifyClasscxx . . $ AnyTextGridTier_identifyClass(a77e8b689e7bdfe1). (Functioncxx . . $ Function# anyTextGridTier, IntervalTiercxx . . $ IntervalTier# *intervalTier, TextTiercxx . . $ TextTier# *textTier); |
| 105 | |
| 106 | void TextGrid_addTier_copycxx . . $ TextGrid_addTier_copy(fa0e82f53df615e1). (TextGridcxx . . $ TextGrid# me, Functioncxx . . $ Function# tier); |
| 107 | void TextGrid_addTier_movecxx . . $ TextGrid_addTier_move(677ec4e6bca63fc2). (TextGridcxx . . $ TextGrid# me, autoFunctioncxx . . $ autoFunction# tier); |
| 108 | |
| 109 | autoTextGridcxx . . $ autoTextGrid# TextGrids_mergecxx . . $ TextGrids_merge(b22acd202e9333c7). (OrderedOfcxx . . $ OrderedOf# <structTextGridcxx . . $ structTextGrid#>* textGrids, bool equalizeDomains); |
| 110 | /* |
| 111 | Merge two or more textGrids. |
| 112 | The new domain will run from |
| 113 | min (textGrids[] -> xmin) |
| 114 | to |
| 115 | max (textGrids[] -> xmax) |
| 116 | |
| 117 | If `equalizeDomains`: |
| 118 | - All tiers will have this same domain. |
| 119 | - All interval tiers will have intervals that border on the edges of this domain; |
| 120 | this implies that a new empty interval can be added at the beginning and/or end of a tier. |
| 121 | */ |
| 122 | |
| 123 | autoTextGridcxx . . $ autoTextGrid# TextGrid_extractPartcxx . . $ TextGrid_extractPart(fc53590ed4e42458). (TextGridcxx . . $ TextGrid# me, double tmin, double tmax, bool preserveTimes); |
| 124 | |
| 125 | autoTextGridcxx . . $ autoTextGrid# Label_to_TextGridcxx . . $ Label_to_TextGrid(8121a6a97f23f7c0). (Labelcxx . . $ Label# me, double duration); |
| 126 | autoTextGridcxx . . $ autoTextGrid# Label_Function_to_TextGridcxx . . $ Label_Function_to_TextGrid(ea386ce75d959309). (Labelcxx . . $ Label# me, Functioncxx . . $ Function# function); |
| 127 | |
| 128 | autoTextTiercxx . . $ autoTextTier# PointProcess_upto_TextTiercxx . . $ PointProcess_upto_TextTier(f07259e43bf470d9). (PointProcesscxx . . $ PointProcess# me, conststring32cxx . . $ conststring32# text); |
| 129 | autoTableOfRealcxx . . $ autoTableOfReal# IntervalTier_downto_TableOfRealcxx . . $ IntervalTier_downto_TableOfReal(3a0f0741f821d040). (IntervalTiercxx . . $ IntervalTier# me, conststring32cxx . . $ conststring32# label); |
| 130 | autoTableOfRealcxx . . $ autoTableOfReal# IntervalTier_downto_TableOfReal_anycxx . . $ IntervalTier_downto_TableOfReal_any(ea6e6e235c39b15). (IntervalTiercxx . . $ IntervalTier# me); |
| 131 | autoTableOfRealcxx . . $ autoTableOfReal# TextTier_downto_TableOfRealcxx . . $ TextTier_downto_TableOfReal(dafbf735f3b1ad03). (TextTiercxx . . $ TextTier# me, conststring32cxx . . $ conststring32# label); |
| 132 | autoTableOfRealcxx . . $ autoTableOfReal# TextTier_downto_TableOfReal_anycxx . . $ TextTier_downto_TableOfReal_any(2a5439f02f8aa806). (TextTiercxx . . $ TextTier# me); |
| 133 | |
| 134 | autoTextGridcxx . . $ autoTextGrid# PointProcess_to_TextGrid_vuvcxx . . $ PointProcess_to_TextGrid_vuv(58e1eaa8351393e6). (PointProcesscxx . . $ PointProcess# me, double maxT, double meanT); |
| 135 | |
| 136 | integercxx . . $ integer# TextInterval_labelLengthcxx . . $ TextInterval_labelLength(97113d6d89fc0780). (TextIntervalcxx . . $ TextInterval# me); |
| 137 | integercxx . . $ integer# TextPoint_labelLengthcxx . . $ TextPoint_labelLength(bfd2d7ceb08ffb64). (TextPointcxx . . $ TextPoint# me); |
| 138 | integercxx . . $ integer# IntervalTier_maximumLabelLengthcxx . . $ IntervalTier_maximumLabelLength(cebaf5715172b1cc). (IntervalTiercxx . . $ IntervalTier# me); |
| 139 | integercxx . . $ integer# TextTier_maximumLabelLengthcxx . . $ TextTier_maximumLabelLength(7669f090b234936c). (TextTiercxx . . $ TextTier# me); |
| 140 | integercxx . . $ integer# TextGrid_maximumLabelLengthcxx . . $ TextGrid_maximumLabelLength(df2f664eedc4c356). (TextGridcxx . . $ TextGrid# me); |
| 141 | void TextGrid_convertToBackslashTrigraphscxx . . $ TextGrid_convertToBackslashTrigraphs(7ae07386ebf4245e). (TextGridcxx . . $ TextGrid# me); |
| 142 | void TextGrid_convertToUnicodecxx . . $ TextGrid_convertToUnicode(7ae07386ebf4245e). (TextGridcxx . . $ TextGrid# me); |
| 143 | |
| 144 | void TextInterval_removeTextcxx . . $ TextInterval_removeText(7cf41142d20ea553). (TextIntervalcxx . . $ TextInterval# me); |
| 145 | void TextPoint_removeTextcxx . . $ TextPoint_removeText(49139227de83f993). (TextPointcxx . . $ TextPoint# me); |
| 146 | void IntervalTier_removeTextcxx . . $ IntervalTier_removeText(a0731da1ef77e236). (IntervalTiercxx . . $ IntervalTier# me); |
| 147 | void TextTier_removeTextcxx . . $ TextTier_removeText(63b9f24a2a8c61ba). (TextTiercxx . . $ TextTier# me); |
| 148 | |
| 149 | void TextTier_removePointscxx . . $ TextTier_removePoints(8c2a50b79381a578). (TextTiercxx . . $ TextTier# me, kMelder_stringcxx . . $ kMelder_string# which, conststring32cxx . . $ conststring32# criterion); |
| 150 | void TextGrid_removePointscxx . . $ TextGrid_removePoints(32a86215b7cd098a). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# tierNumber, kMelder_stringcxx . . $ kMelder_string# which, conststring32cxx . . $ conststring32# criterion); |
| 151 | |
| 152 | void TextGrid_insertBoundarycxx . . $ TextGrid_insertBoundary(5013a2d12dede214). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# tierNumber, double t); |
| 153 | void TextGrid_removeBoundaryAtTimecxx . . $ TextGrid_removeBoundaryAtTime(5013a2d12dede214). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# tierNumber, double t); |
| 154 | void TextGrid_setIntervalTextcxx . . $ TextGrid_setIntervalText(a77659792e2c2fae). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# tierNumber, integercxx . . $ integer# intervalNumber, conststring32cxx . . $ conststring32# text); |
| 155 | void TextGrid_insertPointcxx . . $ TextGrid_insertPoint(c3b410b0c4fcee18). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# tierNumber, double t, conststring32cxx . . $ conststring32# mark); |
| 156 | void TextGrid_setPointTextcxx . . $ TextGrid_setPointText(a77659792e2c2fae). (TextGridcxx . . $ TextGrid# me, integercxx . . $ integer# tierNumber, integercxx . . $ integer# pointNumber, conststring32cxx . . $ conststring32# text); |
| 157 | |
| 158 | autoTablecxx . . $ autoTable# TextGrid_downto_Tablecxx . . $ TextGrid_downto_Table(f7bbccda097a1587). (TextGridcxx . . $ TextGrid# me, bool includeLineNumbers, integercxx . . $ integer# timeDecimals, bool includeTierNames, bool includeEmptyIntervals); |
| 159 | autoTablecxx . . $ autoTable# TextGrid_tabulateOccurrencescxx . . $ TextGrid_tabulateOccurrences(10574cd77b3d5897). (TextGridcxx . . $ TextGrid# me, constVECcxx . . $ constVEC# searchTiers, |
| 160 | kMelder_stringcxx . . $ kMelder_string# which, conststring32cxx . . $ conststring32# criterion, bool caseSensitive); |
| 161 | void TextGrid_listcxx . . $ TextGrid_list(5fe6561be28353d4). (TextGridcxx . . $ TextGrid# me, bool includeLineNumbers, integercxx . . $ integer# timeDecimals, bool includeTierNames, |
| 162 | bool includeEmptyIntervals); |
| 163 | |
| 164 | void TextGrid_correctRoundingErrorscxx . . $ TextGrid_correctRoundingErrors(7ae07386ebf4245e). (TextGridcxx . . $ TextGrid# me); |
| 165 | autoTextGridcxx . . $ autoTextGrid# TextGrids_concatenatecxx . . $ TextGrids_concatenate(8e66b97b8c8857f8). (OrderedOfcxx . . $ OrderedOf#<structTextGridcxx . . $ structTextGrid#>* me); |
| 166 | |
| 167 | /* |
| 168 | Defined in TextGrid_files.cpp |
| 169 | */ |
| 170 | |
| 171 | autoTextGridcxx . . $ autoTextGrid# TextGrid_readFromEspsLabelFilecxx . . $ TextGrid_readFromEspsLabelFile(e6ce0b43ea6c6df0). ( |
| 172 | MelderFilecxx . . $ MelderFile# file, |
| 173 | bool tiersArePointTiers, |
| 174 | integercxx . . $ integer# overrideNumberOfTiers // 0 means don't override |
| 175 | ); |
| 176 | void IntervalTier_writeToXwavescxx . . $ IntervalTier_writeToXwaves(4e84daa568b6b66). (IntervalTiercxx . . $ IntervalTier# me, MelderFilecxx . . $ MelderFile# file); |
| 177 | |
| 178 | void TextGrid_writeToChronologicalTextFilecxx . . $ TextGrid_writeToChronologicalTextFile(de57dd486354d2db). (TextGridcxx . . $ TextGrid# me, MelderFilecxx . . $ MelderFile# file); |
| 179 | autoTextGridcxx . . $ autoTextGrid# TextGrid_readFromChronologicalTextFilecxx . . $ TextGrid_readFromChronologicalTextFile(6c59740fa80159f). (MelderFilecxx . . $ MelderFile# file); |
| 180 | autoTextGridcxx . . $ autoTextGrid# TextGrid_readFromCgnSyntaxFilecxx . . $ TextGrid_readFromCgnSyntaxFile(6c59740fa80159f). (MelderFilecxx . . $ MelderFile# file); |
| 181 | |
| 182 | autoIntervalTiercxx . . $ autoIntervalTier# IntervalTier_readFromTimitLabelFilecxx . . $ IntervalTier_readFromTimitLabelFile(22247b880e9d7b82). (MelderFilecxx . . $ MelderFile# file, bool hasPhones); |
| 183 | autoTextGridcxx . . $ autoTextGrid# TextGrid_readFromTimitLabelFilecxx . . $ TextGrid_readFromTimitLabelFile(3d8b49911508dca8). (MelderFilecxx . . $ MelderFile# file, bool hasPhones); |
| 184 | /* |
| 185 | Read TIMIT label file with the following structure: |
| 186 | samplenumber1 samplenumber2 label1 |
| 187 | samplenumber3 samplenumber4 label2 |
| 188 | ... |
| 189 | samplenumber2n-1 samplenumber2n labeln |
| 190 | |
| 191 | The first tier of TextGrid will contain the TIMIT labels. |
| 192 | If phnFile == true, the second tier will contain the translation of the |
| 193 | TIMIT labels into IPA labels. |
| 194 | For the translation from sample number to time a default sampling |
| 195 | frequency of 16000 Hz is assumed. |
| 196 | */ |
| 197 | |
| 198 | autoDaatacxx . . $ autoDaata# TextGrid_TIMITLabelFileRecognizercxx . . $ TextGrid_TIMITLabelFileRecognizer(c32780b24c371669). (integercxx . . $ integer# nread, const char *header, MelderFilecxx . . $ MelderFile# file); |
| 199 | /* |
| 200 | There are two types of TIMIT label files. One with phonetic labels, these |
| 201 | files have '.phn' as file extension. The other contains word labels and has |
| 202 | '.wrd' as extension. Since these extensions are only valid on the CDROM we can |
| 203 | not use them for filetype recognition. Both TIMIT label files do not have a |
| 204 | self-describing format. For filetype recognition we make use of the fact that |
| 205 | both files are text files and always have three items on each line: two numbers |
| 206 | followed by a string. The numbers increase in a monotone way. |
| 207 | The recognizer only checks the first two lines and it tests whether |
| 208 | 0 <= number 1] < number [2] <= number [3] < number [4] |
| 209 | (A number of .wrd files do not obey the monotonocity constraint for |
| 210 | number [4] and number [5] !) |
| 211 | The decision whether it is a .phn or .wrd file is: |
| 212 | .phn if string [1] == 'h#' AND string [2] is a TIMIT phonetic label |
| 213 | .wrd if (string [1] == 'h#' AND string [2] is a valid word) OR |
| 214 | string [1] and string [2] are both valid words. |
| 215 | A valid word is a string with contains the lowercase characters [a-z] and [']. |
| 216 | */ |
| 217 | |
| 218 | void TextGrid_checkInvariants_ecxx . . $ TextGrid_checkInvariants_e(c81f00550dda902a). (const constTextGridcxx . . $ constTextGrid# me, const bool includeWeakInvariants); |
| 219 | |
| 220 | void TextGrid_scaleTimes_ecxx . . $ TextGrid_scaleTimes_e(407f61fd4a0d6baa). (mutableTextGridcxx . . $ mutableTextGrid# me, double xminfrom, double xmaxfrom, double xminto, double xmaxto); |
| 221 | |
| 222 | /* End of file TextGrid.h */ |
| 223 | #endif |