/// <summary>
        /// Scores the given set of states.
        /// </summary>
        /// <param name="scoreableList">A list containing scoreable objects to be scored</param>
        /// <returns>The best scoring scoreable, or <code>null</code> if there are no more features to score</returns>
        public IData calculateScores(List <IScoreable> scoreableList)
        {
            try
            {
                IData data;
                while ((data = getNextData()) is Signal)
                {
                    if (data is SpeechEndSignal || data is DataEndSignal)
                    {
                        return(data);
                    }
                }

                if (data == null || scoreableList.Count == 0)
                {
                    return(null);
                }

                // convert the data to FloatData if not yet done
                if (data is DoubleData)
                {
                    data = DataUtil.DoubleData2FloatData((DoubleData)data);
                }

                IScoreable bestToken = doScoring(scoreableList, data);

                // apply optional score normalization
                if (scoreNormalizer != null && bestToken is Token)
                {
                    bestToken = scoreNormalizer.normalize(scoreableList, bestToken);
                }

                return(bestToken);
            }
            catch (Exception e)
            {
                //e.printStackTrace();
                Trace.WriteLine(e.Message);
                return(null);
            }
        }