import { IndexedItems } from './indexed-items' ; export class LabelEncoder { constructor ( readonly items ) { } encode ( sequence ) { return sequence . map ( item => this . items . getIndex ( item ) ) ; } decode ( sequence ) { return sequence . map ( idx => this . items . getItem ( idx ) ) ; } }