Skip to content

Instantly share code, notes, and snippets.

@aero
Created April 6, 2010 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aero/357831 to your computer and use it in GitHub Desktop.
Save aero/357831 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
# 사용법
# chmod a+x kspell.pl
# ./kspell.pl "안뇽하세요? 방갑습니다."
use strict;
use warnings;
use WebService::KoreanSpeller;
use Encode qw/encode decode/;
my $text = decode('utf8', $ARGV[0]);
my $checker = WebService::KoreanSpeller->new( text => $text );
my @results = $checker->spellcheck;
binmode STDOUT, ':encoding(UTF-8)';
print "(",$_->{position},")",$_->{incorrect}," -> ",$_->{correct},"\n",
$_->{comment},"\n-------------------------------\n" for @results;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment