Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Statistical parsing of English sentences

, 13 Dec 2006
Shows how to generate parse trees for English language sentences, using a C# port of OpenNLP, a statistical natural language parsing library.
englishparsing_bin.zip
englishparsing_net2_0_bin.zip
englishparsing_net2_0_src.zip
Lithium
Collections
Delegates
Enums
Interfaces
IO
Lithium.csproj.vspscc
LithiumControl.bmp
Shapes
UI
Visitors
ModelConverter
App.ico
ModelConverter.csproj.vspscc
ParseTree
App.ico
ParseTree.csproj.vspscc
ToolsExample
App.ico
ToolsExample.csproj.vspscc
OpenNLP
OpenNLP.csproj.vspscc
SharpEntropy.dll
Tools
Chunker
NameFind
Parser
PosTagger
SentenceDetect
Tokenize
Util
englishparsing_src.zip
Lithium.csproj.user
LithiumControl.bmp
App.ico
ModelConverter.csproj.user
OpenNLP.csproj.user
SharpEntropy.dll
vssver.scc
vssver.scc
vssver.scc
vssver.scc
vssver.scc
vssver.scc
vssver.scc
App.ico
ParseTree.csproj.user
App.ico
ToolsExample.csproj.user
using System;

namespace Netron.Lithium
{
	/// <summary>
	/// Generic Collectioon of GraphML related data
	/// </summary>
	public class GraphDataCollection : System.Collections.CollectionBase 
	{
    
		#region Properties
		/// <summary>
		/// integer indexer
		/// </summary>
		public virtual object this[int index] 
		{
			get 
			{
				return this.List[index];
			}
			set 
			{
				this.List[index] = value;
			}
		}
            
		#endregion

		#region Methods
		/// <summary>
		/// Adds and object to the collection
		/// </summary>
		/// <param name="o"></param>
		public virtual void Add(object o) 
		{
			this.List.Add(o);
		}
            
		
		/// <summary>
		/// Returns whether the given object is stored in the collection
		/// </summary>
		/// <param name="o">whatever object</param>
		/// <returns>true if contained otherwise false</returns>
		public virtual bool Contains(object o) 
		{
			return this.List.Contains(o);
		}
            
		
		/// <summary>
		/// Removes an element from the collection
		/// </summary>
		/// <param name="o"></param>
		public virtual void Remove(object o) 
		{
			this.List.Remove(o);
		}
		

		/// <summary>
		/// Overrides the default implementation to collect the data of the collection
		/// </summary>
		/// <returns></returns>
		public override string ToString() 
		{
			System.IO.StringWriter sw = new System.IO.StringWriter();
			// <foreach>
			// This loop mimics a foreach call. See C# programming language, pg 247
			// Here, the enumerator is seale and does not implement IDisposable
			System.Collections.IEnumerator enumerator = this.List.GetEnumerator();
			for (
				; enumerator.MoveNext(); 
				) 
			{
				string s = ((string)(enumerator.Current));
				// foreach body
				sw.Write(s);
			}
			// </foreach>
			return sw.ToString();
		}

		#endregion
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Richard Northedge
Web Developer
United Kingdom United Kingdom
Richard Northedge is a senior developer with a UK Microsoft Gold Partner company. He has a postgraduate degree in English Literature, has been programming professionally since 1998 and has been an MCSD since 2000.

| Advertise | Privacy | Mobile
Web01 | 2.8.140718.1 | Last Updated 13 Dec 2006
Article Copyright 2005 by Richard Northedge
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid