php_mecab API


php_mecab-0.2.0の関数一覧を整形してみました。
  1. mecab_version - Get the version number of MeCab.
  2. mecab_split - Split string into an array of morphemes.
  3. mecab_new - Create new tagger resource of MeCab.
  4. mecab_destroy - Free the tagger.
  5. mecab_sparse_tostr - Get the parse result as a string.
  6. mecab_sparse_tonode - Get the parse result as a node.
  7. mecab_nbest_sparse_tostr - Get the N-Best list as a string.
  8. mecab_nbest_init - Initialize the N-Best list.
  9. mecab_nbest_next_tostr - Get the next result of N-Best as a string.
  10. mecab_nbest_next_tonode - Get the next result of N-Best as a node.
  11. mecab_format_node - Format a node to string. The format is specified by "-O" option or --{node|unk|bos|eos}-format=STR. The detail is found in the web site and/or the manpage of MeCab.
  12. mecab_dictionary_info - Get the information of using dictionary as an associative array.
  13. mecab_node_toarray - Get all elements of the node as an associated array.
  14. mecab_node_tostring - Get the formatted string of the node.
  15. mecab_node_current - [Iterator implementation] Return the current element.
  16. mecab_node_key - [Iterator implementation] Return the key of the current element.
  17. mecab_node_valid - [Iterator implementation] Check if there is a current element after calls to rewind() or next().
  18. mecab_node_rewind - [Iterator implementation] Set the node pointer to the beginning.
  19. mecab_node_next - Get the next node.
  20. mecab_node_prev - Get the previous node.
  21. mecab_node_next - Get the next node.
  22. mecab_node_enext - Get the enext node.
  23. mecab_node_bnext - Get the bnext node.
  24. mecab_node_rpath - Get the rpath.
  25. mecab_node_lpath - Get the lpath.
  26. mecab_node_begin_node_list - Get the given index of begin-node list.
  27. mecab_node_end_node_list - Get the given index of end-node list.
  28. mecab_node_surface - Get the surface.
  29. mecab_node_feature - Get the feature.
  30. mecab_node_id - Get the ID.
  31. mecab_node_length - Get the length of the surface.
  32. mecab_node_rlength - Get the length of the surface and its leading whitespace.
  33. mecab_node_rcattr - Get the ID of the right context.
  34. mecab_node_lcattr - Get the ID of the left context.
  35. mecab_node_posid - Get the ID of the Part-of-Speech. (node->posid is not used in MeCab-0.90)
  36. mecab_node_char_type - Get the type of the character.
  37. mecab_node_stat - Get the status.
  38. mecab_node_isbest - Determine whether the node is the best solution.
  39. mecab_node_alpha - Get the forward log probability.
  40. mecab_node_beta - Get the backward log probability.
  41. mecab_node_prob - Get the marginal probability.
  42. mecab_node_wcost - Get the word arising cost.
  43. mecab_node_cost - Get the cumulative cost.
  44. mecab_path_rnext - Get the rnext path.
  45. mecab_path_lnext - Get the lnext path.
  46. mecab_path_rnode - Get the rnode.
  47. mecab_path_lnode - Get the lnode.
  48. mecab_path_prob - Get the marginal probability.
  49. mecab_path_cost - Get the cumulative cost.

mecab_version - Get the version number of MeCab.

 * string mecab_version(void)

 * @return	string	The version of linked MeCab library.


mecab_split - Split string into an array of morphemes.

 * array mecab_split(string str[, string dicdir[, string userdic[, callback filter]]])
 * array MeCab_Tagger::split(string str[, string dicdir[, string userdic[, callback filter]]])

 * @param	string	$str	The target string.
 * @param	string	$dicdir	The path for system dictionary.
 * @param	string	$userdic	The path for user dictionary.
 * @param	callback	$filter	A filter function or method.
 * @return	array


mecab_new - Create new tagger resource of MeCab.

 * resource mecab mecab_new([array options])
 * object MeCab_Tagger MeCab_Tagger::__construct([array options])

 * @param   array   $options    The analysis/output options. (optional)
 *                              The values are same to command line options.
 *                              The detail is found in the web site and/or the manpage of MeCab.
 * @return  resource mecab  A tagger resource of MeCab.


mecab_destroy - Free the tagger.

 * void mecab mecab_destroy(resource mecab mecab)
 * void MeCab_Tagger::__destruct()

 * @param   resource mecab  $mecab  The tagger resource of MeCab.
 * @return  void


