public class Hotel extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
Hotel.JSONElement |
| Modifier and Type | Field and Description |
|---|---|
String |
address |
String |
address2 |
HashMap<String,String> |
amenities |
String |
areaServed |
TreeMap<String,Float> |
buckets |
String |
chainCode |
String |
checkin |
String |
checkout |
String |
city |
HashMap<String,Integer> |
conceptSentiment |
String |
country |
String |
currency |
String |
description |
String |
email |
String |
endPrice |
HashMap<String,AVPair> |
facilities |
String |
fax |
ArrayList<String> |
feedData |
String |
floors |
static int |
geocodeCount |
static int |
geocodeLimit |
String |
lastModified |
String |
lat |
static int |
level |
String |
lng |
String |
lowRate |
HashMap<String,String> |
media |
String |
merchant |
String |
name |
String |
nID |
String |
oID |
String |
oMerchant |
String |
postCode |
ArrayList<String> |
reviews |
String |
rooms |
HashMap<String,Integer> |
senses |
int |
sentiment |
String |
stars |
String |
startPrice |
String |
stateProv |
HashMap<String,Integer> |
SUMO |
String |
taID |
String |
tel |
String |
url |
HashMap<String,String> |
values |
| Constructor and Description |
|---|
Hotel() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAllSenses(HashMap<String,Integer> wnsenses) |
void |
addConceptSentiment(HashMap<String,Integer> conceptSent) |
String |
asCSV() |
static String |
asCSVHeader() |
static Hotel |
convertJSON2Hotel(Hotel.JSONElement js) |
static void |
execJSON(String path) |
static ArrayList<String> |
generateSUMOColumns(Hotel h,
ArrayList<String> SUMOheader) |
static ArrayList<String> |
generateSUMOHeader(ArrayList<Hotel> hotels)
Collect all possible column names and assign them a number, then sort
on that frequency.
|
static void |
hotelAmenitySentiment(ArrayList<Hotel> hotels)
Compute concept sentiment and store as a side effect.
|
static ArrayList<Hotel> |
HotelDBImport(boolean w) |
static ArrayList<ArrayList<String>> |
hotelReviewSUMOasSparseMatrix(ArrayList<Hotel> feed) |
static ArrayList<ArrayList<String>> |
hotelReviewSUMOSentimentAsSparseMatrix(ArrayList<Hotel> feed,
boolean write) |
static void |
hotelSentiment(ArrayList<Hotel> hotels) |
static void |
main(String[] args) |
static void |
matchHotels(Hotel feedHotel,
Hotel reviewsHotel) |
static void |
mergeHotels(ArrayList<Hotel> feed,
ArrayList<Hotel> reviews) |
static String |
normalizeSentiment(String value) |
static void |
oneHotelAmenitySentiment(Hotel h)
Compute concept sentiment and store as a side effect.
|
static ArrayList<Hotel> |
parseAllHotelReviewFiles(String fname)
Read hotel review files
|
static ArrayList<Hotel> |
parseAllTHotelReviewFiles(String fname)
Read hotel review files
|
static void |
parseHTMLAddress(Hotel h,
String addr)
Set address fields in the hotel as a side effect.
|
static int |
parseJSONElement(String s,
int ind,
Hotel.JSONElement js)
This routine adds elements to the parameter
|
static int |
parseJSONPair(String s,
int ind,
Hotel.JSONElement js)
This routine adds keys and values to the parameter.
|
static Hotel |
parseOneHotelPreviewFile(String fname) |
static Hotel |
parseOneHotelReviewFile(String fname) |
static Hotel |
parseOneJSONReviewFile(String fname) |
static Hotel |
parseOneTHotelReviewFile(String fname) |
static void |
printAllHotelAmenitySentiment(ArrayList<Hotel> hotels) |
static String |
printAllHotels(ArrayList<Hotel> hotels) |
static Hotel |
processOneOXMLHotel(Element h) |
static Hotel |
processOneXMLHotel(Element e) |
static ArrayList<Hotel> |
readCSVHotels(String fname) |
static ArrayList<Hotel> |
readJSONHotels(String dir,
boolean writeIncremental) |
static ArrayList<Hotel> |
readOXMLhotels(String fname) |
static ArrayList<Hotel> |
readXMLHotels(String fname)
Convert a particular XML markup into an array of hotels
|
static void |
setHotelWeights(ArrayList<Hotel> hotels)
Read a list of lists of Strings which is the original input plus
some extra columns for the weights of several "buckets", indicating
fitness with respect to a particular criterion.
|
String |
toString() |
static void |
writeHotelAsXML(Hotel h,
PrintWriter pw) |
public String oID
public String nID
public String taID
public String name
public String address
public String address2
public String city
public String stateProv
public String country
public String postCode
public String tel
public String fax
public String email
public String url
public String description
public String stars
public String lat
public String lng
public String chainCode
public String merchant
public String oMerchant
public String startPrice
public String endPrice
public String lowRate
public String currency
public String rooms
public String floors
public String checkin
public String checkout
public String areaServed
public String lastModified
public int sentiment
public static int geocodeCount
public static final int geocodeLimit
public static int level
public String asCSV()
public static String asCSVHeader()
public static void printAllHotelAmenitySentiment(ArrayList<Hotel> hotels)
public static void setHotelWeights(ArrayList<Hotel> hotels)
public static ArrayList<Hotel> HotelDBImport(boolean w)
w - states whether to write SUMO statementspublic static ArrayList<String> generateSUMOHeader(ArrayList<Hotel> hotels)
public static ArrayList<String> generateSUMOColumns(Hotel h, ArrayList<String> SUMOheader)
public static ArrayList<Hotel> readXMLHotels(String fname)
public static Hotel processOneXMLHotel(Element e)
h - is a DOM element for one hotelpublic static void parseHTMLAddress(Hotel h, String addr)
public static Hotel parseOneHotelReviewFile(String fname)
fname - has no file extension or directorypublic static Hotel parseOneHotelPreviewFile(String fname)
fname - has no file extension or directorypublic static ArrayList<Hotel> parseAllHotelReviewFiles(String fname)
public static ArrayList<Hotel> parseAllTHotelReviewFiles(String fname)
fname - is the directory path where the reviews arepublic static ArrayList<ArrayList<String>> hotelReviewSUMOasSparseMatrix(ArrayList<Hotel> feed)
feed - is an ArrayList of Hotel containing the raw data
about hotelspublic static ArrayList<ArrayList<String>> hotelReviewSUMOSentimentAsSparseMatrix(ArrayList<Hotel> feed, boolean write)
feed - is an ArrayList of Hotel containing the raw data
about hotelspublic static Hotel processOneOXMLHotel(Element h)
h - is a DOM element for one hotelpublic static int parseJSONPair(String s, int ind, Hotel.JSONElement js)
public static int parseJSONElement(String s, int ind, Hotel.JSONElement js)
public static Hotel convertJSON2Hotel(Hotel.JSONElement js)
public static void writeHotelAsXML(Hotel h, PrintWriter pw)
public static ArrayList<Hotel> readJSONHotels(String dir, boolean writeIncremental)
writeIncremental - means that each hotel review will be
processed and each spreadsheet line will be written after reading
each hotel.public static void oneHotelAmenitySentiment(Hotel h)
public static void hotelAmenitySentiment(ArrayList<Hotel> hotels)
public static void execJSON(String path)
public static void main(String[] args)
Copyright © 2015. All rights reserved.