Exemplo n.º 1
0
        /// <summary>
        /// Creates a suffix tree for the given text.
        /// Make sure the last character in 'text' is unique; im using $..
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="text">The text.</param>
        /// <returns>if the argument 'text' is empty or null string, function returns null !!</returns>
        public static ISuffixTree Create <T>(string text)
            where T : IDictionary <char, ISuffixNode>, new()
        {
            var suffixImpl = SuffixTreeImpl <T> .Create(text);

            return(suffixImpl == null ? null : new SuffixTree()
            {
                Root = suffixImpl.Root, Text = suffixImpl.Text
            });
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a suffix tree for the given text.
 /// Make sure the last character in 'text' is unique; im using $..
 /// </summary>
 /// <param name="text">The text.</param>
 /// <returns>if the argument 'text' is empty or null string, function returns null !!</returns>
 public static ISuffixTree Create(string text)
 {
     return(SuffixTreeImpl <Dictionary> .Create(text));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creates a suffix tree for the given text.
 /// Make sure the last character in 'text' is unique; im using $..
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="text">The text.</param>
 /// <returns>if the argument 'text' is empty or null string, function returns null !!</returns>
 public static ISuffixTree Create <T>(string text)
     where T : IDictionary <char, ISuffixNode>, new()
 {
     return(SuffixTreeImpl <T> .Create(text));
 }