Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
lib_mysqludf_stem
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
lib_mysqludf_stem
Commits
31c59cb4
Commit
31c59cb4
authored
Sep 25, 2015
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support longer input.
parent
1b66506e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
lib_mysqludf_stem.cc
lib_mysqludf_stem.cc
+2
-2
tests/stem_word.result
tests/stem_word.result
+3
-0
tests/stem_word.test
tests/stem_word.test
+1
-0
No files found.
lib_mysqludf_stem.cc
View file @
31c59cb4
...
@@ -172,7 +172,7 @@ char *stem_word(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *l
...
@@ -172,7 +172,7 @@ char *stem_word(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *l
if
(
b
!=
c
)
{
if
(
b
!=
c
)
{
stemmed
=
sb_stemmer_stem
(
stemmer
,
(
const
sb_symbol
*
)
b
,
c
-
b
);
stemmed
=
sb_stemmer_stem
(
stemmer
,
(
const
sb_symbol
*
)
b
,
c
-
b
);
len
=
strlen
((
char
*
)
stemmed
);
len
=
strlen
((
char
*
)
stemmed
);
if
(
*
length
+
len
>
254
)
break
;
if
(
*
length
+
len
>
=
32767
)
break
;
if
(
r
!=
result
)
{
if
(
r
!=
result
)
{
*
r
=
' '
;
*
r
=
' '
;
...
@@ -190,4 +190,4 @@ char *stem_word(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *l
...
@@ -190,4 +190,4 @@ char *stem_word(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *l
}
}
return
result
;
return
result
;
}
}
\ No newline at end of file
tests/stem_word.result
View file @
31c59cb4
...
@@ -18,3 +18,6 @@ Xxx Yyys Zzzer
...
@@ -18,3 +18,6 @@ Xxx Yyys Zzzer
SELECT stem_word("english", "a");
SELECT stem_word("english", "a");
stem_word("english", "a")
stem_word("english", "a")
a
a
SELECT stem_word("english", "read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading") as long_stem_result;
long_stem_result
read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read read
tests/stem_word.test
View file @
31c59cb4
...
@@ -21,3 +21,4 @@ SELECT stem_word("dutch", "deuren boekjes;stuiter stuiteren auto's");
...
@@ -21,3 +21,4 @@ SELECT stem_word("dutch", "deuren boekjes;stuiter stuiteren auto's");
SELECT
stem_word
(
"english"
,
"cars#bars#opening"
);
SELECT
stem_word
(
"english"
,
"cars#bars#opening"
);
SELECT
stem_word
(
"xyz"
,
"Xxx Yyys Zzzer"
);
SELECT
stem_word
(
"xyz"
,
"Xxx Yyys Zzzer"
);
SELECT
stem_word
(
"english"
,
"a"
);
SELECT
stem_word
(
"english"
,
"a"
);
SELECT
stem_word
(
"english"
,
"read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading read reads reading"
)
as
long_stem_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