mecab_sparse_tostr - Get the parse result as a string.

 * string mecab_sparse_tostr(resource mecab mecab, string str[, int len[, int olen]])
 * string MeCab_Tagger::parse(string str[, int len[, int olen]])
 * string MeCab_Tagger::parseToString(string str[, int len[, int olen]])

 * @param   resource mecab  $mecab  The tagger resource of MeCab.
 * @param   string  $str    The parse target.
 * @param   int $len    The maximum length that can be analyzed. (optional)
 * @param   int $olen   The limit length of the output buffer. (optional)
 * @return  string  The parse result.
 *                  If output buffer has overflowed, returns false.


mecab_sparse_tonode - Get the parse result as a node.

 * resource mecab_node mecab_sparse_tonode(resource mecab mecab, string str[, int len])
 * object MeCab_Node MeCab_Tagger::parseToNode(string str[, int len])

 * @param   resource mecab  $mecab  The tagger resource of MeCab.
 * @param   string  $str    The parse target.
 * @param   int $len    The maximum length that can be analyzed. (optional)
 * @return  resource mecab_node The result node of given string.


mecab_nbest_sparse_tostr - Get the N-Best list as a string.

 * string mecab_nbest_sparse_tostr(resource mecab mecab, int n, string str[, int len[, int olen]])
 * string MeCab_Tagger::parseNBest(int n, string str[, int len[, int olen]])

 * @param   resource mecab  $mecab  The tagger resource of MeCab.
 * @param   int $n  The number of the result list.
 * @param   string  $str    The parse target.
 * @param   int $len    The maximum length that can be analyzed. (optional)
 * @param   int $olen   The maximum length of the output. (optional)
 * @return  string  The N-Best list.
 *                  If output buffer has overflowed, returns false.


mecab_nbest_init - Initialize the N-Best list.

 * bool mecab_nbest_init(resource mecab mecab, string str[, int len])
 * bool MeCab_Tagger::parseNBestInit(string str[, int len])

 * @param   resource mecab  $mecab  The tagger resource of MeCab.
 * @param   string  $str    The parse target.
 * @param   int $len    The maximum length that can be analyzed. (optional)
 * @return  bool    True if succeeded to initilalize, otherwise returns false.


mecab_nbest_next_tostr - Get the next result of N-Best as a string.

 * string mecab_nbest_next_tostr(resource mecab mecab[, int olen])
 * string MeCab_Tagger::next([int olen]])

 * @param   resource mecab  $mecab  The tagger resource of MeCab.
 * @param   int $olen   The maximum length of the output. (optional)
 * @return  string  The parse result of the next pointer.
 *                  If there are no more results, returns false.
 *                  Also returns false if output buffer has overflowed.


mecab_nbest_next_tonode - Get the next result of N-Best as a node.

 * resource mecab_node mecab_nbest_next_tonode(resource mecab mecab)
 * object MeCab_Node MeCab_Tagger::nextNode(void)

 * @param   resource mecab  $mecab  The tagger resource of MeCab.
 * @return  resource mecab_node The result node of the next pointer.
 *                              If there are no more results, returns false.


mecab_format_node - Format a node to string. The format is specified by "-O" option or --{node|unk|bos|eos}-format=STR. The detail is found in the web site and/or the manpage of MeCab.

 * string mecab_format_node(resource mecab mecab, resource mecab_node node)
 * string MeCab_Tagger::formatNode(object MeCab_Node node)

 * @param   resource mecab  $mecab  The tagger resource of MeCab.
 * @param   resource mecab_node $node   The node of the source string.
 * @return  string  The formatted string.


mecab_dictionary_info - Get the information of using dictionary as an associative array.

 * array mecab_dictionary_info(resource mecab mecab)
 * array MeCab_Tagger::dictionaryInfo(void)

 * @return	array	The information of the dictionary.


