📄 foo
字号:
(once for each file) and zero is used as its value. This is not a fatal error, because there might be several input files open that do not have all of the same fields. The permitted relational are:____________________________________________________ |<STRONG>______________________________</STRONG><EM>|</EM<STRONG>_</STRONG> | == equals | | = equals | | != not equals | | > greater than | | >= greater than or equal to| | < less than | | <= less than or equal to | | && and | | & and | | || or | | | or | |______________________________<EM>|</EM> The && has precedence over the || ; & and | are treated as synonyms for && and ||. There are no bitwise logical operations. The permitted arithmetic operators are: ____________________ | <arith_op> | |<STRONG>___________________</STRONG><EM>|</EM<STRONG>_</STRONG> | + addition | | - subtraction | | * multiplication| | / division | |_<STRONG>_</STRONG>___<STRONG>______________</STRONG><EM>|</EM> The ^ operator has the highest precedence and is right asso- ciative. The / and * operators have the next highest pre- cedence and are left associative. The + and - operators have the lowest precedence and are also left associative. If <value> is a numerical value (appropriate if the type of the field is a numerical type), it should be given in a corresponding format for C constants. If the field type is coded, then <value> should be a quoted string (upper or lower case) that is one of the legal values. In the case of coded field types, the default behavior is for the comparison to be case insensitive. Comparisons can be made case sensitive by using the <STRONG>-c</STRONG> option on the command line.</PRE><H2>FUNCTIONS</H2><PRE> There are three types of functions supported by <EM>select</EM>. One type of function takes as its domain a numerical value, which can be given as any expression that <EM>select</EM> can pro- cess. Another type of function operates on a <field_name>. The third type of function is the <external_function>. This form of function results in an external program being called to perform some function on each record. This provides a very general capability, but since the external program will be called for each record processed it is much slower than built in functions. The available built in function are: __________________________ |<STRONG>_________________________</STRONG><EM>|</EM<STRONG>_</STRONG> | abs absolute value| | atan arc tangent | | cos cosine | | exp exponent | | int integer | | log natural log | | log10 log base 10 | | sin sine | | sqrt square root | | tan tangent | |_________________________<EM>|</EM> _____________________________________ | Functions on Fields | |<STRONG>____________________________________</STRONG><EM>|</EM<STRONG>_</STRONG> | max maximum of elements in field| | mean mean of elements in field | | min minimum of elements in field| | prod product of elements in field| | size number of elements in field | |_<STRONG>___</STRONG>____<STRONG>___</STRONG>_<STRONG>________</STRONG>_<STRONG>__</STRONG>_<STRONG>_____</STRONG>_______<EM>|</EM> The only legal argument for functions on fields is a single <field_name> without an index. In this case, the <field_name> refers to the entire field. If <external_function> is found in an expression <EM>select</EM> searches the users current PATH for a program with the specified name. This program is assumed to accept a single-record ESPS FEA file as its only argument and to out- put a value (ASCII) on standard output. <EM>Select</EM> creates a single-record ESPS file from each record in the input files and calls <external_function> with this file; the output of <external_function> is then used within the query. An exam- ple of the source code for an external function can be found in the <EM>select</EM> source directory, or in /usr/sps/lib on a non-source system. There are several built in field names that have special meaning. The are:_______________________________________________________________________________________ |<STRONG>_________________________________________________________________</STRONG><EM>|</EM<STRONG>_</STRONG> | tag built in tag field of the record | | REC record number (from 1) | | FILE file name of the input file within the set of input files| |_________________________________________________________________<EM>|</EM> The field name "tag" always refers to the built in tag field of the record. (See the discussion of tags and segment labelling under DESCRIPTION.) The name "REC" refers to the record number (from 1) of the record in the set of input files and the name "FILE" refers to the filename of the input file in the set of input files.</PRE><H2>EXPRESSION ERRORS</H2><PRE> There are three types of expression errors. The first type are syntax errors caught by the parser. These result result in a "syntax error" message followed by the offending character. In the current release, the query is usually executed anyway. If the selected records are not wanted, they can be removed from the buffer with the <STRONG>UNDO</STRONG> command. If the select is long (because the input file is large) then the select can be interrupted and then undone. This will be improved in a future release. The other type of expression errors relate to the execution of the expression itself. These include use of undefined fields, undefined functions, field indexes out of bounds, arithmetic overflow and underflow, and divide by zero. Errors that cannot change from one record or one input file to the next are considered fatal and terminate the <STRONG>SELECT</STRONG> (or <STRONG>EVAL</STRONG> or <STRONG>SHOW</STRONG> <STRONG>SELECT</STRONG>). This type of error is caused by trying to call an undefined built in function or trouble running an external function. The other errors described above cause the termination of the expression for the current record. In most cases the expression evaluates to zero. In the case of undefined field and index out of bounds, zero is returned and the expression continues. In the case of arithmetic problems, the expression is terminated and zero is returned for the expression. The reason that these errors are not fatal is that several input files might be open and they do not have to all have the same fields. A field might not be defined for one file of the input set, but might be defined for oth- ers. Therefore, the query should be allowed to process. A message is printed, once for each file, in the case of these errors. The query can be interrupted if the desired results will not be achieved. In all cases a message is printed stating what action is being taken when errors are found.</PRE><H2>ESPS PARAMETERS</H2><PRE> The ESPS parameter file is not read by <EM>select</EM>.</PRE><H2>ESPS COMMON</H2><PRE> ESPS Common file is not read or written by <EM>select</EM>.</PRE><H2>ESPS HEADERS</H2><PRE> <EM>Select</EM> reads the <EM>common</EM>.<EM>type</EM> field from the header of <EM>input</EM> (to make sure that it is of type FEA), and it reads the field-defining information as well. If output files do not exist, their headers are created with <STRONG><A HREF="../man3.html/copy_header.3.html">copy_header (3-ESPS)</A></STRONG>. Unless the <STRONG>-n</STRONG> option is used, the headers of output files are expanded to include the the input files as sources and the selection queries as comments in the <EM>variable</EM>.<EM>comment</EM> field.</PRE><H2>ENVIRONMENT</H2><PRE> The <STRONG>PAGER</STRONG> environment variable determines what paging pro- gram is used to break up large displays of text. By default, the <EM>more</EM> program is used (however, this may be changed by the installer). To use a different pager (or if your system doesn't have <EM>more</EM>), set this environment variable to some other value. A full pathname is not required. If you don't like paging, try setting <STRONG>PAGER</STRONG> to <EM>cat</EM>.</PRE><H2>EXAMPLES</H2><PRE> <EM>This</EM> <EM>command</EM> <EM>gathers</EM> <EM>all</EM> <EM>voiced</EM> <EM>from</EM> <EM>the</EM> <EM>input</EM> <EM>files</EM> <EM>into</EM> <EM>allvoiced</EM>.<EM>fea</EM> select -q 'frame_type == "VOICED"' -o allvoiced.fea *.fana <EM>This</EM> <EM>command</EM> <EM>applies</EM> <EM>a</EM> <EM>command</EM> <EM>file</EM> <EM>of</EM> <EM>queries</EM> <EM>on</EM> <EM>file1</EM> <EM>with</EM> <EM>output</EM> <EM>to</EM> <EM>file2</EM> select -o file2 file1 < commands Examples of queries: select pulse_len = 90 & frame_type = "VOICED" <EM>frame</EM>_<EM>type</EM> <EM>is</EM> <EM>a</EM> <EM>CODED</EM> <EM>type</EM> select (a = 3 & FILE = "f1") | (b = 4 & FILE = "f2") <EM>this</EM> <EM>means</EM> <EM>to</EM> <EM>select</EM> <EM>records</EM> <EM>with</EM> <EM>a</EM> = <EM>3</EM> <EM>from</EM> <EM>input</EM> <EM>file</EM> <EM>f1</EM> <EM>and</EM> <EM>b</EM> = <EM>4</EM> <EM>from</EM> <EM>input</EM> <EM>file</EM> <EM>f2</EM>; <EM>assuming</EM> <EM>that</EM> <EM>there</EM> <EM>are</EM> <EM>at</EM> <EM>least</EM> <EM>two</EM> <EM>input</EM> <EM>files</EM> select sqrt(gamma)/4 > alpha[3] <EM>If</EM> <EM>gamma</EM> <EM>is</EM> <EM>a</EM> <EM>field</EM> <EM>of</EM> <EM>size</EM> <EM>one</EM>, <EM>then</EM> <EM>its</EM> <EM>value</EM> <EM>is</EM> <EM>used</EM> <EM>by</EM> <EM>the</EM> <EM>sqrt</EM> <EM>function</EM>. <EM>If</EM> <EM>gamma</EM> <EM>is</EM> <EM>a</EM> <EM>field</EM> <EM>of</EM> <EM>greater</EM> <EM>than</EM> <EM>size</EM> <EM>one</EM>, <EM>then</EM> <EM>the</EM> <EM>element</EM> <EM>is</EM> <EM>used</EM> (<EM>same</EM> <EM>as</EM> <EM>saying</EM> <EM>gamma</EM>[<EM>0</EM>]). select sum(gamma) > mean(beta) <EM>These</EM> <EM>functions</EM> <EM>operate</EM> <EM>on</EM> <EM>entire</EM> <EM>fields</EM>, <EM>so</EM> <EM>the</EM> <EM>fieldname</EM> <EM>here</EM> <EM>without</EM> <EM>the</EM> <EM>index</EM> <EM>does</EM> <EM>not</EM> <EM>refer</EM> <EM>to</EM> <EM>only</EM> <EM>the</EM> <EM>first</EM> <EM>element</EM>; <EM>it</EM> <EM>refers</EM> <EM>to</EM> <EM>the</EM> <EM>entire</EM> <EM>field</EM>. select sum(gamma) > mean(beta) && ($func1 > 45.6) <EM>sum</EM> <EM>and</EM> <EM>mean</EM> <EM>are</EM> <EM>functions</EM> <EM>of</EM> <EM>fields</EM>. $<EM>func1</EM> <EM>is</EM> <EM>a</EM> <EM>user</EM> <EM>supplied</EM> <EM>external</EM> <EM>program</EM> <EM>which</EM> <EM>is</EM> <EM>called</EM> <EM>for</EM> <EM>each</EM> <EM>record</EM>.</PRE><H2>SEE ALSO</H2><PRE> <STRONG><A HREF="../man5.html/ESPS.5.html">ESPS(5-ESPS)</A></STRONG>, <STRONG><A HREF="../man5.html/FEA.5.html">FEA(5-ESPS)</A></STRONG></PRE><H2>FUTURE CHANGES</H2><PRE> Provide a method to link in user-defined functions to pro- vide higher performance than external functions.</PRE><H2>WARNINGS</H2><PRE> A number of warning and error message are printed in the event of various expression errors. Some errors terminate the query.</PRE><H2>BUGS</H2><PRE> The following paragraph describes the way <EM>select</EM> will handle existing output files and input files with tags: If the output file exists and is segment labelled, and if there is one or more tagged input file, all tagged records written to the output file are converted to segment labelled. If the output file exists and is tagged, and if there is one or more tagged input file, the output file is converted from tagged to segment labelled, and all tagged records written to the output file are converted to segment labelled. This is not done in this version. The pre-existing output file is not changed, and the tag values copied into it may be meaningless (because the <EM>refer</EM> file might be different. A syntax error in a query will terminate the parse of the query and it will then run. After it runs you will get a syntax error message. If the select, selected records that you don't want, use the "undo" command to undo the effect of the most recent select operation. Undo can only be used once after each select. You can't undo an undo (except to select again). If referenced fieldname is a complex feature field, then the real part of that is used in the expression. Better sup- port for complex types will be added in the next version.</PRE><H2>AUTHOR</H2><PRE> Manual page by John Shore and Alan Parker Program by Alan Parker</PRE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -