當前位置: 首頁>>代碼示例>>Python>>正文


Python parser.Parser類代碼示例

本文整理匯總了Python中jobcert.parser.Parser的典型用法代碼示例。如果您正苦於以下問題:Python Parser類的具體用法?Python Parser怎麽用?Python Parser使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Parser類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_description

 def test_description(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-jsonld.html'))
     assert parser.job_advert.description == "Description: ABC Company Inc. seeks a full-time mid-level software engineer to develop in-house tools."
開發者ID:Doteveryone,項目名稱:BetterJobAdverts,代碼行數:4,代碼來源:parser.py

示例2: test_salary_unclear

 def test_salary_unclear(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-jsonld-salary-unclear.html'))
     assert parser.get_result('salary-clarity')['result'] == 'unclear'
開發者ID:Doteveryone,項目名稱:BetterJobAdverts,代碼行數:4,代碼來源:parser.py

示例3: test_sentance_too_short_for_flesch_reading_ease

 def test_sentance_too_short_for_flesch_reading_ease(self):
     test_string = "A test"
     assert None == Parser.calculate_flesch_reading_ease(test_string)
開發者ID:Doteveryone,項目名稱:BetterJobAdverts,代碼行數:3,代碼來源:parser.py

示例4: test_employment_type

    def test_employment_type(self):
        parser = Parser()
        parser.parse(read_test_case('schemaorg-jsonld.html'))
        assert parser.job_advert.employment_type == 'Full-time'

        assert parser.get_result('has-employment-type')['result'] == True
開發者ID:Doteveryone,項目名稱:BetterJobAdverts,代碼行數:6,代碼來源:parser.py

示例5: test_publishing_format

 def test_publishing_format(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-rdfa.html'))
     assert parser.job_advert.publishing_format == "rdfa"
開發者ID:Doteveryone,項目名稱:BetterJobAdverts,代碼行數:4,代碼來源:parser.py

示例6: test_invalid_jobPosting_text

 def test_invalid_jobPosting_text(self):
     assert False == Parser.has_jobposting(read_test_case('test.txt'))        
開發者ID:Doteveryone,項目名稱:BetterJobAdverts,代碼行數:2,代碼來源:parser.py

示例7: test_location_clear

    def test_location_clear(self):
        parser = Parser()
        parser.parse(read_test_case('schemaorg-jsonld-location-clear.html')) 
        assert parser.job_advert.address == 'Somerset House, Strand, London WC2R 1LA, London'

        assert parser.get_result('location-clarity')['result'] == 'clear'
開發者ID:Doteveryone,項目名稱:BetterJobAdverts,代碼行數:6,代碼來源:parser.py

示例8: test_valid_jobPosting_rdfa

 def test_valid_jobPosting_rdfa(self):
     assert True == Parser.has_jobposting(read_test_case('schemaorg-rdfa.html'))
開發者ID:Doteveryone,項目名稱:BetterJobAdverts,代碼行數:2,代碼來源:parser.py

示例9: test_invalid_jobPosting_html

 def test_invalid_jobPosting_html(self):
     assert False == Parser.has_jobposting(read_test_case('schemaorg-html.html'))
開發者ID:Doteveryone,項目名稱:BetterJobAdverts,代碼行數:2,代碼來源:parser.py

示例10: test_valid_jobPosting_jsonld

 def test_valid_jobPosting_jsonld(self):
     assert True == Parser.has_jobposting(read_test_case('schemaorg-jsonld.html'))
開發者ID:Doteveryone,項目名稱:BetterJobAdverts,代碼行數:2,代碼來源:parser.py

示例11: test_check_creative_commons_licence_link

 def test_check_creative_commons_licence_link(self):
     parser = Parser()
     parser.parse(read_test_case('licence-link.html'))
     assert parser.job_advert.creative_commons_licences == [{'name': 'Creative Commons Attribution', 'url': 'http://creativecommons.org/licenses/by-nd/4.0'}]
     assert parser.get_result('creative-commons-licence')['result'] == True
開發者ID:Doteveryone,項目名稱:BetterJobAdverts,代碼行數:5,代碼來源:parser.py

示例12: test_salary_clear

 def test_salary_clear(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-microdata-salary-clear.html'))
     assert parser.get_result('salary-clarity')['result'] == 'clear'
開發者ID:Doteveryone,項目名稱:BetterJobAdverts,代碼行數:4,代碼來源:parser.py

示例13: test_salary_missing

 def test_salary_missing(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-jsonld-salary-missing.html'))
     assert parser.get_result('salary-clarity')['result'] == 'missing'
開發者ID:Doteveryone,項目名稱:BetterJobAdverts,代碼行數:4,代碼來源:parser.py

示例14: test_neutral

 def test_neutral(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-microdata-gender-coding-neutral.html'))
     assert parser.get_result('gender-coded-language')['result'] == 'neutral'
開發者ID:Doteveryone,項目名稱:BetterJobAdverts,代碼行數:4,代碼來源:parser.py

示例15: test_location_unclear

    def test_location_unclear(self):
        parser = Parser()
        parser.parse(read_test_case('schemaorg-jsonld.html')) 
        assert parser.job_advert.address == 'Kirkland, WA'

        assert parser.get_result('location-clarity')['result'] == 'unclear'
開發者ID:Doteveryone,項目名稱:BetterJobAdverts,代碼行數:6,代碼來源:parser.py


注:本文中的jobcert.parser.Parser類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。