xref: /PHP-5.5/ext/enchant/docs/examples/example1.php (revision 02a046b1)
1<?php
2$tag = 'en_US';
3$r = enchant_broker_init();
4$bprovides = enchant_broker_describe($r);
5echo "Current broker provides the following backend(s):\n";
6print_r($bprovides);
7
8
9if (enchant_broker_dict_exists($r,$tag)) {
10	$d = enchant_broker_request_dict($r, $tag);
11	$dprovides = enchant_dict_describe($d);
12	echo "dictionary $tag provides:\n";
13	$spellerrors = enchant_dict_check($d, "soong");
14	print_r($dprovides);
15	echo "found $spellerrors spell errors\n";
16	if (spellerrors) {
17		$suggs = enchant_dict_suggest($d, "soong");
18		echo "Suggestions for 'soong':";
19		print_r($suggs);
20	}
21	enchant_broker_free_dict($d);
22} else {
23}
24enchant_broker_free($r);
25?>
26