本文整理汇总了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."
示例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'
示例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)
示例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
示例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"
示例6: test_invalid_jobPosting_text
def test_invalid_jobPosting_text(self):
assert False == Parser.has_jobposting(read_test_case('test.txt'))
示例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'
示例8: test_valid_jobPosting_rdfa
def test_valid_jobPosting_rdfa(self):
assert True == Parser.has_jobposting(read_test_case('schemaorg-rdfa.html'))
示例9: test_invalid_jobPosting_html
def test_invalid_jobPosting_html(self):
assert False == Parser.has_jobposting(read_test_case('schemaorg-html.html'))
示例10: test_valid_jobPosting_jsonld
def test_valid_jobPosting_jsonld(self):
assert True == Parser.has_jobposting(read_test_case('schemaorg-jsonld.html'))
示例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
示例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'
示例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'
示例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'
示例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'