'Returns a new Document from the given text file path.
The given text file must be generated with Document.save().'

@classmethod
def load(cls, path):

    s = open(path, 'rb').read()
    s = s.lstrip(codecs.BOM_UTF8)
    s = decode_utf8(s)
    a = {}
    v = {}
    for s in s.splitlines():
        if s.startswith('#'):
            a['description'] = ((a.get('description', '') + s.lstrip('#').strip()) + '\n')
        elif s.startswith('@name:'):
            a['name'] = s[(len('@name:') + 1):].replace('\\n', '\n')
        elif s.startswith('@type:'):
            a['type'] = s[(len('@type:') + 1):].replace('\\n', '\n')
        elif s.startswith('@language:'):
            a['lang'] = s[(len('@lang:') + 1):].replace('\\n', '\n')
        else:
            s = s.split('    ')
            (w, f) = ('    '.join(s[:(-1)]), s[(-1)])
            if f.isdigit():
                v[w] = int(f)
            else:
                v[w] = float(f)
    return cls(v, name=a.get('name'), type=a.get('type'), language=a.get('lang'), description=a.get('description').rstrip('\n'))
