Skip to content

Commit c14e930

Browse files
committed
add a more sophisticated TP in word_seg
1 parent 4d3a7f0 commit c14e930

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

include/word_seg.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ namespace alg
8787
* ... -> S B M E
8888
*/
8989
static const float _TP[4][4] = {
90-
{0.5f, 0.5f, 0.0f, 0.0f}, // S
91-
{0.0f, 0.0f, 0.5f, 0.5f}, // B
92-
{0.0f, 0.0f, 0.5f, 0.5f}, // M
93-
{0.5f, 0.5f, 0.0f, 0.0f} // E
90+
{0.5138298266610544, 0.48617017333894563, 0.000001, 0.000001},
91+
{0.000001, 0.000001, 0.14817814348183422, 0.8518218565181658},
92+
{0.000001, 0.000001, 0.2835512540013088, 0.7164487459986911},
93+
{0.44551469488355755, 0.554485305116442, 0.000001, 0.000001}
9494
};
9595

9696
return _TP;

src/kmp_demo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ int main(void)
1212
char * W = (char*)malloc(6);
1313

1414
memset(S,0, 10000);
15-
memset(W,0, 10);
15+
memset(W,0, 6);
1616

1717
// random genrate a pattern for A, G, C,T
1818
const char P[] = {'A', 'G','C','T'};

0 commit comments

Comments
 (0)