Home php教程 php手册 PHP技巧:PHP脚本中关于拼写检查函数库

PHP技巧:PHP脚本中关于拼写检查函数库

Jun 21, 2016 am 08:58 AM
check link quot

aspell_new :  载入一个新的字典。

aspell_check :  检查一个单字。

aspell_check-raw :  检查一个单字,即使拼错也不改变或修正。

aspell_suggest :  检查一个单字,并提供拼写建议。

aspell_new

载入一个新的字典。

语法:int aspell_new(string master, string personal);

返回值:整数

函数种类:资料处理

内容说明 本函数载入一个新的字典,并赋与一个新的身份值 (整数),以供程序中使用。

使用范例 $aspell_link=aspell_new("english");

aspell_check

检查一个单字。

语法:boolean aspell_check(int dictionary_link, string word);

返回值:布尔值

函数种类:资料处理

内容说明 本函数检查单字的拼写。若拼写正确则返回 true,不正确则返回 false。

使用范例

以下为引用的内容:
$aspell_link=aspell_new("english");
if (aspell_check($aspell_link,"testt")) {
echo "this is a valid spelling";
} else {
echo "sorry, wrong spelling";
}
aspell_check-raw

检查一个单字,即使拼错也不改变或修正。

语法:boolean aspell_check_raw(int dictionary_link, string word);

返回值:布尔值

函数种类:资料处理

内容说明

本函数检查单字的拼写。若拼写正确则返回 true,不正确则返回 false。本函数不会改变或者修正使用者的拼写。

使用范例

以下为引用的内容:
$aspell_link=aspell_new("english");
if (aspell_check_raw($aspell_link,"testt")) {
echo "this is a valid spelling";
} else {
echo "sorry, wrong spelling";
}
aspell_suggest

检查一个单字,并提供拼写建议。

语法:array aspell_suggest(int dictionary_link, string word);

返回值:数组

函数种类:资料处理

内容说明

本函数检查单字的拼写。并给予可能的拼法及正确的建议,以数组类型将结果返回。

使用范例

以下为引用的内容:


$aspell_link=aspell_new("english");
if (!aspell_check($aspell_link,"testt")) {
$suggestions=aspell_suggest($aspell_link,"testt");
for($i=0; $i echo "possible spelling: " . $suggestions[$i] . "
";
}
}
?>



Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1252
24
17 ways to solve the kernel_security_check_failure blue screen 17 ways to solve the kernel_security_check_failure blue screen Feb 12, 2024 pm 08:51 PM

Kernelsecuritycheckfailure (kernel check failure) is a relatively common type of stop code. However, no matter what the reason is, the blue screen error causes many users to be very distressed. Let this site carefully introduce 17 types to users. Solution. 17 solutions to kernel_security_check_failure blue screen Method 1: Remove all external devices When any external device you are using is incompatible with your version of Windows, the Kernelsecuritycheckfailure blue screen error may occur. To do this, you need to unplug all external devices before trying to restart your computer.

How to turn off Palm Check in Windows 11/10 How to turn off Palm Check in Windows 11/10 Feb 19, 2024 pm 09:45 PM

This article will guide you to turn off the PalmCheck function on Windows 11/10 PC. PalmCheck is a feature designed to prevent accidental palm or other touches from being mistakenly recognized as input when typing on the keyboard. This is usually found in touchpad settings, especially on touch-enabled devices like laptops. Sometimes you may want to turn off PalmCheck or a similar feature to give you more flexibility in controlling input in situations where you need to use both the keyboard and touchpad. In this article, we will introduce how to disable PalmCheck function on Windows 11/10 PC, so that you can better cope with the needs when gaming or running applications. What is the P on the touchpad?

Interpretation of Linux system Keepalived health check mechanism Interpretation of Linux system Keepalived health check mechanism Feb 28, 2024 am 09:52 AM

When performing load balancing, a health check tool is generally deployed to ensure that the backend realserver is normal and can provide services. To avoid the situation where the backend realserver is down or the service is unavailable, the load balancer will distribute the request to the realserver. Impact on overall business access. There are many ways to perform health checks, and you can deploy scripts by yourself. Of course, the most commonly used one is the keepalived service. There are three health check methods for keepalived, tcp_check, http_check, and misc_check. Keepalived configuration brief keepalived has three main modules, namely core,

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

What is the difference between link tag and import? What is the difference between link tag and import? Aug 28, 2023 am 11:19 AM

The differences between link tags and import include syntax and usage, functions and features, loading timing, compatibility and support, etc. Detailed introduction: 1. Syntax and usage. The link tag is an HTML tag, used to introduce external resources into HTML documents, such as CSS style sheets, JavaScript scripts, icons, etc. import is the module import syntax in ES6, used in JavaScript files. Introduce external modules; 2. Functions and features. The link tag can introduce a variety of resources, such as CSS style sheets, icons, etc.

The difference between link and import is explained in detail: What are the differences between them? The difference between link and import is explained in detail: What are the differences between them? Jan 06, 2024 am 08:19 AM

In-depth analysis: What is the difference between link and import? When developing web pages or applications, we often need to introduce external CSS files or JavaScript libraries to enhance or customize our code. In this process, link and import are two commonly used methods. Although their purpose is to introduce external resources, there are some differences in specific usage. Syntax and location: link: Use the link tag to link external resources into the HTML file, usually located at the head of the HTML document

The difference between link tag and a tag The difference between link tag and a tag Feb 19, 2024 pm 06:16 PM

The link tag and the a tag are two commonly used tags in HTML. They have different functions and usages. link tag The link tag is mainly used to introduce external resources into HTML documents. It is usually used to introduce external style sheets (CSS files). It can also be used to introduce other types of files, such as image files, audio files, etc. The link tag is located within the tag, usually written after other metadata (such as tags). Basic grammatical format of link tag

What is the difference between using link and import? What is the difference between using link and import? Sep 18, 2023 pm 02:30 PM

The difference between using link and import lies in function, purpose, introduction method, compatibility and applicable scenarios, etc. Detailed introduction: 1. The link tag is used to introduce an external style sheet. It can associate the external style sheet with the HTML document to control the style and layout of the document. The link tag can be used in the head part or body part of the HTML document; 2 The import tag is used to introduce external HTML documents, which can embed one HTML document into another HTML document, modularize and reuse, etc.

See all articles