Commit b791b31b authored by Boyuan Yang's avatar Boyuan Yang

New upstream version 2.2.1

parent 31fbf5a5
version 2.2.1
* fixes predicted candidates
version 2.2.0
* bug fixes
......
#! /bin/sh
#!/bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2016-01-11.22; # UTC
......
#! /bin/sh
#!/bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2017 Free Software Foundation, Inc.
......
......@@ -21,9 +21,6 @@
/* Have Kyoto Cabinet. */
#undef HAVE_KYOTO_CABINET
/* Define to 1 if you have the <libintl.h> header file. */
#undef HAVE_LIBINTL_H
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
......
#! /bin/sh
#!/bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2017 Free Software Foundation, Inc.
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for libpinyin 2.2.0.
# Generated by GNU Autoconf 2.69 for libpinyin 2.2.1.
#
# Report bugs to <https://github.com/libpinyin/libpinyin/issues/new>.
#
......@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libpinyin'
PACKAGE_TARNAME='libpinyin'
PACKAGE_VERSION='2.2.0'
PACKAGE_STRING='libpinyin 2.2.0'
PACKAGE_VERSION='2.2.1'
PACKAGE_STRING='libpinyin 2.2.1'
PACKAGE_BUGREPORT='https://github.com/libpinyin/libpinyin/issues/new'
PACKAGE_URL=''
......@@ -1352,7 +1352,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libpinyin 2.2.0 to adapt to many kinds of systems.
\`configure' configures libpinyin 2.2.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1422,7 +1422,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libpinyin 2.2.0:";;
short | recursive ) echo "Configuration of libpinyin 2.2.1:";;
esac
cat <<\_ACEOF
......@@ -1549,7 +1549,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
libpinyin configure 2.2.0
libpinyin configure 2.2.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2093,7 +2093,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libpinyin $as_me 2.2.0, which was
It was created by libpinyin $as_me 2.2.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -2959,7 +2959,7 @@ fi
# Define the identity of the package.
PACKAGE='libpinyin'
VERSION='2.2.0'
VERSION='2.2.1'
cat >>confdefs.h <<_ACEOF
......@@ -18127,15 +18127,16 @@ fi
done
for ac_header in libintl.h string.h
for ac_header in string.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default"
if test "x$ac_cv_header_string_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
#define HAVE_STRING_H 1
_ACEOF
else
as_fn_error $? "Cannot find string.h" "$LINENO" 5
fi
done
......@@ -18969,7 +18970,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by libpinyin $as_me 2.2.0, which was
This file was extended by libpinyin $as_me 2.2.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -19035,7 +19036,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
libpinyin config.status 2.2.0
libpinyin config.status 2.2.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
......@@ -6,7 +6,7 @@
m4_define([libpinyin_released], [1])
m4_define([libpinyin_major_version], [2])
m4_define([libpinyin_minor_version], [2])
m4_define([libpinyin_micro_version], [0])
m4_define([libpinyin_micro_version], [1])
m4_define(libpinyin_maybe_datestamp,
m4_esyscmd([if test x]libpinyin_released[ != x1; then date +.%Y%m%d | tr -d '\n\r'; fi]))
......@@ -80,7 +80,7 @@ AC_FUNC_STAT
AC_FUNC_MMAP
AC_CHECK_FUNCS([gettimeofday memmove memset setlocale])
AC_CHECK_HEADERS([libintl.h string.h])
AC_CHECK_HEADERS([string.h], , AC_MSG_ERROR([Cannot find string.h]))
# Check Berkeley DB or Kyoto Cabinet
DBM="BerkeleyDB"
......
#! /bin/sh
#!/bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2016-01-11.22; # UTC
......
......@@ -7272,10 +7272,12 @@ func_mode_link ()
# -tp=* Portland pgcc target processor selection
# --sysroot=* for sysroot support
# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
# -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
-specs=*)
func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
func_append compile_command " $arg"
......
#! /bin/sh
#!/bin/sh
# Common wrapper for a few potentially missing GNU programs.
scriptversion=2016-01-11.22; # UTC
......
......@@ -1858,26 +1858,39 @@ bool pinyin_guess_candidates(pinyin_instance_t * instance,
bool pinyin_guess_predicted_candidates(pinyin_instance_t * instance,
const char * prefix) {
const guint32 filter = 256;
const guint32 length = 2;
const guint32 filter = 10;
pinyin_context_t * context = instance->m_context;
FacadePhraseIndex * phrase_index = context->m_phrase_index;
CandidateVector candidates = instance->m_candidates;
TokenVector prefixes = instance->m_prefixes;
phrase_token_t prev_token = null_token;
_free_candidates(candidates);
g_array_set_size(instance->m_prefixes, 0);
_compute_prefixes(instance, prefix);
phrase_token_t prev_token = _get_previous_token(instance, 0);
if (null_token == prev_token)
if (0 == prefixes->len)
return false;
/* merge single gram. */
SingleGram merged_gram;
SingleGram * system_gram = NULL, * user_gram = NULL;
context->m_system_bigram->load(prev_token, system_gram);
context->m_user_bigram->load(prev_token, user_gram);
merge_single_gram(&merged_gram, system_gram, user_gram);
for (gint i = prefixes->len - 1; i >= 0; --i) {
prev_token = g_array_index(prefixes, phrase_token_t, i);
context->m_system_bigram->load(prev_token, system_gram);
context->m_user_bigram->load(prev_token, user_gram);
merge_single_gram(&merged_gram, system_gram, user_gram);
if (merged_gram.get_length())
break;
}
if (0 == merged_gram.get_length())
return false;
/* retrieve all items. */
BigramPhraseWithCountArray tokens = g_array_new
......@@ -1886,7 +1899,7 @@ bool pinyin_guess_predicted_candidates(pinyin_instance_t * instance,
/* sort the longer word first. */
PhraseItem cached_item;
for (size_t len = MAX_PHRASE_LENGTH; len > 0; --len) {
for (ssize_t len = length; len > 0; --len) {
/* append items. */
for (size_t k = 0; k < tokens->len; ++k){
BigramPhraseItemWithCount * phrase_item = &g_array_index
......
#! /bin/sh
#!/bin/sh
# test-driver - basic testsuite driver script.
scriptversion=2016-01-11.22; # UTC
......
......@@ -19,6 +19,10 @@
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "zhuyin.h"
#include <stdio.h>
#include <stdlib.h>
......
......@@ -19,6 +19,10 @@
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <glib.h>
#include "pinyin_internal.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment