초보자를 위한 Linux aspell 명령 자습서(예제 5개)
이 페이지에서
- Linux aspell 명령
- Q1. aspell 명령을 사용하는 방법?\n
- Q2. aspell로 철자 오류가 있는지 파일을 확인하는 방법은 무엇입니까?\n
- Q3. aspep을 사용하여 개별 단어를 확인하는 방법은 무엇입니까?\n
- Q4. Aspell을 사용하여 단어를 대량으로 확인하는 방법은 무엇입니까?\n
- Q5. aspell에서 사용하는 사전을 제어하는 방법은 무엇입니까?\n
- 결론
작업에 텍스트 파일이나 문서를 작성하거나 편집하는 작업이 포함된 경우 맞춤법 검사기는 중요한 도구입니다. 대부분의 GUI 기반 편집기에는 맞춤법 검사 기능이 내장되어 있지만 명령줄 편집기에 대해서도 마찬가지입니다. 그러나 맞춤법 검사에 도움이 되는 별도의 명령줄 도구가 있습니다.
이 자습서에서는 aspell이라는 유틸리티에 대해 설명합니다. 하지만 시작하기 전에 이 문서의 모든 예시가 Ubuntu 18.04 LTS 머신에서 테스트되었음을 언급할 가치가 있습니다.
리눅스 aspell 명령어
처음에 이미 언급했듯이 aspell 명령을 사용하면 텍스트 파일에서 맞춤법 검사를 수행할 수 있습니다. 개별 단어도 확인할 수 있습니다. 구문은 다음과 같습니다.
aspell [options] <command>
이 도구에 대한 매뉴얼 페이지의 내용은 다음과 같습니다.
aspell is a utility program that connects to the Aspell library so that
it can function as an ispell -a replacement, as an independent spell
checker, as a test utility to test out Aspell library features, and as
a utility for managing dictionaries used by the library.
The Aspell library contains an interface allowing other programs direct
access to its functions and therefore reducing the complex task of
spell checking to simple library calls. The default library does not
contain dictionary word lists. To add language dictionaries, please
check your distro first for modified dictionaries, otherwise look here
for base language dictionaries <http://aspell.net>.
다음은 유틸리티 작동 방식에 대한 더 나은 아이디어를 제공하는 Q&A 형식의 예입니다.
Q1. aspell 명령을 사용하는 방법?
aspell의 기본 사용법은 완전히 간단하지 않으므로 사용법 요약을 얻는 것이 좋습니다. 사용법 명령 옵션을 사용하여 얻을 수 있습니다.
aspell usage
출력 결과는 다음과 같습니다.
Usage: aspell [options] <command>
<command> is one of:
-?|usage display a brief usage message
help display a detailed help message
-c|check <file> to check a file
-a|pipe "ispell -a" compatibility mode
[dump] config dumps the current configuration to stdout
config <key> prints the current value of an option
[dump] dicts | filters | modes
lists available dictionaries / filters / filter modes
[options] is any of the following:
--encoding=<str> encoding to expect data to be in
--mode=<str> filter mode
-l,--lang=<str> language code
-d,--master=<str> base name of the main dictionary to use
--sug-mode=<str> suggestion mode
Q2. aspell로 철자 오류가 있는지 파일을 확인하는 방법은 무엇입니까?
이것은 -c 명령줄 옵션을 사용하여 수행할 수 있습니다. 예를 들어:
aspell -c test.txt
다음은 위의 명령을 실행할 때 표시되는 도구입니다.
따라서 도구가 텍스트의 첫 번째 맞춤법 오류를 강조 표시하고 창 하단에서 교체로 관심이 있다고 생각되는 옵션을 제공하는 것을 볼 수 있습니다. 또한 자세히 보면 현재 강조 표시된 맞춤법 오류를 무시하고, 현재 강조 표시된 단어의 모든 항목을 바꾸고, aspells 사전에 추가하고, 이 보기를 종료하는 옵션도 있습니다.
Q3. aspep을 사용하여 개별 단어를 확인하는 방법은 무엇입니까?
이것은 -a 명령줄 옵션을 사용하여 수행할 수 있습니다.
aspell -a
이 명령을 실행하자마자 사용자 입력을 기다립니다. 이 모드에서 단어를 입력하고 Enter 키를 누르면 stdout에서 맞춤법 추천을 제공하는 철자가 표시됩니다.
다음 스크린샷은 이 명령줄 옵션이 작동하는 모습을 보여줍니다.
Q4. Aspell을 사용하여 단어를 대량으로 확인하는 방법은 무엇입니까?
이는 list 명령 옵션을 사용하여 수행할 수 있습니다.
aspell list
위의 명령은 실행될 때 사용자 입력을 기다립니다. 원하는 만큼 단어를 추가하고 완료되면 Ctrl+D를 누릅니다. 그러면 aspell이 제공한 입력 아래 철자가 틀린 단어를 표시하는 것을 볼 수 있습니다.
다음 스크린샷은 이 옵션의 작동 방식을 보여줍니다.
Q5. aspell에서 사용하는 사전을 제어하는 방법은 무엇입니까?
aspell의 매뉴얼 페이지는 이 명령에서 사용하는 사전을 제어하는 데 사용할 수 있는 다양한 옵션을 제공합니다. 다음은 몇 가지 중요한 사항입니다.
--master=<name>, -d <name>
Base name of the dictionary to use. If this option is specified
then Aspell will either use this dictionary or die.
--dict-dir=<directory>
Location of the main dictionary word list.
--lang=<string>, -l <string>
Language to use. It follows the same format of the LANG envi?
ronmental variable on most systems. It consists of the two let?
ter ISO 639 language code and an optional two letter ISO 3166
country code after a dash or underscore. The default value is
based on the value of the LC_MESSAGES locale.
--size=<string>
The preferred size of the dictionary word list. This consists
of a two char digit code describing the size of the list, with
typical values of: 10=tiny, 20=really small, 30=small, 40=med-
small, 50=med, 60=med-large, 70=large, 80=huge, 90=insane.
결론
aspell이 Linux 명령줄 사용자가 알아야 할 유용한 도구라는 데 동의할 것입니다. 여기에서 이 도구의 기본 사항에 대해 논의했습니다. 이러한 옵션을 연습한 후에는 명령어 매뉴얼 페이지로 이동하여 자세한 내용을 알아보세요.