# Path: feet/utils/logger.py
# class LoggingMixin(object):
#     """
#     Mix in to classes that need their own logging object!
#     """
# 
#     @property
#     def logger(self):
#         """
#         Instantiates and returns a ServiceLogger instance
#         """
#         if not hasattr(self, '_logger') or not self._logger:
#             self._logger = ServiceLogger()
#         return self._logger
# 
# Path: feet/utils/decorators.py
# def timeit(func):
#     """
#     Returns the number of seconds that a function took along with the result
#     """
# 
#     @wraps(func)
#     def timer_wrapper(*args, **kwargs):
#         """
#         Inner function that uses the Timer context object
#         """
#         with Timer() as timer:
#             result = func(*args, **kwargs)
# 
#         return result, timer
# 
#     return timer_wrapper


from nltk import word_tokenize, sent_tokenize, ne_chunk, \
    RegexpParser, pos_tag
from nltk.tree import Tree
from collections import defaultdict
from langdetect import detect_langs
from jptools import JAParser
from feet.utils.logger import LoggingMixin
from feet.utils.decorators import timeit
import traceback
# -*- coding: utf8 -*-
# Parser class: provides NLP tools
#
# Author:   Romary Dupuis <romary.dupuis@altarika.com>
#
# Copyright (C) 2016 Romary Dupuis
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html


WORLD_2_NLTK = {
    'english': 'english',
    'en': 'english',
    'fr': 'french',
    'french': 'french',
    'ja': 'japanese',

# Path: feet/utils/logger.py
# class LoggingMixin(object):
#     """
#     Mix in to classes that need their own logging object!
#     """
# 
#     @property
#     def logger(self):
#         """
#         Instantiates and returns a ServiceLogger instance
#         """
#         if not hasattr(self, '_logger') or not self._logger:
#             self._logger = ServiceLogger()
#         return self._logger
# 
# Path: feet/utils/decorators.py
# def timeit(func):
#     """
#     Returns the number of seconds that a function took along with the result
#     """
# 
#     @wraps(func)
#     def timer_wrapper(*args, **kwargs):
#         """
#         Inner function that uses the Timer context object
#         """
#         with Timer() as timer:
#             result = func(*args, **kwargs)
# 
#         return result, timer
# 
#     return timer_wrapper


# Path: feet/entities/nlp.py
from nltk import word_tokenize, sent_tokenize, ne_chunk, \
    RegexpParser, pos_tag
from nltk.tree import Tree
from collections import defaultdict
from langdetect import detect_langs
from jptools import JAParser
from feet.utils.logger import LoggingMixin
from feet.utils.decorators import timeit
import traceback

# -*- coding: utf8 -*-
# Parser class: provides NLP tools
#
# Author:   Romary Dupuis <romary.dupuis@altarika.com>
#
# Copyright (C) 2016 Romary Dupuis
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html


WORLD_2_NLTK = {
    'english': 'english',
    'en': 'english',
    'fr': 'french',
    'french': 'french',
    'ja': 'japanese',

    'japanese': 'japanese'