mecab_node_toarray - Get all elements of the node as an associated array.

 * array mecab_node_toarray(resource mecab_node node)
 * array MeCab_Node::toArray(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @param   bool    $dump_all   Whether dump all related nodes and paths or not.
 * @return  array   All elements of the node.


mecab_node_tostring - Get the formatted string of the node.

 * string mecab_node_tostring(resource mecab_node node)
 * string MeCab_Node::toString(void)
 * string MeCab_Node::__toString(void)

 * @param	resource mecab_node	$node	The node of the source string.
 * @return	string	The formatted string.
 * @see	mecab_format_node


mecab_node_current - [Iterator implementation] Return the current element.

 * resource mecab_node mecab_node_current(resource mecab_node node)
 * object MeCab_Node MeCab_Node::current(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @param   resource mecab_node Just a copy of given resource.


mecab_node_key - [Iterator implementation] Return the key of the current element.

 * int mecab_node_key(resource mecab_node)
 * int MeCab_Node::key(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  int The cumulative cost of the node.


mecab_node_valid - [Iterator implementation] Check if there is a current element after calls to rewind() or next().

 * bool mecab_node_valid(resource mecab_node)
 * bool MeCab_Node::valid(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  bool    True if there is an element after the current element, otherwise returns false.


mecab_node_rewind - [Iterator implementation] Set the node pointer to the beginning.

 * bool mecab_node_rewind(resource mecab_node node)
 * bool MeCab_Node::rewind(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  bool    Always true.


mecab_node_next - Get the next node.

 * resource mecab_node mecab_node_next(resource mecab_node node)
 * object MeCab_Node MeCab_Node::getNext(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  resource mecab_node The next node.
 *                              If the given node is the last one, returns FALSE.


mecab_node_prev - Get the previous node.

 * resource mecab_node mecab_node_prev(resource mecab_node node)
 * object MeCab_Node MeCab_Node::getPrev(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  resource mecab_node The previous node.
 *                              If the given node is the first one, returns FALSE.


mecab_node_next - Get the next node.

 * resource mecab_node mecab_node_next(resource mecab_node node)
 * object MeCab_Node MeCab_Node::getNext(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  resource mecab_node The next node.
 *                              If the given node is the last one, returns FALSE.


mecab_node_enext - Get the enext node.

 * resource mecab_node mecab_node_enext(resource mecab_node node)
 * object MeCab_Node MeCab_Node::getENext(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  resource mecab_node The next node which has same end point as the given node.
 *                              If there is no `enext' node, returns false.


mecab_node_bnext - Get the bnext node.

 * resource mecab_node mecab_node_bnext(resource mecab_node node)
 * object MeCab_Node MeCab_Node::getBNext(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  resource mecab_node The next node which has same beggining point as the given one.
 *                              If there is no `bnext' node, returns false.


mecab_node_rpath - Get the rpath.

 * resource mecab_path mecab_node_rpath(resource mecab_node node)
 * object MeCab_Path MeCab_Node::getRPath(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  resource mecab_path The next node which has same end point as the given node.
 *                              If there is no `rpath' node, returns false.


mecab_node_lpath - Get the lpath.

 * resource mecab_path mecab_node_lpath(resource mecab_node node)
 * object MeCab_Path MeCab_Node::getLPath(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  resource mecab_path The next node which has same beggining point as the given one.
 *                              If there is no `lpath' node, returns false.


mecab_node_begin_node_list - Get the given index of begin-node list.

 * resource mecab_node mecab_node_begin_node_list(resource mecab_node node, int index)

 * @param	resource mecab_node	$node	The node of the source string.
 * @param	int	$index	An indexo of the node.
 * @return	resource mecab_node
 * @see	 mecab_node_end_node_list


mecab_node_end_node_list - Get the given index of end-node list.

 * resource mecab_node mecab_node_end_node_list(resource mecab_node node, int index)

 * @param	resource mecab_node	$node	The node of the source string.
 * @param	int	$index	An indexo of the node.
 * @return	resource mecab_node
 * @see	 mecab_node_begin_node_list


mecab_node_surface - Get the surface.

 * string mecab_node_surface(resource mecab_node node)
 * string MeCab_Node::getSurface(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  string  The surface of the node.


mecab_node_feature - Get the feature.

 * string mecab_node_feature(resource mecab_node node)
 * string MeCab_Node::getFeature(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  string  The feature of the node.


mecab_node_id - Get the ID.

 * int mecab_node_id(resource mecab_node node)
 * int MeCab_Node::getId(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  int The ID of the node.


mecab_node_length - Get the length of the surface.

 * int mecab_node_length(resource mecab_node node)
 * int MeCab_Node::getLength(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  int The length of the surface of the node.


mecab_node_rlength - Get the length of the surface and its leading whitespace.

 * int mecab_node_rlength(resource mecab_node node)
 * int MeCab_Node::getRLength(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  int The length of the surface and its leading whitespace of the node.


mecab_node_rcattr - Get the ID of the right context.

 * int mecab_node_rcattr(resource mecab_node node)
 * int MeCab_Node::getRcAttr(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  int The ID of the right context.


mecab_node_lcattr - Get the ID of the left context.

 * int mecab_node_lcattr(resource mecab_node node)
 * int MeCab_Node::getLcAttr(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  int The ID of the left context.


mecab_node_posid - Get the ID of the Part-of-Speech. (node->posid is not used in MeCab-0.90)

 * int mecab_node_posid(resource mecab_node node)
 * int MeCab_Node::getPosId(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  int The ID of the Part-of-Speech.
 *              Currently, always returns 0.


mecab_node_char_type - Get the type of the character.

 * int mecab_node_char_type(resource mecab_node node)
 * int MeCab_Node::getCharType(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  int The type of the character.


mecab_node_stat - Get the status.

 * int mecab_node_stat(resource mecab_node node)
 * int MeCab_Node::getStat(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  int The status of the node.
 *              The return value is one of the following:
 *                  MECAB_NOR_NODE (0:Normal)
 *                  MECAB_UNK_NODE (1:Unknown)
 *                  MECAB_BOS_NODE (2:Beginning-of-Sentence)
 *                  MECAB_EOS_NODE (3:End-of-Sentence)


mecab_node_isbest - Determine whether the node is the best solution.

 * bool mecab_node_isbest(resource mecab_node node)
 * bool MeCab_Node::getIsBest(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  bool    True if the node is the best, otherwise returns false.


mecab_node_alpha - Get the forward log probability.

 * double mecab_node_alpha(resource mecab_node node)
 * double MeCab_Node::getAlpha(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  double  The forward log probability of the node.


mecab_node_beta - Get the backward log probability.

 * double mecab_node_beta(resource mecab_node node)
 * double MeCab_Node::getBeta(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  double  The backward log probability of the node.


mecab_node_prob - Get the marginal probability.

 * double mecab_node_prob(resource mecab_node node)
 * double MeCab_Node::getProb(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  double  The marginal probability of the node.


mecab_node_wcost - Get the word arising cost.

 * int mecab_node_wcost(resource mecab_node node)
 * int MeCab_Node::getWCost(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  int The word arising cost of the node.


mecab_node_cost - Get the cumulative cost.

 * int mecab_node_cost(resource mecab_node node)
 * int MeCab_Node::getCost(void)

 * @param   resource mecab_node $node   The node of the source string.
 * @return  int The cumulative cost of the node.


mecab_path_rnext - Get the rnext path.

 * resource mecab_path mecab_path_rnext(resource mecab_path path)
 * object MeCab_Path MeCab_Path::getRNext(void)

 * @param   resource mecab_path $path   The path of the source string.
 * @return  resource mecab_path The rnext path.
 *                              If the given path is the first one, returns FALSE.


mecab_path_lnext - Get the lnext path.

 * resource mecab_path mecab_path_lnext(resource mecab_path path)
 * object MeCab_Path MeCab_Path::getLNext(void)

 * @param   resource mecab_path $path   The path of the source string.
 * @return  resource mecab_path The lnext path.
 *                              If the given path is the last one, returns FALSE.


mecab_path_rnode - Get the rnode.

 * resource mecab_node mecab_path_rnode(resource mecab_path path)
 * object MeCab_Node MeCab_Path::getRNode(void)

 * @param   resource mecab_path $path   The path of the source string.
 * @return  resource mecab_node The next path which has same end point as the given path.
 *                              If there is no `rnode' path, returns false.


mecab_path_lnode - Get the lnode.

 * resource mecab_node mecab_path_lnode(resource mecab_path path)
 * object MeCab_Node MeCab_Path::getLNode(void)

 * @param   resource mecab_path $path   The path of the source string.
 * @return  resource mecab_node The next path which has same beggining point as the given one.
 *                              If there is no `lnode' path, returns false.


mecab_path_prob - Get the marginal probability.

 * double mecab_path_prob(resource mecab_path path)
 * double MeCab_Path::getProb(void)

 * @param   resource mecab_path $path   The path of the source string.
 * @return  double  The marginal probability of the path.


mecab_path_cost - Get the cumulative cost.

 * int mecab_path_cost(resource mecab_path path)
 * int MeCab_Path::getCost(void)

 * @param   resource mecab_path $path   The path of the source string.
 * @return  int The cumulative cost of the path.