Skip to content

Commit

Permalink
Merge pull request #32 from SekouDiaoNlp/dev
Browse files Browse the repository at this point in the history
Prototype of LexItem saving on hard drives.
  • Loading branch information
SekouDiaoNlp committed Apr 30, 2021
2 parents 9cd2b6f + 87f00cb commit 7e811bc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Usage
=====

.. NOTE:: The language of the lexical entries is French.
| The cLexical Corpus is based on `Lexique383`_.
| Also note that pylexique only works on Python 3.X
The cLexical Corpus is based on `Lexique383`_.
Also note that pylexique only works on Python 3.X.


To use pylexique from the command line:
Expand Down
3 changes: 2 additions & 1 deletion pylexique/pylexique.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
from collections import OrderedDict, defaultdict
import pkg_resources

from dataclasses import asdict, dataclass, astuple
from dataclasses import dataclass
from typing import ClassVar
from time import time
from .utils import set_save_folder

_RESOURCE_PACKAGE = __name__

Expand Down
15 changes: 15 additions & 0 deletions pylexique/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@
from types import FunctionType


def set_save_folder(folder):
"""
Sets the folder in which lyrics will be downloaded and saved.
:param folder: string.
Folder path.
:return: string.
Folder path.
"""
if not folder:
folder = os.path.join(os.path.expanduser("~"), 'Documents', 'pylexique')
else:
folder = os.path.join(folder, 'pylexique')
return folder

def attributes(obj):
disallowed_names = {
name for name, value in getmembers(type(obj))
Expand Down

0 comments on commit 7e811bc

Please sign in to comment.