Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
ma-impl
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eccochu
ma-impl
Commits
45e96264
Commit
45e96264
authored
8 years ago
by
Eike Cochu
Browse files
Options
Downloads
Patches
Plain Diff
fixed npe while importing
parent
268f7513
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vipra-cmd/src/main/java/de/vipra/cmd/file/FilebaseWordIndex.java
+2
-2
2 additions, 2 deletions
...md/src/main/java/de/vipra/cmd/file/FilebaseWordIndex.java
vipra-cmd/src/main/java/de/vipra/cmd/text/ProcessedText.java
+2
-2
2 additions, 2 deletions
vipra-cmd/src/main/java/de/vipra/cmd/text/ProcessedText.java
with
4 additions
and
4 deletions
vipra-cmd/src/main/java/de/vipra/cmd/file/FilebaseWordIndex.java
+
2
−
2
View file @
45e96264
...
@@ -53,8 +53,8 @@ public class FilebaseWordIndex implements Iterable<String> {
...
@@ -53,8 +53,8 @@ public class FilebaseWordIndex implements Iterable<String> {
public
String
transform
(
final
String
[]
words
,
final
boolean
dbInsert
)
{
public
String
transform
(
final
String
[]
words
,
final
boolean
dbInsert
)
{
final
CountMap
<
String
>
countMap
=
new
CountMap
<>();
final
CountMap
<
String
>
countMap
=
new
CountMap
<>();
for
(
final
String
word
:
words
)
{
for
(
final
String
word
:
words
)
{
if
(!
word
.
trim
().
isEmpty
())
{
if
(
word
!=
null
&&
!
word
.
trim
().
isEmpty
())
{
countMap
.
count
(
word
);
countMap
.
count
(
word
.
trim
()
);
if
(
dbInsert
)
if
(
dbInsert
)
newWords
.
add
(
word
);
newWords
.
add
(
word
);
}
}
...
...
This diff is collapsed.
Click to expand it.
vipra-cmd/src/main/java/de/vipra/cmd/text/ProcessedText.java
+
2
−
2
View file @
45e96264
...
@@ -21,8 +21,8 @@ public class ProcessedText {
...
@@ -21,8 +21,8 @@ public class ProcessedText {
final
String
[]
allWords
=
text
.
toLowerCase
().
trim
().
split
(
"\\s+"
);
final
String
[]
allWords
=
text
.
toLowerCase
().
trim
().
split
(
"\\s+"
);
final
List
<
String
>
wordList
=
new
ArrayList
<>(
allWords
.
length
);
final
List
<
String
>
wordList
=
new
ArrayList
<>(
allWords
.
length
);
for
(
final
String
word
:
allWords
)
for
(
final
String
word
:
allWords
)
if
(!
word
.
trim
().
isEmpty
())
if
(
word
!=
null
&&
!
word
.
trim
().
isEmpty
())
wordList
.
add
(
word
);
wordList
.
add
(
word
.
trim
()
);
words
=
wordList
.
toArray
(
new
String
[
allWords
.
length
]);
words
=
wordList
.
toArray
(
new
String
[
allWords
.
length
]);
originalWordCount
=
wordCount
;
originalWordCount
=
wordCount
;
reducedWordCount
=
words
.
length
;
reducedWordCount
=
words
.
length
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment