package mecab

  1. Overview
  2. Docs

The core module for part-of-speech and morphological analysis.

The core module for part-of-speech and morphological analysis.

type t
type lattice_level =
  1. | ONE_BEST
    (*

    Suggest the single best solution

    *)
  2. | NBEST
    (*

    Suggest N-best solution

    *)
  3. | PROB
    (*

    Separating words with probabilities

    *)
val lattice_level_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> lattice_level
val sexp_of_lattice_level : lattice_level -> Ppx_sexp_conv_lib.Sexp.t

Construction

val create : string array -> t
val create2 : string -> t

Properties

val get_partial : t -> bool
val set_partial : t -> bool -> unit
val get_theta : t -> float
val set_theta : t -> float -> unit
val get_lattice_level : t -> lattice_level
val set_lattice_level : t -> lattice_level -> unit
val get_all_morphs : t -> bool
val set_all_morphs : t -> bool -> unit

Dictionary information

type dictionary_type =
  1. | SYS_DIC
    (*

    This is a system dictionary.

    *)
  2. | USR_DIC
    (*

    This is a user dictionary.

    *)
  3. | UKN_DIC
    (*

    This is a unknown word dictionary.

    *)
val dictionary_type_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> dictionary_type
val sexp_of_dictionary_type : dictionary_type -> Ppx_sexp_conv_lib.Sexp.t
type dictionary_info = {
  1. filename : string;
    (*

    filename of dictionary. On Windows, filename is stored in UTF-8 encoding.

    *)
  2. charset : string;
    (*

    character set of the dictionary. e.g., "SHIFT-JIS", "UTF-8".

    *)
  3. size : int;
    (*

    How many words are registered in this dictionary.

    *)
  4. dic_type : dictionary_type;
    (*

    dictionary type

    *)
  5. lsize : int;
    (*

    left attributes size

    *)
  6. rsize : int;
    (*

    right attributes size

    *)
  7. version : int;
    (*

    version of this dictionary

    *)
}
val dictionary_info_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> dictionary_info
val sexp_of_dictionary_info : dictionary_info -> Ppx_sexp_conv_lib.Sexp.t
val dictionary_info : t -> dictionary_info list

Parse sentense

val sparse_tostr : t -> ?pos:int -> ?len:int -> string -> string
val sparse_tonode : t -> ?pos:int -> ?len:int -> string -> Node.t list
val nbest_sparse_tostr : t -> n:int -> ?pos:int -> ?len:int -> string -> string
val nbest_init : t -> ?pos:int -> ?len:int -> string -> unit
val nbest_next_tostr : t -> string
val nbest_next_tonode : t -> Node.t list
OCaml

Innovation. Community. Security.