## com.aliasi.lm Interface IntSeqCounter

All Known Implementing Classes:
TrieIntSeqCounter

`public interface IntSeqCounter`

An `IntSeqCounter` provides counts for sequences of integers. This interface parallels `CharSeqCounter`.

The method `count(int[],int,int)` returns the basic count for the specified integer sequence. The method `extensionCount(int[],int,int)` is the sum of the counts for all single integer extensions of the specified integer sequence. As described in the class documentation for `CharSeqCounter`, these two methods are enough to compute a maximum likelihood estimator of conditional integer likelihoods.

The method `numExtensions(int[],int,int)` returns the number of single integer extensions of the specified integer slice. This is useful for computing interpolated estimates with Witten-Bell smoothing.

Since:
LingPipe2.0
Version:
2.0
Author:
Bob Carpenter

Method Summary
` int` ```count(int[] is, int start, int end)```
Returns the count of the specified sequence of integers.
` long` ```extensionCount(int[] is, int start, int end)```
Returns the sum of the count of all sequences that extend the specified sequence by one integer.
` int[]` ```integersFollowing(int[] is, int start, int end)```
Returns an array of the integers that follow the specified integer array slice.
` int` ```numExtensions(int[] is, int start, int end)```
Returns the number of one integer extensions of the specified with non-zero counts.
` int[]` `observedIntegers()`
Returns an array of all integers that have non-zero counts in the model.

Method Detail

### count

```int count(int[] is,
int start,
int end)```
Returns the count of the specified sequence of integers.

Parameters:
`is` - Underlying array of integers.
`start` - Index of first integer in the slice.
`end` - Index of one past the last integer in the slice.
Throws:
`IndexOutOfBoundsException` - If the start and end minus one indices do not fall within the range of the integer array.

### extensionCount

```long extensionCount(int[] is,
int start,
int end)```
Returns the sum of the count of all sequences that extend the specified sequence by one integer.

Parameters:
`is` - Underlying array of integers.
`start` - Index of first integer in the slice.
`end` - Index of one past the last integer in the slice.
Throws:
`IndexOutOfBoundsException` - If the start and end minus one indices do not fall within the range of the integer array.

### numExtensions

```int numExtensions(int[] is,
int start,
int end)```
Returns the number of one integer extensions of the specified with non-zero counts.

Parameters:
`is` - Underlying array of integers.
`start` - Index of first integer in the slice.
`end` - Index of one past the last integer in the slice.
Throws:
`IndexOutOfBoundsException` - If the start and end minus one indices do not fall within the range of the integer array.

### integersFollowing

```int[] integersFollowing(int[] is,
int start,
int end)```
Returns an array of the integers that follow the specified integer array slice.

Parameters:
`is` - Underlying array of integers.
`start` - Index of first integer in the slice.
`end` - Index of one past the last integer in the slice.
Throws:
`IndexOutOfBoundsException` - If the start and end minus one indices do not fall within the range of the integer array.

### observedIntegers

`int[] observedIntegers()`
Returns an array of all integers that have non-zero counts in the model.

Returns:
Integers with non-zero counts in the model.