下载了开源对话系统OpenEphyra的源代码进行学习,在Eclipse下进行编译,波折不断,犯了些错误.
1. 通过Import Project后在workspace建立了OpenEphyra的project,但忘记拷贝conf和res文件夹到workspace,导致后续的运行错误.
在定位该错误过程中,我甚至下载了OpenNLP 1.3.0版. 该版本编成jar时候需要把源代码也加入,这样方便后续的debug.
2. 遇到了以下错误,似乎是内存不够了.
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
解决办法是:选中被运行的类,点击菜单‘run->run...’,选择(x)=Argument标签页下的vm arguments框里输入 -Xmx800m, 保存运行.
3. 字符串"-+锟?*锟斤拷=_锟絴锟絓\/锟?:,;锟??锟?!锟斤拷\"锟斤拷锟?'锟絗"遇到了编译错误:Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\ )
最后把包含该字符串的源代码文件的属性中的"Text file encoding"从缺省的GBK改成UTF-8就编译通过了.
以下是Eclips下运行结果(搜索引擎部分运行不了):
+++++ Initializing engine (2016-09-04 16:37:24) +++++
Creating tokenizer...
Creating sentence detector...
Creating stemmer...
Creating POS tagger...
Creating chunker...
Creating syntactic parser...
Creating NE taggers...
...loading lists
...for NEacademicTitle
...for NEactor
...for NEairport
...for NEanimal
...for NEanthem
...for NEauthor
...for NEaward
...for NEbacteria
...for NEbird
...for NEbirthstone
...for NEbodyPart
...for NEbook
...for NEcanal
...for NEcapital
...for NEcauseOfDeath
...for NEchemicalElement
...for NEcolor
...for NEcompetition
...for NEconflict
...for NEcontinent
...for NEcountry
...for NEcrime
...for NEcurrency
...for NEdaytime
...for NEdirector
...for NEdisease
...for NEdrug
...for NEeducationalInstitution
...for NEethnicGroup
...for NEfestival
...for NEfilm
...for NEfilmType
...for NEfirstName
...for NEflower
...for NEfruit
...for NEhemisphere
...for NEhour
...for NEisland
...for NElake
...for NElanguage
...for NEmaterial
...for NEmathematician
...for NEmedicalTreatment
...for NEmedicinal
...for NEmetal
...for NEmilitaryRank
...for NEmineral
...for NEministry
...for NEmonth
...for NEmountain
...for NEmountainRange
...for NEmusical
...for NEmusicalInstrument
...for NEmusicType
...for NEnarcotic
...for NEnationality
...for NEnationalPark
...for NEnewspaper
...for NEnobleTitle
...for NEocean
...for NEopera
...for NEorganization
...for NEpathogen
...for NEpeninsula
...for NEplanet
...for NEplant
...for NEplaywright
...for NEpoliceRank
...for NEpoliticalParty
...for NEprofession
...for NEprovince
...for NEradioStation
...for NErelation
...for NEreligion
...for NEriver
...for NEscientist
...for NEsea
...for NEseason
...for NEshow
...for NEshowType
...for NEsocialTitle
...for NEsport
...for NEstadium
...for NEstate
...for NEstone
...for NEstyle
...for NEteam
...for NEtherapy
...for NEtimezone
...for NEtvChannel
...for NEusPresident
...for NEvaccine
...for NEvirus
...for NEwater
...for NEzodiacSign
...loading patterns
...for NEproperName
...for NEacronym
...for NEangle
...for NEarea
...for NEcentury
...for NEcounty
...for NEdate
...for NEday
...for NEdayMonth
...for NEdays
...for NEdecade
...for NEduration
...for NEeducationalInstitution
...for NEfeet
...for NEfrequency
...for NEgallons
...for NEgrams
...for NElegalSentence
...for NElength
...for NEliters
...for NEmiles
...for NEmoney
...for NEmph
...for NEnumber
...for NEordinal
...for NEounces
...for NEpercentage
...for NEphoneNumber
...for NEpounds
...for NErange
...for NErate
...for NEreef
...for NEscore
...for NEsize
...for NEspeed
...for NEsquareMiles
...for NEstreet
...for NEtemperature
...for NEtime
...for NEtons
...for NEurl
...for NEvolume
...for NEweekday
...for NEweight
...for NEyear
...for NEyears
...for NEzipcode
...loading models
...done
Creating WordNet dictionary...
Loading function verbs...
Loading prepositions...
Loading irregular verbs...
Loading word frequencies...
Loading query reformulators...
Loading question patterns...
Loading answer patterns...
...for ABBREVIATION
...for ACTOR
...for AGE
...for ANCESTOR
...for AUTHOR
...for AWARD
...for CAPITAL
...for CAUSE
...for CAUSEOFDEATH
...for COACH
...for COMPETITOR
...for CREATOR
...for DATE
...for DATEOFBIRTH
...for DATEOFCREATION
...for DATEOFDEATH
...for DATEOFDISCOVERY
...for DATEOFEND
...for DATEOFFOUNDATION
...for DATEOFINAUGURATION
...for DATEOFINVENTION
...for DATEOFLIVING
...for DATEOFMARRIAGE
...for DATEOFRETIREMENT
...for DATEOFSTART
...for DATEOFSTARTOFOPERATION
...for DATEOFWINNING
...for DEFINITION
...for DISCOVERER
...for DISCOVERY
...for DISTANCE
...for DURATION
...for ETHNICGROUP
...for FATHER
...for FOOD
...for FOUNDATION
...for FOUNDER
...for FUNCTION
...for FUNDER
...for FUNDING
...for GRADUATE
...for HABITAT
...for HEIGHT
...for IDENTITY
...for INSTRUMENT
...for INVENTOR
...for KILLER
...for LANGUAGE
...for LEADER
...for LEADERSHIP
...for LENGTH
...for LIFESPAN
...for LONGFORM
...for MEDICINE
...for MEMBER
...for MEMBERSHIP
...for MONEY
...for MOTHER
...for MOVIE
...for NAME
...for NAMER
...for NATIONALITY
...for NUMBER
...for NUMBEROFCHILDREN
...for NUMBEROFMEMBER
...for NUMBEROFVICTIMS
...for NUMBEROFVICTORIES
...for NUMBEROFVISITORS
...for OPPONENT
...for ORIGIN
...for OWNER
...for PLACE
...for PLACEOFBIRTH
...for PLACEOFDEATH
...for PLACEOFFOUNDATION
...for PLACEOFFUNERAL
...for PLACEOFLIVING
...for PLACEOFOCCURRENCE
...for PLACEOFORIGIN
...for POPULATION
...for PRODUCT
...for PROFESSION
...for PROVIDER
...for PUBLICATION
...for RESOURCE
...for SCHOOL
...for SIZE
...for SPECIALTY
...for SPECIES
...for SPEED
...for SPOUSE
...for SYMPTOM
...for SYNONYM
...for VALUE
...for WEIGHT
...for WIDTH
...for WINNER
...done
Question: where is Beijing?
+++++ Analyzing question (2016-09-04 16:41:03) +++++
Normalization: where be beijing
Answer types:
NElocation
Interpretations:
Property: PLACE
Target: Beijing
Predicates:
-
+++++ Generating queries (2016-09-04 16:41:15) +++++
Query strings:
Beijing
(Beijing OR "capital of Red China" OR Peking OR Peiping)
"Beijing" Beijing
"Beijing is in"
"Beijing is at"
+++++ Searching (2016-09-04 16:41:15) +++++
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%28Beijing+OR+%22capital+of+Red+China%22+OR+Peking+OR+Peiping%29%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%22Beijing+is+at%22%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%22Beijing+is+in%22%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%22Beijing%22+Beijing%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%22Beijing+is+in%22%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%22Beijing%22+Beijing%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%22Beijing+is+at%22%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%28Beijing+OR+%22capital+of+Red+China%22+OR+Peking+OR+Peiping%29%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27Beijing%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27Beijing%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%22Beijing+is+in%22%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%22Beijing+is+at%22%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%28Beijing+OR+%22capital+of+Red+China%22+OR+Peking+OR+Peiping%29%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%22Beijing%22+Beijing%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%22Beijing+is+at%22%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27Beijing%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%22Beijing%22+Beijing%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%22Beijing+is+in%22%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%22Beijing%22+Beijing%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27Beijing%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%22Beijing+is+at%22%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27Beijing%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%28Beijing+OR+%22capital+of+Red+China%22+OR+Peking+OR+Peiping%29%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%22Beijing+is+in%22%27&$format=JSON
Search error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27%28Beijing+OR+%22capital+of+Red+China%22+OR+Peking+OR+Peiping%29%27&$format=JSON
+++++ Selecting Answers (2016-09-04 16:41:25) +++++
Filter "AnswerTypeFilter" started, 0 Results (2016-09-04 16:41:25)
Filter "AnswerTypeFilter" finished, 0 Results (2016-09-04 16:41:25)
Filter "AnswerPatternFilter" started, 0 Results (2016-09-04 16:41:25)
Filter "AnswerPatternFilter" finished, 0 Results (2016-09-04 16:41:25)
Filter "WebDocumentFetcherFilter" started, 0 Results (2016-09-04 16:41:25)
Filter "WebDocumentFetcherFilter" finished, 0 Results (2016-09-04 16:41:25)
Filter "PredicateExtractionFilter" started, 0 Results (2016-09-04 16:41:25)
Filter "PredicateExtractionFilter" finished, 0 Results (2016-09-04 16:41:25)
Filter "FactoidsFromPredicatesFilter" started, 0 Results (2016-09-04 16:41:25)
Filter "FactoidsFromPredicatesFilter" finished, 0 Results (2016-09-04 16:41:25)
Filter "TruncationFilter" started, 0 Results (2016-09-04 16:41:25)
Filter "TruncationFilter" finished, 0 Results (2016-09-04 16:41:25)
Filter "StopwordFilter" started, 0 Results (2016-09-04 16:41:25)
Filter "StopwordFilter" finished, 0 Results (2016-09-04 16:41:25)
Filter "QuestionKeywordsFilter" started, 0 Results (2016-09-04 16:41:25)
Filter "QuestionKeywordsFilter" finished, 0 Results (2016-09-04 16:41:25)
Filter "ScoreNormalizationFilter" started, 0 Results (2016-09-04 16:41:25)
Filter "ScoreNormalizationFilter" finished, 0 Results (2016-09-04 16:41:25)
Filter "ScoreCombinationFilter" started, 0 Results (2016-09-04 16:41:25)
Filter "ScoreCombinationFilter" finished, 0 Results (2016-09-04 16:41:25)
Filter "FactoidSubsetFilter" started, 0 Results (2016-09-04 16:41:25)
Filter "FactoidSubsetFilter" finished, 0 Results (2016-09-04 16:41:25)
Filter "DuplicateFilter" started, 0 Results (2016-09-04 16:41:25)
Filter "DuplicateFilter" finished, 0 Results (2016-09-04 16:41:25)
Filter "ScoreSorterFilter" started, 0 Results (2016-09-04 16:41:25)
Filter "ScoreSorterFilter" finished, 0 Results (2016-09-04 16:41:25)
Answer:
Question: