public virtual void TestOnlyDelimitersReverse() { string path = "//"; ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path)); AssertTokenStreamContents(t, new string[] { "//", "/" }, new int[] { 0, 1 }, new int[] { 2, 2 }, new int[] { 1, 0 }, path.Length); }
public virtual void TestEndOfDelimiterReverseSkip() { string path = "/a/b/c/"; ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path), 1); AssertTokenStreamContents(t, new string[] { "/a/b/", "a/b/", "b/" }, new int[] { 0, 1, 3 }, new int[] { 5, 5, 5 }, new int[] { 1, 0, 0 }, path.Length); }
public virtual void TestStartOfCharEndOfDelimiterReverse() { string path = "a/b/c/"; ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path)); AssertTokenStreamContents(t, new string[] { "a/b/c/", "b/c/", "c/" }, new int[] { 0, 2, 4 }, new int[] { 6, 6, 6 }, new int[] { 1, 0, 0 }, path.Length); }
public virtual void TestBasicReverse() { string path = "/a/b/c"; ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path)); AssertTokenStreamContents(t, new string[] { "/a/b/c", "a/b/c", "b/c", "c" }, new int[] { 0, 1, 3, 5 }, new int[] { 6, 6, 6, 6 }, new int[] { 1, 0, 0, 0 }, path.Length); }
public virtual void TestReverseSkip2() { string path = "/a/b/c/"; ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path), 2); AssertTokenStreamContents(t, new string[] { "/a/", "a/" }, new int[] { 0, 1 }, new int[] { 3, 3 }, new int[] { 1, 0 }, path.Length); }
public virtual void TestOnlyDelimiterReverseSkip() { string path = "/"; ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path), 1); AssertTokenStreamContents(t, new string[] { }, new int[] { }, new int[] { }, new int[] { }, path.Length); }
public virtual void TestStartOfCharReverseSkip() { string path = "a/b/c"; ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path), 1); AssertTokenStreamContents(t, new string[] { "a/b/", "b/" }, new int[] { 0, 2 }, new int[] { 4, 4 }, new int[] { 1, 0 }, path.Length); }
public virtual void TestRandomStrings() { Analyzer a = Analyzer.NewAnonymous(createComponents: (fieldName, reader) => { Tokenizer tokenizer = new ReversePathHierarchyTokenizer(reader); return(new TokenStreamComponents(tokenizer, tokenizer)); }); CheckRandomData(Random, a, 1000 * RandomMultiplier); }
protected override TokenStreamComponents CreateComponents(string fieldName, TextReader reader) { Tokenizer tokenizer = new ReversePathHierarchyTokenizer(reader); return(new TokenStreamComponents(tokenizer, tokenizer)); }
public override TokenStreamComponents CreateComponents(string fieldName, TextReader reader) { Tokenizer tokenizer = new ReversePathHierarchyTokenizer(reader); return new Analyzer.TokenStreamComponents(tokenizer, tokenizer); }
public virtual void TestStartOfCharEndOfDelimiterReverseSkip() { string path = "a/b/c/"; ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path), 1); AssertTokenStreamContents(t, new string[] { "a/b/", "b/" }, new int[] { 0, 2 }, new int[] { 4, 4 }, new int[] { 1, 0 }, path.Length); }
public virtual void TestStartOfCharReverse() { string path = "a/b/c"; ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path)); AssertTokenStreamContents(t, new string[] { "a/b/c", "b/c", "c" }, new int[] { 0, 2, 4 }, new int[] { 5, 5, 5 }, new int[] { 1, 0, 0 }, path.Length); }
public virtual void TestEndOfDelimiterReverse() { string path = "/a/b/c/"; ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path)); AssertTokenStreamContents(t, new string[] { "/a/b/c/", "a/b/c/", "b/c/", "c/" }, new int[] { 0, 1, 3, 5 }, new int[] { 7, 7, 7, 7 }, new int[] { 1, 0, 0, 0 }, path.Length); }