[Libreoffice-commits] libexttextcat.git: 4 commits - ChangeLog configure.ac libexttextcat.vapi src/exttextcat-version.h src/textcat.c src/textcat.h src/win32_config.h

Caolán McNamara caolanm at redhat.com
Wed May 29 03:01:35 PDT 2013


 ChangeLog                |    8 +++++++-
 configure.ac             |    2 +-
 libexttextcat.vapi       |   13 ++++++++-----
 src/exttextcat-version.h |    4 ++--
 src/textcat.c            |   16 +++++++++++++---
 src/textcat.h            |    2 +-
 src/win32_config.h       |    4 ++--
 7 files changed, 34 insertions(+), 15 deletions(-)

New commits:
commit 4f52043f6ee67f899c5d83f0aa55a0d98d50697a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed May 29 11:00:49 2013 +0100

    bump release

diff --git a/ChangeLog b/ChangeLog
index f0411eb..14728a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
+Wed May 29 2013 Caolán McNamara (caolanm at redhat.com)
+	* merge in Giulio's work and bump release
+	  + Updated libexttextcat.vapi.
+	  + Enable changing mindocsize at runtime.
+	  + Fixed spelling of TEXTCAT_RESULT_UNKOWN.
+
 Mon Nov 05 2012 Caolán McNamara (caolanm at redhat.com)
-       * fix up the Polish LM
+	* fix up the Polish LM
 
 Wed May 30 2012 Caolán McNamara (caolanm at redhat.com)
 	* add a pile of new fingerprints
diff --git a/configure.ac b/configure.ac
index 7e64e91..1625f6b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 m4_define([exttextcat_version_major],[3])
 m4_define([exttextcat_version_minor],[4])
-m4_define([exttextcat_version_micro],[0])
+m4_define([exttextcat_version_micro],[1])
 m4_define([exttextcat_version],[exttextcat_version_major.exttextcat_version_minor.exttextcat_version_micro])
 
 AC_PREREQ([2.68])
diff --git a/src/exttextcat-version.h b/src/exttextcat-version.h
index 5bc8b01..25ca683 100644
--- a/src/exttextcat-version.h
+++ b/src/exttextcat-version.h
@@ -1,9 +1,9 @@
 #ifndef EXTTEXTCAT_VERSION_H
 #define EXTTEXTCAT_VERSION_H
 
-#define EXTTEXTCAT_VERSION "3.4.0"
+#define EXTTEXTCAT_VERSION "3.4.1"
 #define EXTTEXTCAT_VERSION_MAJOR 3
 #define EXTTEXTCAT_VERSION_MINOR 4
-#define EXTTEXTCAT_VERSION_MICRO 0
+#define EXTTEXTCAT_VERSION_MICRO 1
 
 #endif
diff --git a/src/win32_config.h b/src/win32_config.h
index 65404fc..3129773 100644
--- a/src/win32_config.h
+++ b/src/win32_config.h
@@ -63,7 +63,7 @@
 #define PACKAGE_TARNAME "libexttextcat"
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "3.0"
+#define PACKAGE_VERSION "3.4"
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
@@ -72,6 +72,6 @@
 #define TIME_WITH_SYS_TIME 1
 
 /* Version number of package */
-#define VERSION "3.0.1"
+#define VERSION "3.4.1"
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 983edc373cc885b1901570b6b731439175e538a1
Author: Giulio Paci <giuliopaci at gmail.com>
Date:   Wed May 29 04:55:07 2013 +0200

    Updated libexttextcat.vapi.
    (cherry picked from commit d7ac2c6d5b0b0cee16bf5cab04e88b1819a589ac)

diff --git a/libexttextcat.vapi b/libexttextcat.vapi
index 048f5d7..e699754 100644
--- a/libexttextcat.vapi
+++ b/libexttextcat.vapi
@@ -17,20 +17,23 @@ namespace TextCat {
 		public unowned candidate* get_classify_full_output ();
 		[CCode (cname = "textcat_ReleaseClassifyFullOutput", cheader_filename = "textcat.h")]
 		public void release_classify_full_output (candidate* candidates);
-		[CCode (cname = "textcat_Init", cheader_filename = "textcat.h")]
-		public Classifier (string conffile);
+		[CCode (cname = "special_textcat_Init", cheader_filename = "textcat.h")]
+		public Classifier (string conffile, string prefix = TEXTCAT_DEFAULT_FINGERPRINTS_PATH);
 		[CCode (cname = "textcat_SetProperty", cheader_filename = "textcat.h")]
-		public int set_property (Property property, int4 value);
+		public int set_property (Property property, int32 value);
 		
 	}
 	[CCode (cname="textcat_Property",cheader_filename = "textcat.h",cprefix = "TCPROP_")]
 	public enum Property {
-		UTF8AWARE;
+		UTF8AWARE,
+		MINIMUM_DOCUMENT_SIZE;
 	}
