📄 text.h
字号:
/*** Copyright (C) 2006 Thai Computational Linguistics Laboratory (TCL)** National Institute of Information and Communications Technology (NICT)** Canasai Kruengkrai <canasai xx gmail yy com, where xx=at and yy=dot>**** This file is part of the `libs' library.**** This library is free software; you can redistribute it and/or modify** it under the terms of the GNU General Public License as published by** the Free Software Foundation; either version 2 of the License, or** (at your option) any later version.**** This program is distributed in the hope that it will be useful,** but WITHOUT ANY WARRANTY; without even the implied warranty of** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the** GNU General Public License for more details.**** You should have received a copy of the GNU General Public License** along with this program; if not, write to the Free Software** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.*//* Take two strings */char *text_append( char *w1, char *w2 );/* Take two strings, and append them with a space between them */char *text_append_with_space( char *w1, char *w2 );/* Take two strings, and append them with a given character between them */char *text_append_with_char( char *w1, char *w2, char w3 );char *text_sub_string_itself( char *old_string, int start, int end );char *text_append_itself_with_prefix( char *prefix, char *str_itself );char *text_append_itself_with_suffix( char *str_itself, char *suffix );/* Copy a string */char *text_copy( char *str );/* Copy a string, starting with a character by skipping whitespace ` ' and tab `\t' */char *text_copy2( char *str );/* Copy a string, skipping whitespace ` ' and all control characters */char *text_copy3( char *str );/* copy a string line, espacially skipping control characters */char *text_copy4( char *str );/* Make sure that we aren't processing a blank line */int text_not_blank( char *str );/* Return a number of tokenized words in a string */int text_num_words( char *str );/* Return a number of spaces in a string */int text_num_spaces( char *str );/* Take a string with spaces and do a split *//* Each element in the array is a separate string of memory. *//* you are responsible for freeing x */char **text_split_independent( char *str );/* Take a string with delimiters and do a split *//* The string must be in a formal form such as |x|x|x|, where delimiter is ``|'' */char **text_explode( char *str, char* delimiter );/* Take a string with delimiters and do a split *//* The string can be in a less formal form such as |x |x| x|, where delimiter is ``| '' */char **text_split_with_delimiter( char *str, char* delimiter );char *text_make_lower( char *str );char *text_make_upper( char *str );char *text_sub_string( char *str, int start, int end );void text_scan( char *file_name, int *num_tokens, int *num_lines, int *longest_line );int text_found_char_in( char *any_string );int text_is_digit( char *any_string );void text_string_scan( char *file_name, int *num_tokens, int *num_lines, int *longest_line, int *num_chars );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -