Package com.articulate.sigma.dataProc
Class Hotel
java.lang.Object
com.articulate.sigma.dataProc.Hotel
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intstatic final intstatic intint -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllSenses(Map<String, Integer> wnsenses) voidaddConceptSentiment(Map<String, Integer> conceptSent) asCSV()static Stringstatic Hotelstatic voidgenerateSUMOColumns(Hotel h, List<String> SUMOheader) generateSUMOHeader(List<Hotel> hotels) Collect all possible column names and assign them a number, then sort on that frequency.static voidhotelAmenitySentiment(List<Hotel> hotels) Compute concept sentiment and store as a side effect.HotelDBImport(boolean w) hotelReviewSUMOSentimentAsSparseMatrix(ArrayList<Hotel> feed, boolean write) static voidhotelSentiment(ArrayList<Hotel> hotels) static voidstatic voidmatchHotels(Hotel feedHotel, Hotel reviewsHotel) static voidmergeHotels(ArrayList<Hotel> feed, ArrayList<Hotel> reviews) static StringnormalizeSentiment(String value) static voidCompute concept sentiment and store as a side effect.parseAllHotelReviewFiles(String fname) Read hotel review filesparseAllTHotelReviewFiles(String fname) Read hotel review filesstatic voidparseHTMLAddress(Hotel h, String addr) Set address fields in the hotel as a side effect.static intparseJSONElement(String s, int ind, Hotel.JSONElement js) This routine adds elements to the parameterstatic intparseJSONPair(String s, int ind, Hotel.JSONElement js) This routine adds keys and values to the parameter.static HotelparseOneHotelPreviewFile(String fname) static HotelparseOneHotelReviewFile(String fname) static HotelparseOneJSONReviewFile(String fname) static HotelparseOneTHotelReviewFile(String fname) static voidprintAllHotelAmenitySentiment(List<Hotel> hotels) static StringprintAllHotels(List<Hotel> hotels) static Hotelstatic HotelreadCSVHotels(String fname) readJSONHotels(String dir, boolean writeIncremental) readOXMLhotels(String fname) readXMLHotels(String fname) Convert a particular XML markup into an array of hotelsstatic voidsetHotelWeights(List<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.toString()static voidwriteHotelAsXML(Hotel h, PrintWriter pw)
-
Field Details
-
oID
-
nID
-
taID
-
name
-
address
-
address2
-
city
-
stateProv
-
country
-
postCode
-
tel
-
fax
-
email
-
url
-
description
-
stars
-
lat
-
lng
-
chainCode
-
merchant
-
oMerchant
-
startPrice
-
endPrice
-
lowRate
-
currency
-
rooms
-
floors
-
checkin
-
checkout
-
areaServed
-
lastModified
-
facilities
-
amenities
-
media
-
reviews
-
senses
-
SUMO
-
buckets
-
feedData
-
sentiment
public int sentiment -
conceptSentiment
-
values
-
geocodeCount
public static int geocodeCount -
geocodeLimit
public static final int geocodeLimit- See Also:
-
level
public static int level
-
-
Constructor Details
-
Hotel
public Hotel()
-
-
Method Details
-
asCSV
-
asCSVHeader
-
toString
-
addConceptSentiment
-
printAllHotels
-
printAllHotelAmenitySentiment
-
setHotelWeights
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. Result is a side effect of setting the bucket weights for the hotels. -
HotelDBImport
- Parameters:
w- states whether to write SUMO statements
-
generateSUMOHeader
Collect all possible column names and assign them a number, then sort on that frequency. -
generateSUMOColumns
-
readXMLHotels
Convert a particular XML markup into an array of hotels -
processOneXMLHotel
- Parameters:
e- is a DOM element for one hotel- Returns:
- a Hotel
-
readCSVHotels
-
parseHTMLAddress
Set address fields in the hotel as a side effect. 1734 South Harbor Blvd., Anaheim, CA 92802 -
parseOneHotelReviewFile
- Parameters:
fname- has no file extension or directory
-
parseOneHotelPreviewFile
- Parameters:
fname- has no file extension or directory
-
parseAllHotelReviewFiles
Read hotel review files- Returns:
- an ArrayList of Hotel
-
parseOneTHotelReviewFile
-
parseAllTHotelReviewFiles
Read hotel review files- Parameters:
fname- is the directory path where the reviews are- Returns:
- an ArrayList of Hotel
-
matchHotels
-
mergeHotels
-
addAllSenses
-
hotelReviewSUMOasSparseMatrix
- Parameters:
feed- is an ArrayList of Hotel containing the raw data about hotels- Returns:
- a list of hotels expressed as a list of string values for several fields and then a count of SUMO terms appearing in the review for the given hotel
-
hotelReviewSUMOSentimentAsSparseMatrix
public static ArrayList<ArrayList<String>> hotelReviewSUMOSentimentAsSparseMatrix(ArrayList<Hotel> feed, boolean write) - Parameters:
feed- is an ArrayList of Hotel containing the raw data about hotels- Returns:
- a list of hotels expressed as a list of string values for several fields and then a count of SUMO terms appearing in the review for the given hotel
-
processOneOXMLHotel
- Parameters:
h- is a DOM element for one hotel- Returns:
- a map of column name and column value
-
readOXMLhotels
-
parseJSONPair
This routine adds keys and values to the parameter. There are three possibilities: - string key : string value - string key : integer value - string key : [list]- Returns:
- the string index
-
parseJSONElement
This routine adds elements to the parameter- Returns:
- the string index
-
convertJSON2Hotel
-
parseOneJSONReviewFile
-
normalizeSentiment
-
writeHotelAsXML
-
readJSONHotels
- Parameters:
writeIncremental- means that each hotel review will be processed and each spreadsheet line will be written after reading each hotel.
-
hotelSentiment
-
oneHotelAmenitySentiment
Compute concept sentiment and store as a side effect. -
hotelAmenitySentiment
Compute concept sentiment and store as a side effect. -
execJSON
-
main
-