| Total Complexity | 0 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | #!/usr/bin/python |
||
| 2 | # -*- coding: utf-8 -*- |
||
| 3 | from titlesearch import get_similar_titles, get_alternative_titles |
||
| 4 | |||
| 5 | if __name__ == '__main__': |
||
| 6 | example_title = "Tate no Yuusha no Nariagari" |
||
| 7 | |||
| 8 | print('similar titles for: "{0:s}"'.format(example_title)) |
||
| 9 | results = get_similar_titles(example_title) |
||
| 10 | for title in results: |
||
| 11 | print('similarity: {1:.2f}%, title: "{0:s}"'.format(title['title'], float(title['similarity'])*100)) |
||
| 12 | |||
| 13 | print('') |
||
| 14 | print('alternative titles for: "{0:s}"'.format(example_title)) |
||
| 15 | alternate_titles = get_alternative_titles(title=example_title) |
||
| 16 | for language in alternate_titles: |
||
| 17 | for title in alternate_titles[language]: |
||
| 18 | print("[{0:s}]: {1:s}".format(language, title)) |
||
| 19 |