Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
keyboard
LatinIME
Commits
ef1d4ddc
Commit
ef1d4ddc
authored
11 years ago
by
Keisuke Kuroyanagi
Browse files
Options
Downloads
Patches
Plain Diff
Remove useless methods from DicNode.
Change-Id: I6ea5eb7e848dbce0f0d468160c16e5da76b23b20
parent
67ff21f3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
native/jni/src/suggest/core/dicnode/dic_node.h
+8
-35
8 additions, 35 deletions
native/jni/src/suggest/core/dicnode/dic_node.h
with
8 additions
and
35 deletions
native/jni/src/suggest/core/dicnode/dic_node.h
+
8
−
35
View file @
ef1d4ddc
...
@@ -44,7 +44,8 @@
...
@@ -44,7 +44,8 @@
+ mDicNodeState.mDicNodeStateOutput.getPrevWordsLength(), \
+ mDicNodeState.mDicNodeStateOutput.getPrevWordsLength(), \
charBuf, NELEMS(charBuf)); \
charBuf, NELEMS(charBuf)); \
AKLOGI("#%8s, %5f, %5f, %5f, %5f, %s, %d, %5f,", header, \
AKLOGI("#%8s, %5f, %5f, %5f, %5f, %s, %d, %5f,", header, \
getSpatialDistanceForScoring(), getLanguageDistanceForScoring(), \
getSpatialDistanceForScoring(), \
mDicNodeState.mDicNodeStateScoring.getLanguageDistance(), \
getNormalizedCompoundDistance(), getRawLength(), charBuf, \
getNormalizedCompoundDistance(), getRawLength(), charBuf, \
getInputIndex(0), getNormalizedCompoundDistanceAfterFirstWord()); \
getInputIndex(0), getNormalizedCompoundDistanceAfterFirstWord()); \
} while (0)
} while (0)
...
@@ -121,8 +122,10 @@ class DicNode {
...
@@ -121,8 +122,10 @@ class DicNode {
void
initAsPassingChild
(
DicNode
*
parentDicNode
)
{
void
initAsPassingChild
(
DicNode
*
parentDicNode
)
{
mIsCachedForNextSuggestion
=
parentDicNode
->
mIsCachedForNextSuggestion
;
mIsCachedForNextSuggestion
=
parentDicNode
->
mIsCachedForNextSuggestion
;
const
int
parentCodePoint
=
parentDicNode
->
getNodeTypedCodePoint
();
const
int
codePoint
=
mDicNodeProperties
.
init
(
&
parentDicNode
->
mDicNodeProperties
,
parentCodePoint
);
parentDicNode
->
mDicNodeState
.
mDicNodeStateOutput
.
getCurrentWordCodePointAt
(
parentDicNode
->
getNodeCodePointCount
());
mDicNodeProperties
.
init
(
&
parentDicNode
->
mDicNodeProperties
,
codePoint
);
mDicNodeState
.
initByCopy
(
&
parentDicNode
->
mDicNodeState
);
mDicNodeState
.
initByCopy
(
&
parentDicNode
->
mDicNodeState
);
PROF_NODE_COPY
(
&
parentDicNode
->
mProfiler
,
mProfiler
);
PROF_NODE_COPY
(
&
parentDicNode
->
mProfiler
,
mProfiler
);
}
}
...
@@ -168,11 +171,6 @@ class DicNode {
...
@@ -168,11 +171,6 @@ class DicNode {
mIsCachedForNextSuggestion
=
true
;
mIsCachedForNextSuggestion
=
true
;
}
}
// Used to expand the node in DicNodeUtils
int
getNodeTypedCodePoint
()
const
{
return
mDicNodeState
.
mDicNodeStateOutput
.
getCurrentWordCodePointAt
(
getNodeCodePointCount
());
}
// Check if the current word and the previous word can be considered as a valid multiple word
// Check if the current word and the previous word can be considered as a valid multiple word
// suggestion.
// suggestion.
bool
isValidMultipleWordSuggestion
()
const
{
bool
isValidMultipleWordSuggestion
()
const
{
...
@@ -243,17 +241,13 @@ class DicNode {
...
@@ -243,17 +241,13 @@ class DicNode {
}
}
bool
isTotalInputSizeExceedingLimit
()
const
{
bool
isTotalInputSizeExceedingLimit
()
const
{
const
int
prevWordsLen
=
mDicNodeState
.
mDicNodeStateOutput
.
getPrevWordsLength
();
const
int
currentWordDepth
=
getNodeCodePointCount
();
// TODO: 3 can be 2? Needs to be investigated.
// TODO: 3 can be 2? Needs to be investigated.
// TODO: Have a const variable for 3 (or 2)
// TODO: Have a const variable for 3 (or 2)
return
prevWordsLen
+
currentWordDepth
>
MAX_WORD_LENGTH
-
3
;
return
getTotalNodeCodePointCount
()
>
MAX_WORD_LENGTH
-
3
;
}
}
void
outputResult
(
int
*
dest
)
const
{
void
outputResult
(
int
*
dest
)
const
{
const
uint16_t
prevWordLength
=
mDicNodeState
.
mDicNodeStateOutput
.
getPrevWordsLength
();
memmove
(
dest
,
getOutputWordBuf
(),
getTotalNodeCodePointCount
()
*
sizeof
(
dest
[
0
]));
const
uint16_t
currentDepth
=
getNodeCodePointCount
();
memmove
(
dest
,
getOutputWordBuf
(),
(
prevWordLength
+
currentDepth
)
*
sizeof
(
dest
[
0
]));
DUMP_WORD_AND_SCORE
(
"OUTPUT"
);
DUMP_WORD_AND_SCORE
(
"OUTPUT"
);
}
}
...
@@ -311,11 +305,6 @@ class DicNode {
...
@@ -311,11 +305,6 @@ class DicNode {
return
mDicNodeState
.
mDicNodeStateScoring
.
getCompoundDistance
(
languageWeight
);
return
mDicNodeState
.
mDicNodeStateScoring
.
getCompoundDistance
(
languageWeight
);
}
}
// Used to commit input partially
int
getPrevWordPtNodePos
()
const
{
return
mDicNodeProperties
.
getPrevWordTerminalPtNodePos
();
}
AK_FORCE_INLINE
const
int
*
getOutputWordBuf
()
const
{
AK_FORCE_INLINE
const
int
*
getOutputWordBuf
()
const
{
return
mDicNodeState
.
mDicNodeStateOutput
.
getCodePointBuf
();
return
mDicNodeState
.
mDicNodeStateOutput
.
getCodePointBuf
();
}
}
...
@@ -378,10 +367,6 @@ class DicNode {
...
@@ -378,10 +367,6 @@ class DicNode {
return
mDicNodeState
.
mDicNodeStateScoring
.
getSpatialDistance
();
return
mDicNodeState
.
mDicNodeStateScoring
.
getSpatialDistance
();
}
}
float
getLanguageDistanceForScoring
()
const
{
return
mDicNodeState
.
mDicNodeStateScoring
.
getLanguageDistance
();
}
// For space-aware gestures, we store the normalized distance at the char index
// For space-aware gestures, we store the normalized distance at the char index
// that ends the first word of the suggestion. We call this the distance after
// that ends the first word of the suggestion. We call this the distance after
// first word.
// first word.
...
@@ -389,22 +374,10 @@ class DicNode {
...
@@ -389,22 +374,10 @@ class DicNode {
return
mDicNodeState
.
mDicNodeStateScoring
.
getNormalizedCompoundDistanceAfterFirstWord
();
return
mDicNodeState
.
mDicNodeStateScoring
.
getNormalizedCompoundDistanceAfterFirstWord
();
}
}
float
getLanguageDistanceRatePerWordForScoring
()
const
{
const
float
langDist
=
getLanguageDistanceForScoring
();
const
float
totalWordCount
=
static_cast
<
float
>
(
mDicNodeState
.
mDicNodeStateOutput
.
getPrevWordCount
()
+
1
);
return
langDist
/
totalWordCount
;
}
float
getRawLength
()
const
{
float
getRawLength
()
const
{
return
mDicNodeState
.
mDicNodeStateScoring
.
getRawLength
();
return
mDicNodeState
.
mDicNodeStateScoring
.
getRawLength
();
}
}
bool
isLessThanOneErrorForScoring
()
const
{
return
mDicNodeState
.
mDicNodeStateScoring
.
getEditCorrectionCount
()
+
mDicNodeState
.
mDicNodeStateScoring
.
getProximityCorrectionCount
()
<=
1
;
}
DoubleLetterLevel
getDoubleLetterLevel
()
const
{
DoubleLetterLevel
getDoubleLetterLevel
()
const
{
return
mDicNodeState
.
mDicNodeStateScoring
.
getDoubleLetterLevel
();
return
mDicNodeState
.
mDicNodeStateScoring
.
getDoubleLetterLevel
();
}
}
...
...
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