C# Class mergedServices.util

Show file Open project: sherifkandeel/weet-it_WCF Class Usage Examples

Public Properties

Property Type Description
allowedURIs List

Public Methods

Method Description
GetQuestionType ( string question ) : List

Gets the type of the question and remove words used to match question type from the question string

ReadFile ( string filePath ) : List

Reads line of text files and return it in a list of strings.

URIToSimpleString ( List URIs ) : List

convert list of URIs to simple string list

URIToSimpleString ( string URI ) : string

returns a simple string of the URI by taking the last part of it , or the part after # if exists

UrlEncode ( string value ) : string

Encodes URIs

clearLog ( ) : void

empty the log file

computeLevenshteinDistance ( string s, string t ) : int

compute the levenstein Distance between two strings

encodeURI ( string input ) : string

SHERIF WAY OF ENCODING OUR URIS (ONLY WORKS WITH DBPEDIA AND SUCH) POSSIBLE BUG

getIgnoreStrings ( ) : List

more strings to be added

getLabel ( string URI ) : string

This method tries it's best to get a label for the wanted URI

isInternalURI ( string input ) : bool

checks to see if the uri is from our dbpedia databse

loadAllowedLabels ( ) : List

loading the allowed uris of our database

log ( string s ) : void

log text to the log file

mapQuestionType ( string type ) : util.questionTypes

maps the string of question type to enum type

match ( string s, List s2 ) : bool

returns true if match s matches 40% of any of the strings in s2 //todo :

match ( string s, string s2 ) : bool

return true if s matches 40% - or min match distance - of s2 otherwise return false

Private Methods

Method Description
UpperCaseUrlEncode ( string s ) : string

HELPER FUNCTION FOR THE encdoeURI

addtohashset ( string URI, string label ) : void

this method adds the new labels from queries to the dataset

Method Details

GetQuestionType() public static method

Gets the type of the question and remove words used to match question type from the question string
public static GetQuestionType ( string question ) : List
question string Input question to check type and remove words used to match the type
return List

ReadFile() public static method

Reads line of text files and return it in a list of strings.
public static ReadFile ( string filePath ) : List
filePath string The path of the file to be read.
return List

URIToSimpleString() public static method

convert list of URIs to simple string list
public static URIToSimpleString ( List URIs ) : List
URIs List list of URIs
return List

URIToSimpleString() public static method

returns a simple string of the URI by taking the last part of it , or the part after # if exists
public static URIToSimpleString ( string URI ) : string
URI string the URI
return string

UrlEncode() public static method

Encodes URIs
public static UrlEncode ( string value ) : string
value string the input url to be encoded
return string

clearLog() public static method

empty the log file
public static clearLog ( ) : void
return void

computeLevenshteinDistance() public static method

compute the levenstein Distance between two strings
public static computeLevenshteinDistance ( string s, string t ) : int
s string string1
t string string2
return int

encodeURI() public static method

SHERIF WAY OF ENCODING OUR URIS (ONLY WORKS WITH DBPEDIA AND SUCH) POSSIBLE BUG
public static encodeURI ( string input ) : string
input string INPUT URI
return string

getIgnoreStrings() public static method

more strings to be added
public static getIgnoreStrings ( ) : List
return List

getLabel() public static method

This method tries it's best to get a label for the wanted URI
public static getLabel ( string URI ) : string
URI string uri to get label to
return string

isInternalURI() public static method

checks to see if the uri is from our dbpedia databse
public static isInternalURI ( string input ) : bool
input string the uri to check
return bool

loadAllowedLabels() public static method

loading the allowed uris of our database
public static loadAllowedLabels ( ) : List
return List

log() public static method

log text to the log file
public static log ( string s ) : void
s string string to be logged in the Logfile
return void

mapQuestionType() public static method

maps the string of question type to enum type
public static mapQuestionType ( string type ) : util.questionTypes
type string string of question type
return util.questionTypes

match() public static method

returns true if match s matches 40% of any of the strings in s2 //todo :
public static match ( string s, List s2 ) : bool
s string string that used to check if it matches or not
s2 List list of strings
return bool

match() public static method

return true if s matches 40% - or min match distance - of s2 otherwise return false
public static match ( string s, string s2 ) : bool
s string string to be matched
s2 string string to be matched with
return bool

Property Details

allowedURIs public static property

public static List allowedURIs
return List