praat_TableOfReal.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. /* praat_TableOfReal.cpp
  2. *
  3. * Copyright (C) 1992-2018 Paul Boersma
  4. *
  5. * This code is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This code is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include "Matrix.h"
  19. #include "praat_TableOfReal.h"
  20. #undef iam
  21. #define iam iam_LOOP
  22. // MARK: - TABLEOFREAL
  23. // MARK: Help
  24. DIRECT (HELP_TableOfReal_help) {
  25. HELP (U"TableOfReal")
  26. }
  27. // MARK: Draw
  28. FORM (GRAPHICS_TableOfReal_drawAsNumbers, U"Draw as numbers", nullptr) {
  29. NATURAL (fromRow, U"From row", U"1")
  30. INTEGER (toRow, U"To row", U"0 (= all)")
  31. RADIO (format, U"Format", 3)
  32. RADIOBUTTON (U"decimal")
  33. RADIOBUTTON (U"exponential")
  34. RADIOBUTTON (U"free")
  35. RADIOBUTTON (U"rational")
  36. NATURAL (precision, U"Precision", U"5")
  37. OK
  38. DO
  39. GRAPHICS_EACH (TableOfReal)
  40. TableOfReal_drawAsNumbers (me, GRAPHICS, fromRow, toRow, format, precision);
  41. GRAPHICS_EACH_END
  42. }
  43. FORM (GRAPHICS_TableOfReal_drawAsNumbers_if, U"Draw as numbers if...", nullptr) {
  44. NATURAL (fromRow, U"From row", U"1")
  45. INTEGER (toRow, U"To row", U"0 (= all)")
  46. RADIO (format, U"Format", 3)
  47. RADIOBUTTON (U"decimal")
  48. RADIOBUTTON (U"exponential")
  49. RADIOBUTTON (U"free")
  50. RADIOBUTTON (U"rational")
  51. NATURAL (precision, U"Precision", U"5")
  52. TEXTFIELD (condition, U"Condition:", U"self <> 0")
  53. OK
  54. DO
  55. GRAPHICS_EACH (TableOfReal)
  56. TableOfReal_drawAsNumbers_if (me, GRAPHICS, fromRow, toRow, format, precision, condition, interpreter);
  57. GRAPHICS_EACH_END
  58. }
  59. FORM (GRAPHICS_TableOfReal_drawAsSquares, U"Draw table as squares", nullptr) {
  60. NATURAL (fromRow, U"From row", U"1")
  61. INTEGER (toRow, U"To row", U"0 (= all)")
  62. NATURAL (fromColumn, U"From column", U"1")
  63. INTEGER (toColumn, U"To column", U"0")
  64. BOOLEAN (garnish, U"Garnish", true)
  65. OK
  66. DO
  67. GRAPHICS_EACH (TableOfReal)
  68. TableOfReal_drawAsSquares (me, GRAPHICS, fromRow, toRow, fromColumn, toColumn, garnish);
  69. GRAPHICS_EACH_END
  70. }
  71. FORM (GRAPHICS_TableOfReal_drawHorizontalLines, U"Draw horizontal lines", nullptr) {
  72. NATURAL (fromRow, U"From row", U"1")
  73. INTEGER (toRow, U"To row", U"0 (= all)")
  74. OK
  75. DO
  76. GRAPHICS_EACH (TableOfReal)
  77. TableOfReal_drawHorizontalLines (me, GRAPHICS, fromRow, toRow);
  78. GRAPHICS_EACH_END
  79. }
  80. FORM (GRAPHICS_TableOfReal_drawLeftAndRightLines, U"Draw left and right lines", nullptr) {
  81. NATURAL (fromRow, U"From row", U"1")
  82. INTEGER (toRow, U"To row", U"0 (= all)")
  83. OK
  84. DO
  85. GRAPHICS_EACH (TableOfReal)
  86. TableOfReal_drawLeftAndRightLines (me, GRAPHICS, fromRow, toRow);
  87. GRAPHICS_EACH_END
  88. }
  89. FORM (GRAPHICS_TableOfReal_drawTopAndBottomLines, U"Draw top and bottom lines", nullptr) {
  90. NATURAL (fromRow, U"From row", U"1")
  91. INTEGER (toRow, U"To row", U"0 (= all)")
  92. OK
  93. DO
  94. GRAPHICS_EACH (TableOfReal)
  95. TableOfReal_drawTopAndBottomLines (me, GRAPHICS, fromRow, toRow);
  96. GRAPHICS_EACH_END
  97. }
  98. FORM (GRAPHICS_TableOfReal_drawVerticalLines, U"Draw vertical lines", nullptr) {
  99. NATURAL (fromRow, U"From row", U"1")
  100. INTEGER (toRow, U"To row", U"0 (= all)")
  101. OK
  102. DO
  103. GRAPHICS_EACH (TableOfReal)
  104. TableOfReal_drawVerticalLines (me, GRAPHICS, fromRow, toRow);
  105. GRAPHICS_EACH_END
  106. }
  107. // MARK: Query
  108. FORM (INTEGER_TableOfReal_getColumnIndex, U"Get column index", nullptr) {
  109. SENTENCE (columnLabel, U"Column label", U"")
  110. OK
  111. DO
  112. NUMBER_ONE (TableOfReal)
  113. integer result = TableOfReal_columnLabelToIndex (me, columnLabel);
  114. NUMBER_ONE_END (U" (index of column ", columnLabel, U")")
  115. }
  116. FORM (STRING_TableOfReal_getColumnLabel, U"Get column label", nullptr) {
  117. NATURAL (columnNumber, U"Column number", U"1")
  118. OK
  119. DO
  120. STRING_ONE (TableOfReal)
  121. if (columnNumber > my numberOfColumns)
  122. Melder_throw (me, U": your column number should not be greater than the number of columns.");
  123. conststring32 result = my columnLabels ? my columnLabels [columnNumber].get() : U"";
  124. STRING_ONE_END
  125. }
  126. FORM (REAL_TableOfReal_getColumnMean_index, U"Get column mean", nullptr) {
  127. NATURAL (columnNumber, U"Column number", U"1")
  128. OK
  129. DO
  130. NUMBER_ONE (TableOfReal)
  131. if (columnNumber > my numberOfColumns)
  132. Melder_throw (me, U": your column number should not be greater than the number of columns.");
  133. double result = TableOfReal_getColumnMean (me, columnNumber);
  134. NUMBER_ONE_END (U" (mean of column ", columnNumber, U")")
  135. }
  136. FORM (REAL_TableOfReal_getColumnMean_label, U"Get column mean", nullptr) {
  137. SENTENCE (columnLabel, U"Column label", U"")
  138. OK
  139. DO
  140. NUMBER_ONE (TableOfReal)
  141. integer columnNumber = TableOfReal_columnLabelToIndex (me, columnLabel);
  142. if (columnNumber == 0) Melder_throw (me, U": your column label does not exist.");
  143. double result = TableOfReal_getColumnMean (me, columnNumber);
  144. NUMBER_ONE_END (U" (mean of column ", columnLabel, U")")
  145. }
  146. FORM (REAL_TableOfReal_getColumnStdev_index, U"Get column standard deviation", nullptr) {
  147. NATURAL (columnNumber, U"Column number", U"1")
  148. OK
  149. DO
  150. NUMBER_ONE (TableOfReal)
  151. if (columnNumber > my numberOfColumns)
  152. Melder_throw (me, U": your column number should not be greater than the number of columns.");
  153. double result = TableOfReal_getColumnStdev (me, columnNumber);
  154. NUMBER_ONE_END (U" (standard deviation of column ", columnNumber, U")")
  155. }
  156. FORM (REAL_TableOfReal_getColumnStdev_label, U"Get column standard deviation", nullptr) {
  157. SENTENCE (columnLabel, U"Column label", U"1")
  158. OK
  159. DO
  160. NUMBER_ONE (TableOfReal)
  161. integer columnNumber = TableOfReal_columnLabelToIndex (me, columnLabel);
  162. if (columnNumber == 0) Melder_throw (me, U": column label does not exist.");
  163. double result = TableOfReal_getColumnStdev (me, columnNumber);
  164. NUMBER_ONE_END (U" (standard deviation of column ", columnLabel, U")")
  165. }
  166. DIRECT (INTEGER_TableOfReal_getNumberOfColumns) {
  167. NUMBER_ONE (TableOfReal)
  168. integer result = my numberOfColumns;
  169. NUMBER_ONE_END (U" columns")
  170. }
  171. DIRECT (INTEGER_TableOfReal_getNumberOfRows) {
  172. NUMBER_ONE (TableOfReal)
  173. integer result = my numberOfRows;
  174. NUMBER_ONE_END (U" rows")
  175. }
  176. FORM (INTEGER_TableOfReal_getRowIndex, U"Get row index", nullptr) {
  177. SENTENCE (rowLabel, U"Row label", U"")
  178. OK
  179. DO
  180. NUMBER_ONE (TableOfReal)
  181. integer result = TableOfReal_rowLabelToIndex (me, rowLabel);
  182. NUMBER_ONE_END (U" (index of row ", rowLabel, U")")
  183. }
  184. FORM (STRING_TableOfReal_getRowLabel, U"Get row label", nullptr) {
  185. NATURAL (rowNumber, U"Row number", U"1")
  186. OK
  187. DO
  188. STRING_ONE (TableOfReal)
  189. if (rowNumber > my numberOfRows)
  190. Melder_throw (me, U": your row number should not be greater than the number of rows.");
  191. conststring32 result = my rowLabels ? my rowLabels [rowNumber].get() : U"";
  192. STRING_ONE_END
  193. }
  194. FORM (REAL_TableOfReal_getValue, U"Get value", nullptr) {
  195. NATURAL (rowNumber, U"Row number", U"1")
  196. NATURAL (columnNumber, U"Column number", U"1")
  197. OK
  198. DO
  199. NUMBER_ONE (TableOfReal)
  200. if (rowNumber > my numberOfRows)
  201. Melder_throw (me, U": your row number should not exceed the number of rows.");
  202. if (columnNumber > my numberOfColumns)
  203. Melder_throw (me, U": your column number should not exceed the number of columns.");
  204. double result = my data [rowNumber] [columnNumber];
  205. NUMBER_ONE_END (U" (value in column ", columnNumber, U" of row ", rowNumber, U")")
  206. }
  207. // MARK: Modify
  208. FORM (MODIFY_TableOfReal_formula, U"TableOfReal: Formula", U"Formula...") {
  209. LABEL (U"for row from 1 to nrow do for col from 1 to ncol do self [row, col] = ...")
  210. TEXTFIELD (formula, U"Formula:", U"if col = 5 then self + self [6] else self fi")
  211. OK
  212. DO
  213. MODIFY_EACH_WEAK (TableOfReal)
  214. TableOfReal_formula (me, formula, interpreter, nullptr);
  215. MODIFY_EACH_WEAK_END
  216. }
  217. FORM (MODIFY_TableOfReal_insertColumn, U"Insert column", nullptr) {
  218. NATURAL (columnNumber, U"Column number", U"1")
  219. OK
  220. DO
  221. MODIFY_EACH (TableOfReal)
  222. TableOfReal_insertColumn (me, columnNumber);
  223. MODIFY_EACH_END
  224. }
  225. FORM (MODIFY_TableOfReal_insertRow, U"Insert row", nullptr) {
  226. NATURAL (rowNumber, U"Row number", U"1")
  227. OK
  228. DO
  229. MODIFY_EACH (TableOfReal)
  230. TableOfReal_insertRow (me, rowNumber);
  231. MODIFY_EACH_END
  232. }
  233. FORM (MODIFY_TableOfReal_removeColumn, U"Remove column", nullptr) {
  234. NATURAL (columnNumber, U"Column number", U"1")
  235. OK
  236. DO
  237. MODIFY_EACH (TableOfReal)
  238. TableOfReal_removeColumn (me, columnNumber);
  239. MODIFY_EACH_END
  240. }
  241. FORM (MODIFY_TableOfReal_removeRow, U"Remove row", nullptr) {
  242. NATURAL (rowNumber, U"Row number", U"1")
  243. OK
  244. DO
  245. MODIFY_EACH (TableOfReal)
  246. TableOfReal_removeRow (me, rowNumber);
  247. MODIFY_EACH_END
  248. }
  249. FORM (MODIFY_TableOfReal_setColumnLabel_index, U"Set column label", nullptr) {
  250. NATURAL (columnNumber, U"Column number", U"1")
  251. SENTENCE (label, U"Label", U"")
  252. OK
  253. DO
  254. MODIFY_EACH (TableOfReal)
  255. TableOfReal_setColumnLabel (me, columnNumber, label);
  256. MODIFY_EACH_END
  257. }
  258. FORM (MODIFY_TableOfReal_setColumnLabel_label, U"Set column label", nullptr) {
  259. SENTENCE (oldLabel, U"Old label", U"")
  260. SENTENCE (newLabel, U"New label", U"")
  261. OK
  262. DO
  263. MODIFY_EACH (TableOfReal)
  264. integer columnNumber = TableOfReal_columnLabelToIndex (me, oldLabel);
  265. TableOfReal_setColumnLabel (me, columnNumber, newLabel);
  266. MODIFY_EACH_END
  267. }
  268. FORM (MODIFY_TableOfReal_setRowLabel_index, U"Set row label", nullptr) {
  269. NATURAL (rowNumber, U"Row number", U"1")
  270. SENTENCE (label, U"Label", U"")
  271. OK
  272. DO
  273. MODIFY_EACH (TableOfReal)
  274. TableOfReal_setRowLabel (me, rowNumber, label);
  275. MODIFY_EACH_END
  276. }
  277. FORM (MODIFY_TableOfReal_setValue, U"Set value", U"TableOfReal: Set value...") {
  278. NATURAL (rowNumber, U"Row number", U"1")
  279. NATURAL (columnNumber, U"Column number", U"1")
  280. REAL_OR_UNDEFINED (newValue, U"New value", U"0.0")
  281. OK
  282. DO
  283. MODIFY_EACH (TableOfReal)
  284. if (rowNumber > my numberOfRows)
  285. Melder_throw (me, U": your row number should not be greater than the number of rows.");
  286. if (columnNumber > my numberOfColumns)
  287. Melder_throw (me, U": your column number should not be greater than the number of columns.");
  288. my data [rowNumber] [columnNumber] = newValue;
  289. MODIFY_EACH_END
  290. }
  291. FORM (MODIFY_TableOfReal_setRowLabel_label, U"Set row label", nullptr) {
  292. SENTENCE (oldLabel, U"Old label", U"")
  293. WORD (newLabel, U"New label", U"")
  294. OK
  295. DO
  296. MODIFY_EACH (TableOfReal)
  297. integer rowNumber = TableOfReal_rowLabelToIndex (me, oldLabel);
  298. TableOfReal_setRowLabel (me, rowNumber, newLabel);
  299. MODIFY_EACH_END
  300. }
  301. FORM (MODIFY_TableOfReal_sortByColumn, U"Sort rows by column", nullptr) {
  302. INTEGER (column, U"Column", U"1")
  303. INTEGER (secondaryColumn, U"Secondary column", U"0")
  304. OK
  305. DO
  306. MODIFY_EACH (TableOfReal)
  307. TableOfReal_sortByColumn (me, column, secondaryColumn);
  308. MODIFY_EACH_END
  309. }
  310. FORM (MODIFY_TableOfReal_sortByLabel, U"Sort rows by label", nullptr) {
  311. LABEL (U"Secondary sorting keys:")
  312. INTEGER (column1, U"Column1", U"1")
  313. INTEGER (column2, U"Column2", U"0")
  314. OK
  315. DO
  316. MODIFY_EACH (TableOfReal)
  317. TableOfReal_sortByLabel (me, column1, column2);
  318. MODIFY_EACH_END
  319. }
  320. // MARK: Extract
  321. DIRECT (NEW_TableOfReal_extractColumnLabelsAsStrings) {
  322. CONVERT_EACH (TableOfReal)
  323. autoStrings result = TableOfReal_extractColumnLabelsAsStrings (me);
  324. CONVERT_EACH_END (my name.get())
  325. }
  326. FORM (NEW_TableOfReal_extractColumnRanges, U"Extract column ranges", nullptr) {
  327. TEXTFIELD (ranges, U"Create a new TableOfReal from the following columns:", U"1 2")
  328. LABEL (U"To supply rising or falling ranges, use e.g. 2:6 or 5:3.")
  329. OK
  330. DO
  331. CONVERT_EACH (TableOfReal)
  332. autoTableOfReal result = TableOfReal_extractColumnRanges (me, ranges);
  333. CONVERT_EACH_END (my name.get(), U"_cols")
  334. }
  335. FORM (NEW_TableOfReal_extractColumnsWhere, U"Extract columns where", nullptr) {
  336. TEXTFIELD (condition, U"Extract all columns with at least one cell where:", U"col mod 3 = 0 ; this example extracts every third column")
  337. OK
  338. DO
  339. CONVERT_EACH (TableOfReal)
  340. autoTableOfReal result = TableOfReal_extractColumnsWhere (me, condition, interpreter);
  341. CONVERT_EACH_END (my name.get(), U"_cols")
  342. }
  343. FORM (NEW_TableOfReal_extractColumnsWhereLabel, U"Extract column where label", nullptr) {
  344. OPTIONMENU_ENUM (kMelder_string, extractAllColumnsWhoseLabel,
  345. U"Extract all columns whose label...", kMelder_string::DEFAULT)
  346. SENTENCE (___theText, U"...the text", U"a")
  347. OK
  348. DO
  349. CONVERT_EACH (TableOfReal)
  350. autoTableOfReal result = TableOfReal_extractColumnsWhereLabel (me, extractAllColumnsWhoseLabel, ___theText);
  351. CONVERT_EACH_END (my name.get(), U"_", ___theText)
  352. }
  353. FORM (NEW_TableOfReal_extractColumnsWhereRow, U"Extract columns where row", nullptr) {
  354. NATURAL (extractAllColumnsWhereRow, U"Extract all columns where row...", U"1")
  355. OPTIONMENU_ENUM (kMelder_number, ___is___, U"...is...", kMelder_number::DEFAULT)
  356. REAL (___theValue, U"...the value", U"0.0")
  357. OK
  358. DO
  359. CONVERT_EACH (TableOfReal)
  360. autoTableOfReal result = TableOfReal_extractColumnsWhereRow (me, extractAllColumnsWhereRow, ___is___, ___theValue);
  361. CONVERT_EACH_END (my name.get(), U"_", extractAllColumnsWhereRow, U"_", Melder_iround (___theValue))
  362. }
  363. DIRECT (NEW_TableOfReal_extractRowLabelsAsStrings) {
  364. CONVERT_EACH (TableOfReal)
  365. autoStrings result = TableOfReal_extractRowLabelsAsStrings (me);
  366. CONVERT_EACH_END (my name.get())
  367. }
  368. FORM (NEW_TableOfReal_extractRowRanges, U"Extract row ranges", nullptr) {
  369. TEXTFIELD (ranges, U"Create a new TableOfReal from the following rows:", U"1 2")
  370. LABEL (U"To supply rising or falling ranges, use e.g. 2:6 or 5:3.")
  371. OK
  372. DO
  373. CONVERT_EACH (TableOfReal)
  374. autoTableOfReal result = TableOfReal_extractRowRanges (me, ranges);
  375. CONVERT_EACH_END (my name.get(), U"_rows")
  376. }
  377. FORM (NEW_TableOfReal_extractRowsWhere, U"Extract rows where", nullptr) {
  378. TEXTFIELD (condition, U"Extract all rows with at least one cell where:", U"row mod 3 = 0 ; this example extracts every third row")
  379. OK
  380. DO
  381. CONVERT_EACH (TableOfReal)
  382. autoTableOfReal result = TableOfReal_extractRowsWhere (me, condition, interpreter);
  383. CONVERT_EACH_END (my name.get(), U"_rows")
  384. }
  385. FORM (NEW_TableOfReal_extractRowsWhereColumn, U"Extract rows where column", nullptr) {
  386. NATURAL (extractAllRowsWhereColumn, U"Extract all rows where column...", U"1")
  387. OPTIONMENU_ENUM (kMelder_number, ___is___, U"...is...", kMelder_number::DEFAULT)
  388. REAL (___theValue, U"...the value", U"0.0")
  389. OK
  390. DO
  391. CONVERT_EACH (TableOfReal)
  392. autoTableOfReal result = TableOfReal_extractRowsWhereColumn (me, extractAllRowsWhereColumn, ___is___, ___theValue);
  393. CONVERT_EACH_END (my name.get(), U"_", extractAllRowsWhereColumn, U"_", Melder_iround (___theValue))
  394. }
  395. FORM (NEW_TableOfReal_extractRowsWhereLabel, U"Extract rows where label", nullptr) {
  396. OPTIONMENU_ENUM (kMelder_string, extractAllRowsWhoseLabel,
  397. U"Extract all rows whose label...", kMelder_string::DEFAULT)
  398. SENTENCE (___theText, U"...the text", U"a")
  399. OK
  400. DO
  401. CONVERT_EACH (TableOfReal)
  402. autoTableOfReal result = TableOfReal_extractRowsWhereLabel (me, extractAllRowsWhoseLabel, ___theText);
  403. CONVERT_EACH_END (my name.get(), U"_", ___theText)
  404. }
  405. // MARK: Convert
  406. DIRECT (NEW1_TablesOfReal_append) {
  407. CONVERT_LIST (TableOfReal)
  408. autoTableOfReal result = TablesOfReal_appendMany (& list);
  409. CONVERT_LIST_END (U"appended")
  410. }
  411. DIRECT (NEW_TableOfReal_to_Matrix) {
  412. CONVERT_EACH (TableOfReal)
  413. autoMatrix result = TableOfReal_to_Matrix (me);
  414. CONVERT_EACH_END (my name.get())
  415. }
  416. FORM (NEW_TableOfReal_to_Table, U"TableOfReal: To Table", nullptr) {
  417. SENTENCE (labelOfFirstColumn, U"Label of first column", U"rowLabel")
  418. OK
  419. DO
  420. CONVERT_EACH (TableOfReal)
  421. autoTable result = TableOfReal_to_Table (me, labelOfFirstColumn);
  422. CONVERT_EACH_END (my name.get())
  423. }
  424. FORM_SAVE (SAVE_TableOfReal_writeToHeaderlessSpreadsheetFile, U"Save TableOfReal as spreadsheet", 0, U"txt") {
  425. SAVE_ONE (TableOfReal)
  426. TableOfReal_writeToHeaderlessSpreadsheetFile (me, file);
  427. SAVE_ONE_END
  428. }
  429. void praat_TableOfReal_init (ClassInfo klas) {
  430. if (klas == classTableOfReal) {
  431. praat_addAction1 (classTableOfReal, 0, U"TableOfReal help", nullptr, 0, HELP_TableOfReal_help);
  432. }
  433. praat_addAction1 (klas, 1, U"Save as headerless spreadsheet file...", nullptr, 0, SAVE_TableOfReal_writeToHeaderlessSpreadsheetFile);
  434. praat_addAction1 (klas, 1, U"Write to headerless spreadsheet file...", U"*Save as headerless spreadsheet file...", praat_DEPRECATED_2011, SAVE_TableOfReal_writeToHeaderlessSpreadsheetFile);
  435. praat_addAction1 (klas, 0, U"Draw -", nullptr, 0, nullptr);
  436. praat_addAction1 (klas, 0, U"Draw as numbers...", nullptr, 1, GRAPHICS_TableOfReal_drawAsNumbers);
  437. praat_addAction1 (klas, 0, U"Draw as numbers if...", nullptr, 1, GRAPHICS_TableOfReal_drawAsNumbers_if);
  438. praat_addAction1 (klas, 0, U"Draw as squares...", nullptr, 1, GRAPHICS_TableOfReal_drawAsSquares);
  439. praat_addAction1 (klas, 0, U"-- draw lines --", nullptr, 1, 0);
  440. praat_addAction1 (klas, 0, U"Draw vertical lines...", nullptr, 1, GRAPHICS_TableOfReal_drawVerticalLines);
  441. praat_addAction1 (klas, 0, U"Draw horizontal lines...", nullptr, 1, GRAPHICS_TableOfReal_drawHorizontalLines);
  442. praat_addAction1 (klas, 0, U"Draw left and right lines...", nullptr, 1, GRAPHICS_TableOfReal_drawLeftAndRightLines);
  443. praat_addAction1 (klas, 0, U"Draw top and bottom lines...", nullptr, 1, GRAPHICS_TableOfReal_drawTopAndBottomLines);
  444. praat_addAction1 (klas, 0, U"Query -", nullptr, 0, nullptr);
  445. praat_addAction1 (klas, 1, U"Get number of rows", nullptr, 1, INTEGER_TableOfReal_getNumberOfRows);
  446. praat_addAction1 (klas, 1, U"Get number of columns", nullptr, 1, INTEGER_TableOfReal_getNumberOfColumns);
  447. praat_addAction1 (klas, 1, U"Get row label...", nullptr, 1, STRING_TableOfReal_getRowLabel);
  448. praat_addAction1 (klas, 1, U"Get column label...", nullptr, 1, STRING_TableOfReal_getColumnLabel);
  449. praat_addAction1 (klas, 1, U"Get row index...", nullptr, 1, INTEGER_TableOfReal_getRowIndex);
  450. praat_addAction1 (klas, 1, U"Get column index...", nullptr, 1, INTEGER_TableOfReal_getColumnIndex);
  451. praat_addAction1 (klas, 1, U"-- get value --", nullptr, 1, nullptr);
  452. praat_addAction1 (klas, 1, U"Get value...", nullptr, 1, REAL_TableOfReal_getValue);
  453. if (klas == classTableOfReal) {
  454. praat_addAction1 (klas, 1, U"-- get statistics --", nullptr, 1, nullptr);
  455. praat_addAction1 (klas, 1, U"Get column mean (index)...", nullptr, 1, REAL_TableOfReal_getColumnMean_index);
  456. praat_addAction1 (klas, 1, U"Get column mean (label)...", nullptr, 1, REAL_TableOfReal_getColumnMean_label);
  457. praat_addAction1 (klas, 1, U"Get column stdev (index)...", nullptr, 1, REAL_TableOfReal_getColumnStdev_index);
  458. praat_addAction1 (klas, 1, U"Get column stdev (label)...", nullptr, 1, REAL_TableOfReal_getColumnStdev_label);
  459. }
  460. praat_addAction1 (klas, 0, U"Modify -", nullptr, 0, nullptr);
  461. praat_addAction1 (klas, 0, U"Formula...", nullptr, 1, MODIFY_TableOfReal_formula);
  462. praat_addAction1 (klas, 0, U"Set value...", nullptr, 1, MODIFY_TableOfReal_setValue);
  463. praat_addAction1 (klas, 0, U"Sort by label...", nullptr, 1, MODIFY_TableOfReal_sortByLabel);
  464. praat_addAction1 (klas, 0, U"Sort by column...", nullptr, 1, MODIFY_TableOfReal_sortByColumn);
  465. praat_addAction1 (klas, 0, U"-- structure --", nullptr, 1, nullptr);
  466. praat_addAction1 (klas, 0, U"Remove row (index)...", nullptr, 1, MODIFY_TableOfReal_removeRow);
  467. praat_addAction1 (klas, 0, U"Remove column (index)...", nullptr, 1, MODIFY_TableOfReal_removeColumn);
  468. praat_addAction1 (klas, 0, U"Insert row (index)...", nullptr, 1, MODIFY_TableOfReal_insertRow);
  469. praat_addAction1 (klas, 0, U"Insert column (index)...", nullptr, 1, MODIFY_TableOfReal_insertColumn);
  470. praat_addAction1 (klas, 0, U"-- set --", nullptr, 1, nullptr);
  471. praat_addAction1 (klas, 0, U"Set row label (index)...", nullptr, 1, MODIFY_TableOfReal_setRowLabel_index);
  472. praat_addAction1 (klas, 0, U"Set row label (label)...", nullptr, 1, MODIFY_TableOfReal_setRowLabel_label);
  473. praat_addAction1 (klas, 0, U"Set column label (index)...", nullptr, 1, MODIFY_TableOfReal_setColumnLabel_index);
  474. praat_addAction1 (klas, 0, U"Set column label (label)...", nullptr, 1, MODIFY_TableOfReal_setColumnLabel_label);
  475. praat_addAction1 (klas, 0, U"Synthesize -", nullptr, 0, nullptr);
  476. praat_addAction1 (klas, 0, U"Append", nullptr, 1, NEW1_TablesOfReal_append);
  477. praat_addAction1 (klas, 0, U"Extract part -", nullptr, 0, nullptr);
  478. praat_addAction1 (klas, 0, U"Extract row ranges...", nullptr, 1, NEW_TableOfReal_extractRowRanges);
  479. praat_addAction1 (klas, 0, U"Extract rows where column...", nullptr, 1, NEW_TableOfReal_extractRowsWhereColumn);
  480. praat_addAction1 (klas, 0, U"Extract rows where label...", nullptr, 1, NEW_TableOfReal_extractRowsWhereLabel);
  481. praat_addAction1 (klas, 0, U"Extract rows where...", nullptr, 1, NEW_TableOfReal_extractRowsWhere);
  482. praat_addAction1 (klas, 0, U"Extract column ranges...", nullptr, 1, NEW_TableOfReal_extractColumnRanges);
  483. praat_addAction1 (klas, 0, U"Extract columns where row...", nullptr, 1, NEW_TableOfReal_extractColumnsWhereRow);
  484. praat_addAction1 (klas, 0, U"Extract columns where label...", nullptr, 1, NEW_TableOfReal_extractColumnsWhereLabel);
  485. praat_addAction1 (klas, 0, U"Extract columns where...", nullptr, 1, NEW_TableOfReal_extractColumnsWhere);
  486. praat_addAction1 (klas, 0, U"Extract -", nullptr, 0, nullptr);
  487. praat_addAction1 (klas, 0, U"Extract row labels as Strings", nullptr, 1, NEW_TableOfReal_extractRowLabelsAsStrings);
  488. praat_addAction1 (klas, 0, U"Extract column labels as Strings", nullptr, 1, NEW_TableOfReal_extractColumnLabelsAsStrings);
  489. praat_addAction1 (klas, 0, U"Convert -", nullptr, 0, nullptr);
  490. praat_addAction1 (klas, 0, U"To Table...", nullptr, 1, NEW_TableOfReal_to_Table);
  491. praat_addAction1 (klas, 0, U"To Matrix", nullptr, 1, NEW_TableOfReal_to_Matrix);
  492. }
  493. /* End of file praat_TableOfReal.cpp */