public static Edu.Stanford.Nlp.Objectbank.ObjectBank <X> GetLineIterator <X, _T1>(ICollection <_T1> filesStringsAndReaders, IFunction <string, X> op, string encoding)
        {
            ReaderIteratorFactory          rif  = new ReaderIteratorFactory(filesStringsAndReaders, encoding);
            IIteratorFromReaderFactory <X> ifrf = LineIterator.GetFactory(op);

            return(new Edu.Stanford.Nlp.Objectbank.ObjectBank <X>(rif, ifrf));
        }
        public static Edu.Stanford.Nlp.Objectbank.ObjectBank <X> GetLineIterator <X>(File file, Func <string, X> op, string encoding)
        {
            ReaderIteratorFactory          rif  = new ReaderIteratorFactory(file, encoding);
            IIteratorFromReaderFactory <X> ifrf = LineIterator.GetFactory(op);

            return(new Edu.Stanford.Nlp.Objectbank.ObjectBank <X>(rif, ifrf));
        }
        public static Edu.Stanford.Nlp.Objectbank.ObjectBank <X> GetLineIterator <X>(Reader reader, IFunction <string, X> op)
        {
            ReaderIteratorFactory          rif  = new ReaderIteratorFactory(reader);
            IIteratorFromReaderFactory <X> ifrf = LineIterator.GetFactory(op);

            return(new Edu.Stanford.Nlp.Objectbank.ObjectBank <X>(rif, ifrf));
        }
        public virtual void TestLineIterator()
        {
            string s = "\n\n@@123\nthis\nis\na\nsentence\n\n@@124\nThis\nis another\n.\n\n@125\nThis is the\tlast\n";

            string[]             output = new string[] { string.Empty, string.Empty, "@@123", "this", "is", "a", "sentence", string.Empty, "@@124", "This", "is another", ".", string.Empty, "@125", "This is the\tlast" };
            IEnumerator <string> di     = new LineIterator <string>(new StringReader(s), new IdentityFunction <string>());

            try
            {
                foreach (string @out in output)
                {
                    string ans = di.Current;
                    // System.out.println(ans);
                    NUnit.Framework.Assert.AreEqual(@out, ans, "Wrong line");
                }
                if (di.MoveNext())
                {
                    NUnit.Framework.Assert.Fail("Too many things in iterator: " + di.Current);
                }
            }
            catch (Exception e)
            {
                NUnit.Framework.Assert.Fail("Probably too few things in iterator: " + e);
            }
        }