Segmenter.Base.Sequences.ComplexChain.Substring C# (CSharp) Method

Substring() public method

The substring.
public Substring ( int beginIndex, int endIndex ) : List
beginIndex int /// The begin index. ///
endIndex int /// The end index. ///
return List
        public List<string> Substring(int beginIndex, int endIndex)
        {
            List<string> sequence = null;
            try
            {
                sequence = new List<string>(ToList().GetRange(beginIndex, endIndex - beginIndex));
            }
            catch (Exception)
            {
            }

            return sequence;
        }

Usage Example

コード例 #1
0
 /// <summary>
 /// The frequency.
 /// </summary>
 /// <param name="chain">
 /// The chain.
 /// </param>
 /// <param name="word">
 /// The word.
 /// </param>
 /// <returns>
 /// The <see cref="double"/>.
 /// </returns>
 public double Frequency(ComplexChain chain, string word)
 {
     var temp = new List<object>(chain.Substring(0, chain.GetLength()));
     return Frequency(temp, word) / (double)chain.GetLength();
 }