---
name: "gen_unigram"
section: "1"
platform: "linux"
package: "libpinyin-utils"
version: "1.0.0+repack2-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/libpinyin"
---

# gen\_unigram(1)

Library to deal with pinyin

Part of [libpinyin(1)](/libpinyin/1.md).

## NAME

libpinyin - Library to deal with pinyin

## DESCRIPTION

The libpinyin project aims to provide the algorithms core for intelligent sentence-based Chinese pinyin input methods.

## TOOLS

gen\_binary\_files - generate initially binary pinyin libraries import\_interpolation - import libpinyin textual format model data gen\_unigram - increase the unigram frequency for all phrases

## USAGE

gen\_binary\_files --table-dir \<DIRNAME\>

**--table-dir** Read textual format files from the \<DIRNAME\> directory.

import\_interpolation \< \<MODELFILE\>

gen\_unigram

## EXAMPLE

Download the model.text.tar.gz, and extracts all files into a folder, then run the commands below to generate the binary model data.

rm gb\_char.bin gbk\_char.bin phrase\_index.bin pinyin\_index.bin bigram.db

gen\_binary\_files --table-dir ../data

import\_interpolation \< ../data/interpolation.text

gen\_unigram
