Sentiment analysis, also known as opinion mining, is a mechanism for understanding the natural disposition that people possess towards a specific topic. This type of information is very valuable for certain industries - digital marketing companies use sentiment analysis to track the public's mood about a particular product, the view of elected authorities in a given country, or to explain sports allegiances, among many other goals. A common approach to sentiment analysis consists of systematically reviewing content from websites, especially social networks like Facebook, Twitter, and Google+, and using an algorithm to determine the opinions of the masses. For this work, the main body of analysis came from the «Twittersphere.» On the Twitter platform, users send 140-character messages to the social network as a means of expressing their viewpoints on certain issues. These messages, or «tweets,» are then shown in the user's homepage. Twitter is used widely in Chile. This work analyzed the public's opinions on the presidential primaries for the Alliance political party between Andres Allamand «Renovación Nacional» (RN) and Pablo Longueira from «Union Democrata Independiente» (UDI) using information collected from Twitter in that country. After gathering all relevant data, researchers used sentiment analysis to predict the outcome of the primaries. This data identified citizens who were in favor (positive) of either Allamand or Longueira and people who were against (negative) any political party or persuasion. Researchers designed a dictionary algorithm to aid in these predictions. This was comprised of certain positive and negative words, which, when applied to the Twitter data, was able to determine the polarity of the message: positive, negative, and/or neutral. In addition, an exponential function was used for analyzing the distance between the words, which is useful to gather opinions where both candidates are mentioned, identifying polarity for each of them separately. Later, a score was assigned to each Twitter user. Those cumulative scores were ultimately used to predict the way those given users would vote in the primary elections.