+        [CCode (cheader_filename = "constants.h", cname = "DEFAULT_FINGERPRINTS_PATH")]
+        public const string TEXTCAT_DEFAULT_FINGERPRINTS_PATH;
 	[CCode (cheader_filename = "textcat.h")]
 	public const int TEXTCAT_RESULT_SHORT;
 	[CCode (cheader_filename = "textcat.h")]
-	public const int TEXTCAT_RESULT_UNKOWN;
+	public const int TEXTCAT_RESULT_UNKNOWN;
 	[CCode (cname = "textcat_Version", cheader_filename = "textcat.h")]
 	public static unowned string version ();
 }
commit 6f083ae232014be43064b026f43af3040e6cca63
Author: Giulio Paci <giuliopaci at gmail.com>
Date:   Wed May 29 04:39:16 2013 +0200

    Enable changing mindocsize at runtime.
    (cherry picked from commit 34e34485d1528dc4aa3ceb5c7c2111096ea3a6d0)

diff --git a/src/textcat.c b/src/textcat.c
index 50d0e05..062f566 100644
--- a/src/textcat.c
+++ b/src/textcat.c
@@ -71,6 +71,7 @@ typedef struct
     unsigned char *fprint_disable;
     uint4 size;
     uint4 maxsize;
+    uint4 mindocsize;
 
     char output[MAXOUTPUTSIZE];
     candidate_t *tmp_candidates;
@@ -119,6 +120,14 @@ extern int textcat_SetProperty(void *handle, textcat_Property property,
         }
         return -2;
         break;
+    case TCPROP_MINIMUM_DOCUMENT_SIZE:
+        if (value > 0)
+        {
+            h->mindocsize = value;
+            return 0;
+        }
+        return -2;
+        break;
     default:
         break;
     }
@@ -156,6 +165,7 @@ extern void *special_textcat_Init(const char *conffile, const char *prefix)
     h = (textcat_t *) malloc(sizeof(textcat_t));
     h->size = 0;
     h->maxsize = 16;
+    h->mindocsize = MINDOCSIZE;
     h->fprint = (void **)malloc(sizeof(void *) * h->maxsize);
     h->fprint_disable =
         (unsigned char *)malloc(sizeof(unsigned char) * h->maxsize);
@@ -310,7 +320,7 @@ extern int textcat_ClassifyFull(void *handle, const char *buffer, size_t size,
 
     unknown = fp_Init(NULL);
     fp_SetProperty(unknown, TCPROP_UTF8AWARE, h->utfaware);
-    fp_SetProperty(unknown, TCPROP_MINIMUM_DOCUMENT_SIZE, MINDOCSIZE);
+    fp_SetProperty(unknown, TCPROP_MINIMUM_DOCUMENT_SIZE, h->mindocsize);
     if (fp_Create(unknown, buffer, size, MAXNGRAMS) == 0)
     {
         /*** Too little information ***/
commit 18817a96822ad31f531b1f656a1ee350f00cd6b1
Author: Giulio Paci <giuliopaci at gmail.com>
Date:   Wed May 29 04:22:19 2013 +0200

    Fixed spelling of TEXTCAT_RESULT_UNKOWN.
    (cherry picked from commit efec6f63d2bff1470829bf5a651d687398a37e30)

diff --git a/src/textcat.c b/src/textcat.c
index 7d4a57f..50d0e05 100644
--- a/src/textcat.c
+++ b/src/textcat.c
@@ -273,7 +273,7 @@ extern char *textcat_Classify(void *handle, const char *buffer, size_t size)
 
     switch (cnt)
     {
-    case TEXTCAT_RESULT_UNKOWN:
+    case TEXTCAT_RESULT_UNKNOWN:
         result = TEXTCAT_RESULT_UNKNOWN_STR;
         break;
     case TEXTCAT_RESULT_SHORT:
@@ -359,7 +359,7 @@ extern int textcat_ClassifyFull(void *handle, const char *buffer, size_t size,
     /*** The verdict ***/
     if (cnt == MAXCANDIDATES + 1)
     {
-        return TEXTCAT_RESULT_UNKOWN;
+        return TEXTCAT_RESULT_UNKNOWN;
     }
     else
     {
diff --git a/src/textcat.h b/src/textcat.h
index 8769204..d9dcd4c 100644
--- a/src/textcat.h
+++ b/src/textcat.h
@@ -42,7 +42,7 @@
 
 #define TEXTCAT_RESULT_UNKNOWN_STR   "UNKNOWN"
 #define TEXTCAT_RESULT_SHORT_STR     "SHORT"
-#define TEXTCAT_RESULT_UNKOWN        0
+#define TEXTCAT_RESULT_UNKNOWN        0
 #define TEXTCAT_RESULT_SHORT         -2
 
 #ifdef __cplusplus


More information about the Libreoffice-commits mailing list