---
name: "ngramcount"
section: "1"
platform: "linux"
package: "libngram-tools"
version: "1.3.2-3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/ngramcount"
---

# ngramcount(1)

Count ngram from input file.

## NAME

ngramcount - Count ngram from input file.

## DESCRIPTION

Count ngram from input file.

-

  ## SYNOPSIS

ngramcount \[--options\] \[in.far \[out.fst\]\]

## OPTIONS

**--alpha**: type = double, default = 1

-

  Weight for first FST

**--backoff\_label**: type = int64, default = 0

-

  Backoff label

**--beta**: type = double, default = 1

-

  Weight for second (and subsequent) FST(s)

**--check\_consistency**: type = bool, default = false

-

  Check model consistency

**--context\_pattern**: type = string, default = ""

-

  Pattern of contexts to count

**--epsilon\_as\_backoff**: type = bool, default = false

-

  Treat epsilon in the input Fsts as backoff

**--method**: type = string, default = "counts"

-

  One of: "counts", "histograms", "count\_of\_counts", "count\_of\_histograms"

**--norm\_eps**: type = double, default = 0.001

-

  Normalization check epsilon

**--normalize**: type = bool, default = false

-

  Normalize resulting model

**--order**: type = int64, default = 3

-

  Set maximal order of ngrams to be counted

**--output\_fst**: type = bool, default = true

-

  Output counts as fst (otherwise strings)

**--require\_symbols**: type = bool, default = true

-

  Require symbol tables? (default: yes)

**--round\_to\_int**: type = bool, default = false

-

  Round all counts to integers

**--help**: type = bool, default = false

-

  show usage information

**--helpshort**: type = bool, default = false

-

  show brief usage information

**--tmpdir**: type = string, default = "/tmp"

-

  temporary directory

**--v**: type = int32, default = 0

-

  verbosity level

**--fst\_align**: type = bool, default = false

-

  Write FST data aligned where appropriate

**--fst\_default\_cache\_gc**: type = bool, default = true

-

  Enable garbage collection of cache

**--fst\_default\_cache\_gc\_limit**: type = int64, default = 1048576

-

  Cache byte size that triggers garbage collection

**--fst\_read\_mode**: type = string, default = "read"

-

  Default file reading mode for mappable files

**--fst\_verify\_properties**: type = bool, default = false

-

  Verify FST properties queried by TestProperties

**--save\_relabel\_ipairs**: type = string, default = ""

-

  Save input relabel pairs to file

**--save\_relabel\_opairs**: type = string, default = ""

-

  Save output relabel pairs to file

**--end\_symbol**: type = string, default = "\</s\>"

-

  Class label for sentence start

**--start\_symbol**: type = string, default = "\<s\>"

-

  Class label for sentence start

**--fst\_compat\_symbols**: type = bool, default = true

-

  Require symbol tables to match when appropriate

**--fst\_field\_separator**: type = string, default = "      "

-

  Set of characters used as a separator between printed fields

**--fst\_error\_fatal**: type = bool, default = true

-

  FST errors are fatal; o.w. return objects flagged as bad: e.g., FSTs: kError property set, FST weights: not a Member()

**--ngram\_error\_fatal**: type = bool, default = true

-

  NGram errors are fatal; o.w. return objects flagged as bad:  e.g., NGramModel::Error() returns true.

**--fst\_weight\_parentheses**: type = string, default = ""

-

  Characters enclosing the first weight of a printed composite weight (e.g., pair weight, tuple weight and derived classes) to ensure proper I/O of nested composite weights; must have size 0 (none) or 2 (open and close parenthesis)

**--fst\_weight\_separator**: type = string, default = ","

-

  Character separator between printed composite weights; must be a single character
