# Path: languages/utils.py
# def word_score(word, triple_scores):
#     triples = list(word_triples(word))
#     result = 0.0
#     for triple in triples:
#         result += triple_scores.get(triple, 0.0)
#     return result / len(triples)
# 
# Path: languages/english.py
# TRIPLE_SCORES = {}
# 
# Path: languages/spanish.py
# TRIPLE_SCORES = {}
# 
# Path: languages/french.py
# TRIPLE_SCORES = {}
# 
# Path: languages/german.py
# TRIPLE_SCORES = {}


import os
import sys
from languages.utils import word_score
from languages import english, spanish, french, german
#!/usr/bin/env python

# Setup project environment in the parent directory.
sys.path[0] = os.path.dirname(sys.path[0])


WORDS = """
ich mit einem wenig kostenlosen begabten verschraubenden
Fuchs Traum Menschenfresser Dampfschiffahrt Dampfschifffahrt
me with another little inexpensive ridiculous interlocking
Python beautiful illusionist Antidisestablishmentarianism
""".split()


print '%-8s %-8s %-8s %-8s %s' % tuple(
    'english spanish french german word'.split())

for word in WORDS:
    print '%-8d %-8d %-8d %-8d %s' % (
        word_score(word, english.TRIPLE_SCORES),

# Path: languages/utils.py
# def word_score(word, triple_scores):
#     triples = list(word_triples(word))
#     result = 0.0
#     for triple in triples:
#         result += triple_scores.get(triple, 0.0)
#     return result / len(triples)
# 
# Path: languages/english.py
# TRIPLE_SCORES = {}
# 
# Path: languages/spanish.py
# TRIPLE_SCORES = {}
# 
# Path: languages/french.py
# TRIPLE_SCORES = {}
# 
# Path: languages/german.py
# TRIPLE_SCORES = {}


# Path: tools/languages_demo.py
import os
import sys
from languages.utils import word_score
from languages import english, spanish, french, german

#!/usr/bin/env python

# Setup project environment in the parent directory.
sys.path[0] = os.path.dirname(sys.path[0])


WORDS = """
ich mit einem wenig kostenlosen begabten verschraubenden
Fuchs Traum Menschenfresser Dampfschiffahrt Dampfschifffahrt
me with another little inexpensive ridiculous interlocking
Python beautiful illusionist Antidisestablishmentarianism
""".split()


print '%-8s %-8s %-8s %-8s %s' % tuple(
    'english spanish french german word'.split())

for word in WORDS:
    print '%-8d %-8d %-8d %-8d %s' % (
        word_score(word, english.TRIPLE_SCORES),

        word_score(word, spanish.TRIPLE_SCORES),