<commit_before># Natural Language Toolkit: Wordnet Interface: Graphical Wordnet Browser
#
# Copyright (C) 2007 - 2008 NLTK Project
# Author: <NAME> <<EMAIL>>
#         <NAME> <<EMAIL>>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT


from urllib import quote_plus, unquote_plus
import itertools as it
import cPickle
import base64

from nltk import defaultdict
from nltk.corpus import wordnet
from nltk.internals import deprecated

__all__ = ['get_static_index_page',
           'get_static_page_by_path',
           'page_from_word',
           'page_from_href']

"""
WordNet Browser Utilities.

This provides a backend to both wxbrowse and browserver.py.
"""


#
# TODO: The following issues exist with this module, and should
# ideally be fixed.  These line numbers have changed since these items
# where recorded.
#
# All through: SHOULD add docstrings.
# Line 29: Some or all of relations_2 SHOULD be moved to synst.py
# Line 343: MAY re-write expression so that it's more readable.
# Line 395: MAY rewrite this and previous statment.
#           to avoid creating serperflous "<i>/</i>"
# Line 454: MAY replace lambda expression with 'first'.
# Line 695: MAY rewrite expression to build string so that it is more readable.
#
<commit_msg>Use defautdict from collections rather than nltk.<commit_after># Natural Language Toolkit: Wordnet Interface: Graphical Wordnet Browser
#
# Copyright (C) 2007 - 2008 NLTK Project
# Author: <NAME> <<EMAIL>>
#         <NAME> <<EMAIL>>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT


from urllib import quote_plus, unquote_plus
import itertools as it
import cPickle
import base64

from collections import defaultdict
from nltk.corpus import wordnet
from nltk.internals import deprecated

__all__ = ['get_static_index_page',
           'get_static_page_by_path',
           'page_from_word',
           'page_from_href']

"""
WordNet Browser Utilities.

This provides a backend to both wxbrowse and browserver.py.
"""


#
# TODO: The following issues exist with this module, and should
# ideally be fixed.  These line numbers have changed since these items
# where recorded.
#
# All through: SHOULD add docstrings.
# Line 29: Some or all of relations_2 SHOULD be moved to synst.py
# Line 343: MAY re-write expression so that it's more readable.
# Line 395: MAY rewrite this and previous statment.
#           to avoid creating serperflous "<i>/</i>"
# Line 454: MAY replace lambda expression with 'first'.
# Line 695: MAY rewrite expression to build string so that it is more readable.
#

{'fraction_non_alphanumeric': 0.08259015122140365, 'fraction_numerical': 0.019387359441644048, 'mean_word_length': 3.8863636363636362, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5654790', 'n_tokens_mistral': 841, 'n_tokens_neox': 756, 'n_words': 314}