C# Класс mergedServices.util

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
allowedURIs List

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

GetQuestionType() публичный статический Метод

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
Результат List

ReadFile() публичный статический Метод

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.
Результат List

URIToSimpleString() публичный статический Метод

convert list of URIs to simple string list
public static URIToSimpleString ( List URIs ) : List
URIs List list of URIs
Результат List

URIToSimpleString() публичный статический Метод

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
Результат string

UrlEncode() публичный статический Метод

Encodes URIs
public static UrlEncode ( string value ) : string
value string the input url to be encoded
Результат string

clearLog() публичный статический Метод

empty the log file
public static clearLog ( ) : void
Результат void

computeLevenshteinDistance() публичный статический Метод

compute the levenstein Distance between two strings
public static computeLevenshteinDistance ( string s, string t ) : int
s string string1
t string string2
Результат int

encodeURI() публичный статический Метод

SHERIF WAY OF ENCODING OUR URIS (ONLY WORKS WITH DBPEDIA AND SUCH) POSSIBLE BUG
public static encodeURI ( string input ) : string
input string INPUT URI
Результат string

getIgnoreStrings() публичный статический Метод

more strings to be added
public static getIgnoreStrings ( ) : List
Результат List

getLabel() публичный статический Метод

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
Результат string

isInternalURI() публичный статический Метод

checks to see if the uri is from our dbpedia databse
public static isInternalURI ( string input ) : bool
input string the uri to check
Результат bool

loadAllowedLabels() публичный статический Метод

loading the allowed uris of our database
public static loadAllowedLabels ( ) : List
Результат List

log() публичный статический Метод

log text to the log file
public static log ( string s ) : void
s string string to be logged in the Logfile
Результат void

mapQuestionType() публичный статический Метод

maps the string of question type to enum type
public static mapQuestionType ( string type ) : util.questionTypes
type string string of question type
Результат util.questionTypes

match() публичный статический Метод

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
Результат bool

match() публичный статический Метод

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
Результат bool

Описание свойств

allowedURIs публичное статическое свойство

public static List allowedURIs
Результат List