mecab-0.4.0: A Haskell binding to MeCab

Safe HaskellNone

Text.MeCab

Contents

Synopsis

MeCab type

data MeCab Source

Instances

Error Type

Node type

data Node s Source

Constructors

Node 

Fields

nodeSurface :: s

Surface string

nodeFeature :: s

Feature string

nodeRlength :: Int

Uength of the surface form including white space before the morph

nodeId :: Int

Unique node id

nodeRcAttr :: Int

Right attribute id

nodeLcAttr :: Int

Left attribute id

nodePosid :: Int

Unique part of speech id

nodeCharType :: Int

Character type

nodeStat :: Stat

Status of this model

nodeIsBest :: Bool

Is this node best?

nodeAlpha :: Double

Forward accumulative log summation

nodeBeta :: Double

backward accumulative log summation

nodeProb :: Double

marginal probability

nodeWcost :: Int

Word cost

nodeCost :: Int

Best accumulative cost from bos node to this node

Instances

Eq s => Eq (Node s) 
Read s => Read (Node s) 
Show s => Show (Node s) 

data Stat Source

Constructors

NOR

Normal node defined in the dictionary

UNK

Unknown node not defined in the dictionary

BOS

Virtual node representing a beginning of the sentence

EOS

Virtual node representing a end of the N-best enumeration

EON

Virtual node representing a end of the N-best enumeration

Instances

String-like class

Initializing MeCab

new :: [String] -> IO MeCabSource

Initializing MeCab by passing command-line args

new2 :: String -> IO MeCabSource

Initializing MeCab by passing concatenated command-line args

Parsing

parse :: MeCabString s => MeCab -> s -> IO sSource

Parse given string and obtain results as a string format

parseToNodes :: MeCabString s => MeCab -> s -> IO [Node s]Source

Parse given string and obtain results as a nodes

N-best parsing

parseNBest :: MeCabString s => MeCab -> Int -> s -> IO sSource

Parse given string and obtain whole N-best results as a string format

parseNBestInit :: MeCabString s => MeCab -> s -> IO ()Source

Parse given string and prepare obtaining N-best results

nBestNext :: MeCabString s => MeCab -> IO (Maybe s)Source

Obtain next result as a string format

nBestNextNodes :: MeCabString s => MeCab -> IO (Maybe [Node s])Source

Obtain next result as a nodes

Setting properties

Geting MeCab version

version :: IO StringSource

Get MeCab version