textstat/resources/TextStat.py
def termInDocsProfile(docsprofiles):
   """Returns a profile with terms and number of documents in which the term
      occurs as a key value pair in a dicitionary data structure.
      
      Parameter:
      
      docsprofiles: list with
      a. frequency profiles for documents (dictionary data structure), or
      b. lists or tuples with document tokens
      c. set of document tokens
      """
   mycount = Counter()
   for doc in docsprofiles:
      if type(doc) == type(dict):
         mycount.update(doc.items())
      elif type(doc) == type([]) or type(doc) == type(tuple()):
         mycount.update(set(doc))
      elif type(doc) == type(set()):
         mycount.update(doc)
      else:
         return None
   return dict(mycount)
Returns a profile with terms and number of documents in which the term
      occurs as a key value pair in a dicitionary data structure.
      
      Parameter:
      
      docsprofiles: list with
      a. frequency profiles for documents (dictionary data structure), or
      b. lists or tuples with document tokens
      c. set of document tokens
      
Returns a profile with terms and number of documents in which the term
occurs as a key value pair in a dicitionary data structure.



list with
a. frequency profiles for documents (dictionary data structure), or
b. lists or tuples with document tokens
c. set of document tokens
Returns a profile with terms and number of documents in which the term occurs as a key value pair in a dicitionary data structure . list with a . frequency profiles for documents ( dictionary data structure ) or b . lists or tuples with document tokens c . set of document tokens
def termInDocsProfile(docsprofiles):
   mycount = Counter()
   for doc in docsprofiles:
      if type(doc) == type(dict):
         mycount.update(doc.items())
      elif type(doc) == type([]) or type(doc) == type(tuple()):
         mycount.update(set(doc))
      elif type(doc) == type(set()):
         mycount.update(doc)
      else:
         return None
   return dict(mycount)
def termInDocsProfile ( docsprofiles ) : mycount = Counter ( ) for doc in docsprofiles : if type ( doc ) == type ( dict ) : mycount . update ( doc . items ( ) ) elif type ( doc ) == type ( [ ] ) or type ( doc ) == type ( tuple ( ) ) : mycount . update ( set ( doc ) ) elif type ( doc ) == type ( set ( ) ) : mycount . update ( doc ) else : return None return dict ( mycount )
Returns a profile with terms and number of documents in which the term
occurs as a key value pair in a dicitionary data structure.
Returns a profile with terms and number of documents in which the term occurs as a key value pair in a dicitionary data structure .
"""Returns a profile with terms and number of documents in which the term
      occurs as a key value pair in a dicitionary data structure.
      
      Parameter:
      
      docsprofiles: list with
      a. frequency profiles for documents (dictionary data structure), or
      b. lists or tuples with document tokens
      c. set of document tokens
      """
docsprofiles