BridgeTheGap.java
//takes in .txt file generated from Twitter
takes in .txt file generated from Twitter
takes in . txt file generated from Twitter
public String realInput() {
		ArrayList<String> inputURLs = new ArrayList<String>();
		ArrayList<String> compareURLs = newsURLs();
		File inputF = new File("twitter.txt");
		Scanner scan;
		String returnVal = "";
		try {
			scan = new Scanner(inputF);
			while (scan.hasNextLine()) {
				String line = scan.nextLine();
				if (line.equals("/n /n /n")) {
					line = line.replace("'", "");
					line = line.replace(",", "");
					if (compareURLs.contains(line)) {
						inputURLs.add(line);
					}
				}
				int sum = 0;
				for (String url: inputURLs) {
					sum += vertexMap.get(url).rank;
				}
				sum = sum / inputURLs.size();
				returnVal = "";
				while (returnVal.equals("") && sum <= 34) {
					for (String url1: compareURLs) {
						if (vertexMap.get(url1).rank == sum) {
							returnVal = url1;
						}
					} 
					sum += 1;
				}
				return returnVal;
			}
		} catch (FileNotFoundException e1) {
			e1.printStackTrace();
		}
		return returnVal;
	}
public String realInput ( ) { ArrayList < String > inputURLs = new ArrayList < String > ( ) ; ArrayList < String > compareURLs = newsURLs ( ) ; File inputF = new File ( "twitter.txt" ) ; Scanner scan ; String returnVal = "" ; try { scan = new Scanner ( inputF ) ; while ( scan . hasNextLine ( ) ) { String line = scan . nextLine ( ) ; if ( line . equals ( "/n /n /n" ) ) { line = line . replace ( "'" , "" ) ; line = line . replace ( "," , "" ) ; if ( compareURLs . contains ( line ) ) { inputURLs . add ( line ) ; } } int sum = 0 ; for ( String url : inputURLs ) { sum += vertexMap . get ( url ) . rank ; } sum = sum / inputURLs . size ( ) ; returnVal = "" ; while ( returnVal . equals ( "" ) && sum <= 34 ) { for ( String url1 : compareURLs ) { if ( vertexMap . get ( url1 ) . rank == sum ) { returnVal = url1 ; } } sum += 1 ; } return returnVal ; } } catch ( FileNotFoundException e1 ) { e1 . printStackTrace ( ) ; } return returnVal ; }
takes in .txt file generated from Twitter
takes in . txt file generated from Twitter
//sums url ranks and then averages them to find the average political score //converts that rank into a url, by making a list of urls // TODO Auto-generated catch block