Skip to content

Commit ccbefa2

Browse files
Merge branch 'mvc-spellcheck' into 'hotfix/hotfix-v14.4.0.20'
Have committed spellcheck documents Committed spellcheck documents See merge request !17
2 parents dce91fd + f72bd02 commit ccbefa2

File tree

12 files changed

+1135
-0
lines changed

12 files changed

+1135
-0
lines changed

aspnetmvc-toc.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,6 +2125,34 @@
21252125
</li>
21262126
</ul>
21272127
</li>
2128+
2129+
<li>
2130+
SpellCheck
2131+
<ul>
2132+
<li>
2133+
<a href="/aspnetmvc/spellcheck/overview">Overview</a>
2134+
</li>
2135+
<li>
2136+
<a href="/aspnetmvc/spellcheck/getting-started">Getting Started</a>
2137+
</li>
2138+
<li>
2139+
<a href="/aspnetmvc/spellcheck/dictionary">Dictionary</a>
2140+
</li>
2141+
<li>
2142+
<a href="/aspnetmvc/spellcheck/modes">Modes</a>
2143+
</li>
2144+
<li>
2145+
<a href="/aspnetmvc/spellcheck/functionalities">Functionalities</a>
2146+
</li>
2147+
<li>
2148+
<a href="/aspnetmvc/spellcheck/customization">Customization</a>
2149+
</li>
2150+
<li>
2151+
<a href="/aspnetmvc/spellcheck/localization">Localization</a>
2152+
</li>
2153+
</ul>
2154+
</li>
2155+
21282156
<li>
21292157
SplitButton
21302158
<ul>
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
layout: post
3+
title: SpellCheck | SpellCheck | ASP.NET MVC | Syncfusion
4+
description: customization
5+
platform: ejmvc
6+
control: SpellCheck
7+
documentation: ug
8+
---
9+
10+
# Customization
11+
12+
The Essential ASP.NET MVC SpellCheck provides option to customize for the following scenarios.
13+
14+
* Misspell Word Appearance
15+
* Restrict Suggestion Count
16+
17+
## Misspell Word Appearance
18+
19+
The SpellCheck control provide the support(misspellWordCss) to display the error word in user defined style. By default displaying the error words with the red underline.
20+
The following code example depicts the way to customize the error word highlight (displaying error word with red color font and lightblue background).
21+
22+
{% highlight CSHTML %}
23+
24+
@section ControlsSection{
25+
<div id="TextArea" contenteditable="true" name="sentence">
26+
It is a concept vehicle with Liuid Silver body colour, 20-inch wheels, fabric foding roof, electrically-controlled hood,
27+
4-cylinder 2.0 TDI engine rated 204 PS (150 kW; 201 hp) and 400 (295.02 lbf ft), diesel particulate filter and Bluetec emission control system,
28+
quattro permanent four-wheel drve system, Audi S tronic dual-clutch gearbox, McPherson-strut front axle and a four-link rear axle, Audi drive select system with 3 modes (dynamic, sport, efficiency),
29+
MMI control panel with touch pad and dual-view technology, sound system with the proinent extending tweeters.
30+
</div><br />
31+
32+
@Html.EJ().SpellCheck("TextArea").DictionarySettings(dic => dic.CustomDictionaryUrl("../api/SpellCheck/AddToDictionary").DictionaryUrl("../api/SpellCheck/CheckWords")).MisspellWordCss("highlight")
33+
34+
35+
@Html.EJ().Button("SpellCheck").Width("200px").Height("25px").Text("Spell check").ClientSideEvents(evet => evet.Click("contextMenu"))
36+
}
37+
38+
@section ScriptSection{
39+
<script type="text/javascript">
40+
function contextMenu () {
41+
var spellObj = $("#TextArea").data("ejSpellCheck");
42+
spellObj.validate();
43+
}
44+
</script>
45+
}
46+
@section StyleSection{
47+
<style>
48+
.highlight {
49+
background-color: lightblue;
50+
color: red;
51+
}
52+
</style>
53+
}
54+
55+
{% endhighlight %}
56+
57+
Once you have run the above code, you get an output like below.
58+
59+
![](customization_images/customization_img1.png)
60+
61+
## Restrict Suggestion Count
62+
63+
The SpellCheck control provides option (maxSuggestionCount) to restrict the count that the number of items displayed in the suggestion list.
64+
The following code example describes the way to control the suggestion count.
65+
66+
{% highlight CSHTML %}
67+
68+
@section ControlsSection{
69+
70+
<div id="TextArea" contenteditable="true" name="sentence">
71+
It is a concept vehicle with Liuid Silver body colour, 20-inch wheels, fabric foding roof, electrically-controlled hood,
72+
4-cylinder 2.0 TDI engine rated 204 PS (150 kW; 201 hp) and 400 (295.02 lbf ft), diesel particulate filter and Bluetec emission control system,
73+
quattro permanent four-wheel drve system, Audi S tronic dual-clutch gearbox, McPherson-strut front axle and a four-link rear axle, Audi drive select system with 3 modes (dynamic, sport, efficiency),
74+
MMI control panel with touch pad and dual-view technology, sound system with the proinent extending tweeters.
75+
</div><br />
76+
77+
@Html.EJ().SpellCheck("TextArea").DictionarySettings(dic => dic.CustomDictionaryUrl("../api/SpellCheck/AddToDictionary").DictionaryUrl("../api/SpellCheck/CheckWords")).MaxSuggestionCount(5)
78+
79+
80+
@Html.EJ().Button("SpellCheck").Width("200px").Height("25px").Text("Spell check").ClientSideEvents(evet => evet.Click("contextMenu"))
81+
}
82+
83+
@section ScriptSection{
84+
<script type="text/javascript">
85+
function contextMenu () {
86+
var spellObj = $("#TextArea").data("ejSpellCheck");
87+
spellObj.validate();
88+
}
89+
</script>
90+
}
91+
92+
{% endhighlight %}
93+
94+
Once you have run the above code, you get an output like below.
95+
96+
![](customization_images/restrict_img1.png)

