private static StateFinder GetFinder(AddressParseContainer container) { var splitter = new AddressSplitter(container); var finder = new StateFinder(container); splitter.SplitAndClean(); return(finder); }
static void Main(string[] args) { var stateFinder = new StateFinder(); try{ Console.WriteLine(stateFinder.GetStateNameForZipCode(11)); Console.WriteLine(stateFinder.GetStateNameForZipCode(9)); } catch (InvalidOperationException exception) { Console.WriteLine(exception.Message); } }
static void Main(string[] args) { var stateFinder = new StateFinder(); try{ Console.WriteLine(stateFinder.GetStateNameForZipCode(11)); // This will now pass. However, it is still invalid for the United States. Console.WriteLine(stateFinder.GetStateNameForZipCode(9)); } catch (InvalidOperationException exception) { Console.WriteLine(exception.Message); } }
public void Start() { string fileName = ConfigurationManager.AppSettings["tweets"]; string[] stringTweets = File.ReadAllText(fileName).Split(new[] { Environment.NewLine }, StringSplitOptions.None); IList <Tweet> tweets = new List <Tweet>(); IParser <Tweet> parser = new TweetParser(); foreach (string tweet in stringTweets) { tweets.Add(parser.Parse(tweet)); } SentimentsParser.Parse(tweets, Context.Sentiments); StateFinder.Find(tweets, Context.StatesPolygons); Context.StatesSentiments = StatesEvaluator.Evaluate(tweets, Context.StatesPolygons.Keys); }
static void Main(string[] args) { var stateFinder = new StateFinder(); // For the United States try{ var addressVerifier = new AddressVerifier(); Console.WriteLine(stateFinder.GetStateNameForZipCode(11, addressVerifier)); Console.WriteLine(stateFinder.GetStateNameForZipCode(9, addressVerifier)); } catch (InvalidOperationException exception) { Console.WriteLine(exception.Message); } // For the Germany try{ var addressVerifier = new GermanyAddressVerifier(); Console.WriteLine(stateFinder.GetStateNameForZipCode(9, addressVerifier)); } catch (InvalidOperationException exception) { Console.WriteLine(exception.Message); } }
// Use this for initialization void Start() { state = GetComponent <StateFinder>(); rb = GetComponent <Rigidbody> (); }