src/translitbg.js
function() {
      var result = new StringBuffer();
      var array = this._input.split('');
      // var prev = null;

      for (var i = 0; i < array.length; i++) {
        var cur = array[i];
        var next = array[i + 1];

        if (typeof next !== 'undefined') {
          var curToken = cur + next;

          if (this._mode.tokens.ia[curToken]) {
            var nextNext = array[i + 2];
            if (typeof nextNext === 'undefined' || /^[-\s]$/.test(nextNext)) {
              result.append(this._mode.tokens.ia[curToken]);
              i++;
              continue;
            }
          }
        }

        if (this._mode.cyr2lat[cur]) {
          result.append(this._mode.cyr2lat[cur]);
        } else {
          result.append(cur);
        }

        // prev = cur;
      }

      return result.toString();
    }
function() {
      var result = new StringBuffer();
      var array = this._input.split('');
      // var prev = null;

      for (var i = 0; i < array.length; i++) {
        var cur = array[i];
        var next = array[i + 1];

        if (typeof next !== 'undefined') {
          var curToken = cur + next;

          if (this._mode.tokens.ia[curToken]) {
            var nextNext = array[i + 2];
            if (typeof nextNext === 'undefined' || /^[-\s]$/.test(nextNext)) {
              result.append(this._mode.tokens.ia[curToken]);
              i++;
              continue;
            }
          }
        }

        if (this._mode.cyr2lat[cur]) {
          result.append(this._mode.cyr2lat[cur]);
        } else {
          result.append(cur);
        }

        // prev = cur;
      }

      return result.toString();
    }
function ( ) { var result = new StringBuffer ( ) ; var array = this . _input . split ( '' ) ; // var prev = null;
 for ( var i = 0 ; i < array . length ; i ++ ) { var cur = array [ i ] ; var next = array [ i + 1 ] ; if ( typeof next !== 'undefined' ) { var curToken = cur + next ; if ( this . _mode . tokens . ia [ curToken ] ) { var nextNext = array [ i + 2 ] ; if ( typeof nextNext === 'undefined' || / ^[-\s]$ / . test ( nextNext ) ) { result . append ( this . _mode . tokens . ia [ curToken ] ) ; i ++ ; continue ; } } } if ( this . _mode . cyr2lat [ cur ] ) { result . append ( this . _mode . cyr2lat [ cur ] ) ; } else { result . append ( cur ) ; } // prev = cur;
 } return result . toString ( ) ; }
Transforms Cyrillic to Latin characters.

@return {string}      Transliterated text
Transforms Cyrillic to Latin characters .