aspnetmvc/SpellCheck/Dictionary.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
layout: post
3+
title: SpellCheck | SpellCheck | ASP.NET MVC | Syncfusion
4+
description: dictionary
5+
platform: ejmvc
6+
control: SpellCheck
7+
documentation: ug
8+
---
9+
10+
# Dictionary
11+
12+
Essential ASP.NET MVC SpellCheck uses two different types of dictionary.
13+
14+
* Default Dictionary
15+
* Custom Dictionary
16+
17+
## Default Dictionary
18+
19+
The default dictionary is a primary dictionary file location to read the dictionary words for comparing it with the input words to identify its erroneous.
20+
The following code example depicts the way to mention the default dictionary path and to read its content.
21+
22+
{% highlight C# %}
23+
24+
SpellCheckController()
25+
26+
{
27+
28+
if (baseDictionary == null)
29+
30+
{
31+
32+
// Here you need to specify the corresponding file name (ex. Default.dic)
33+
34+
string filePath = HttpContext.Current.Server.MapPath("~/App_Data/SpellCheck/Default.dic");
35+
36+
Stream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
37+
38+
baseDictionary = new SpellCheckerBase(stream);
39+
40+
}
41+
42+
this.CustomFileRead();
43+
44+
}
45+
46+
{% endhighlight %}
47+
48+
49+
## Custom Dictionary
50+
51+
The custom dictionary is a collection of custom words that are used for spell checking (i.e. technical terms/words, company names, etc.,).
52+
The following code example describes the way to mention the custom dictionary path to read its content.
53+
54+
{% highlight C# %}
55+
56+
private readonly string _customFilePath = HttpContext.Current.Server.MapPath("~/App_Data/SpellCheck/Custom.dic");
57+
58+
// Here you need to specify the corresponding custom dictionary file name
59+
60+
private void CustomFileRead()
61+
{
62+
63+
Stream stream1 = new FileStream(_customFilePath, FileMode.Open, FileAccess.ReadWrite);
64+
65+
customDictionary = new SpellCheckerBase(stream1);
66+
67+
}
68+
69+
{% endhighlight %}
70+
71+
N> The custom words will be displayed within the custom dictionary file line by line (i.e. one word per line).
72+
73+
### Add a Word to Custom dictionary
74+
75+
You can directly add the necessary words in the custom dictionary file or else by using the SpellCheck control public method addToDictionary to add the custom words one by one.

0 commit comments

Comments
 (0)