hanspell-0.2.4.0: Korean spell checker
Safe HaskellNone
LanguageHaskell2010

Language.Hanspell

Synopsis

Documentation

data Typo Source #

Carries the information of a typo.

Constructors

Typo 

Instances

Instances details
Eq Typo Source # 
Instance details

Defined in Language.Hanspell.Typo

Methods

(==) :: Typo -> Typo -> Bool #

(/=) :: Typo -> Typo -> Bool #

Ord Typo Source # 
Instance details

Defined in Language.Hanspell.Typo

Methods

compare :: Typo -> Typo -> Ordering #

(<) :: Typo -> Typo -> Bool #

(<=) :: Typo -> Typo -> Bool #

(>) :: Typo -> Typo -> Bool #

(>=) :: Typo -> Typo -> Bool #

max :: Typo -> Typo -> Typo #

min :: Typo -> Typo -> Typo #

Show Typo Source # 
Instance details

Defined in Language.Hanspell.Typo

Methods

showsPrec :: Int -> Typo -> ShowS #

show :: Typo -> String #

showList :: [Typo] -> ShowS #

fixTyposWithStyle :: Bool -> String -> [Typo] -> String Source #

Fixes typos of given sentences. If given True, the colors of fixed words are inverted.

typoToStringWithStyle :: Bool -> Typo -> String Source #

Converts a Typo to string. If given True, info of the Typo is greyed out.

rmdupTypos :: [Typo] -> [Typo] Source #

Removes the Typos whose tokens are duplicated. Order preserving and O(nlogn).

class Monad m => DaumSpellChecker m Source #

Defines a class for spellCheckByDaum function overloading.

Minimal complete definition

spellCheckByDaum

Instances

Instances details
DaumSpellChecker IO Source #

Bold version returning IO [Typo].

Instance details

Defined in Language.Hanspell.DaumSpellChecker

DaumSpellChecker (MaybeT IO) Source #

Obssesive version returning MaybeT IO [Typo].

Instance details

Defined in Language.Hanspell.DaumSpellChecker

spellCheckByDaum :: DaumSpellChecker m => String -> m [Typo] Source #

Requests spell check to DAUM server, parses the responses, and returns m [Typo]. spellCheckByDaum has two return types. One is MaybeT IO [Typo], and the other is IO [Typo].

import Language.Hanspell 

example = do
    let sentence = "위에계신분, 잘들리세요?"
    typos <- spellCheckByDaum sentence
    mapM_ (putStrLn . typoToStringWithStyle False) typos

The expected output is:

위에계신분, -> 위에 계신 분,
뒤에 오는 명사를 수식하는 관형격 어미 ‘-ㄴ’, ‘-는’, ‘-던’, ‘-ㄹ’ 등과 의존명사는 띄어 쓰는 것이 옳습니다.
(예)
노력한 만큼 대가를 얻다.
소문으로만 들었을 뿐이네.
합격했다는 소리를 들으니 그저 기쁠 따름이다.

잘들리세요? -> 잘 들리세요?
'익숙하고 능란하게', '좋고 훌륭하게'라는 의미의 부사 은 띄어 쓰세요.
(예)
바둑을 잘 두다.
옷을 잘 차려입고 나서니 딴사람 같구나.
다음 대화를 잘 듣고 물음에 답하세요.

daumSpellCheckerMaxChars :: Int Source #

Official maximum character length for a spellCheckByDaum request. Notice that DAUM server can handle more than maximum characters.

class Monad m => PnuSpellChecker m Source #

Defines a class for spellCheckByPnu function overloading.

Minimal complete definition

spellCheckByPnu

Instances

Instances details
PnuSpellChecker IO Source #

Bold version returning IO [Typo].

Instance details

Defined in Language.Hanspell.PnuSpellChecker

PnuSpellChecker (MaybeT IO) Source #

Obssesive version returning MaybeT IO [Typo].

Instance details

Defined in Language.Hanspell.PnuSpellChecker

spellCheckByPnu :: PnuSpellChecker m => String -> m [Typo] Source #

Requests spell check to PNU server, parses the responses, and returns m [Typo]. spellCheckByPnu has two return types. One is MaybeT IO [Typo], and the other is IO [Typo].

import Language.Hanspell 

example = do
    let sentence = "위에계신분, 잘들리세요?"
    typos <- spellCheckByPnu sentence
    mapM_ (putStrLn . typoToStringWithStyle False) typos

The expected output is:

위에계신분 -> 위에 계신 분
'계신 분'으로 띄어 씁니다.

잘들리세요 -> 잘 들리세요
부사는 뒤의 말과 띄어 써야 합니다.
(예)
곧돌아오마 (x)-> 곧 돌아오마 (o)
부디건강해라(x) -> 부디 건강해라(o)
어서오십시오(x) -> 어서 오십시오(o)
...

pnuSpellCheckerMaxWords :: Int Source #

Maximum words count for a spellCheckByPnu request.