From 647ddf171d7113366b6b356a01aedd64d6c584e0 Mon Sep 17 00:00:00 2001 From: Al Date: Sat, 11 Mar 2017 01:18:35 -0500 Subject: [PATCH] [fix] formatting for print features in CRF model --- src/crf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/crf.c b/src/crf.c index 6e63d9d2..ecba33e1 100644 --- a/src/crf.c +++ b/src/crf.c @@ -46,8 +46,11 @@ bool crf_tagger_score(crf_t *self, void *tagger, void *tagger_context, cstring_a if (fidx < num_features - 1) printf(", "); }) size_t num_prev_tag_features = cstring_array_num_strings(prev_tag_features); + if (num_prev_tag_features > 0) { + printf(", "); + } cstring_array_foreach(prev_tag_features, fidx, feature, { - printf("%s", feature); + printf("prev tag+%s", feature); if (fidx < num_prev_tag_features - 1) printf(", "); }) printf(" }\n");