Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
49c94d80
Commit
49c94d80
authored
Jan 09, 2009
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed tag eating and text duplication in spellchecker
parent
cc275f0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
src/script/functions/spelling.cpp
src/script/functions/spelling.cpp
+10
-2
No files found.
src/script/functions/spelling.cpp
View file @
49c94d80
...
...
@@ -64,7 +64,7 @@ void check_word(const String& tag, const String& input, String& out, Char sep, s
// double space
out
+=
_
(
"<error-spelling>"
);
out
.
append
(
sep
);
out
.
append
(
input
,
prev
,
after
-
end
);
out
.
append
(
input
,
prev
,
after
-
prev
);
out
+=
_
(
"</error-spelling>"
);
}
else
{
if
(
sep
)
out
.
append
(
sep
);
...
...
@@ -74,7 +74,7 @@ void check_word(const String& tag, const String& input, String& out, Char sep, s
// stand alone punctuation
if
(
sep
)
out
.
append
(
sep
);
out
+=
_
(
"<error-spelling>"
);
out
.
append
(
input
,
prev
,
after
-
end
);
out
.
append
(
input
,
prev
,
after
-
prev
);
out
+=
_
(
"</error-spelling>"
);
}
}
else
{
...
...
@@ -115,6 +115,13 @@ SCRIPT_FUNCTION(check_spelling) {
// now walk over the words in the input, and mark misspellings
String
result
;
Char
sep
=
0
;
// indices are used as follows (at the time of check_word call):
// input: "previous <tag>(<tag>word<tag>)<tag>next"
// ^^ ^ ^ ^
// || | | |
// sep | | word_end pos
// prev_end word_start
//
size_t
prev_end
=
0
,
word_start
=
0
,
word_end
=
0
,
pos
=
0
;
while
(
pos
<
input
.
size
())
{
Char
c
=
input
.
GetChar
(
pos
);
...
...
@@ -146,6 +153,7 @@ SCRIPT_FUNCTION(check_spelling) {
// last word
check_word
(
tag
,
input
,
result
,
sep
,
prev_end
,
word_start
,
word_end
,
pos
,
checkers
,
extra_match
,
ctx
);
// done
assert_tagged
(
result
);
SCRIPT_RETURN
(
result
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment