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
1b66506e
Commit
1b66506e
authored
Sep 24, 2015
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix one character input case.
parent
617e93cb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
lib_mysqludf_stem.cc
lib_mysqludf_stem.cc
+1
-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 @
1b66506e
...
@@ -140,7 +140,7 @@ char *stem_word(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *l
...
@@ -140,7 +140,7 @@ char *stem_word(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *l
int
len
;
int
len
;
char
*
r
,
*
e
,
*
b
,
*
c
;
char
*
r
,
*
e
,
*
b
,
*
c
;
if
(
!
args
->
args
[
1
]
||
args
->
lengths
[
1
]
==
1
)
{
if
(
!
args
->
args
[
1
])
{
*
is_null
=
1
;
*
is_null
=
1
;
return
0
;
return
0
;
}
}
...
@@ -167,7 +167,6 @@ char *stem_word(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *l
...
@@ -167,7 +167,6 @@ char *stem_word(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *l
e
=
c
+
args
->
lengths
[
1
];
e
=
c
+
args
->
lengths
[
1
];
int
i
=
0
;
int
i
=
0
;
for
(;
c
<=
e
;
c
++
){
for
(;
c
<=
e
;
c
++
){
if
(
c
==
e
||
(
*
c
>=
0
&&
*
c
<=
38
)
||
(
*
c
>=
40
&&
*
c
<=
47
)
||
(
*
c
>=
58
&&
*
c
<=
64
)
||
(
*
c
>=
91
&&
*
c
<=
96
)
||
(
*
c
>=
123
&&
*
c
<=
126
))
{
if
(
c
==
e
||
(
*
c
>=
0
&&
*
c
<=
38
)
||
(
*
c
>=
40
&&
*
c
<=
47
)
||
(
*
c
>=
58
&&
*
c
<=
64
)
||
(
*
c
>=
91
&&
*
c
<=
96
)
||
(
*
c
>=
123
&&
*
c
<=
126
))
{
if
(
b
!=
c
)
{
if
(
b
!=
c
)
{
...
...
tests/stem_word.result
View file @
1b66506e
...
@@ -15,3 +15,6 @@ car bar open
...
@@ -15,3 +15,6 @@ car bar open
SELECT stem_word("xyz", "Xxx Yyys Zzzer");
SELECT stem_word("xyz", "Xxx Yyys Zzzer");
stem_word("xyz", "Xxx Yyys Zzzer")
stem_word("xyz", "Xxx Yyys Zzzer")
Xxx Yyys Zzzer
Xxx Yyys Zzzer
SELECT stem_word("english", "a");
stem_word("english", "a")
a
tests/stem_word.test
View file @
1b66506e
...
@@ -20,3 +20,4 @@ SELECT stem_word("dutch", "deuren");
...
@@ -20,3 +20,4 @@ SELECT stem_word("dutch", "deuren");
SELECT
stem_word
(
"dutch"
,
"deuren boekjes;stuiter stuiteren auto's"
);
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"
);
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