Skip to content

Instantly share code, notes, and snippets.

@tking16
Created July 30, 2015 18:54
Show Gist options
  • Save tking16/7109b3cc18db9334178c to your computer and use it in GitHub Desktop.
Save tking16/7109b3cc18db9334178c to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace TheoKingEuroMoneyTest
{
public partial class WebForm1 : System.Web.UI.Page
{
int NegativeWordcount;
int results;
string negativeWords;
List<String> NegativeWordList;
protected void Page_Load(object sender, EventArgs e)
{
NegativeWordList = new List<string>();
string Phrase = "The weather in Manchester in winter is bad. It rains all the time - it must be horrible for people visiting.";
PhraseTextBox.Text = Phrase;
NegativeWordList.Add("bad");
NegativeWordList.Add("horrible");
foreach (var words in NegativeWordList)
{
NegativeWordcount+= NegativeWordCounter.countNegativeWords(Phrase, words);
results = NegativeWordcount;
}
ScannedResults.Text = "Total Number of negative words: " + results;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment