Sistema de Consulta Abierta
Sistema de consulta abierta con módulo de análisis semántico
 Todo Clases Namespaces Funciones Variables Páginas
Funciones | Variables
Referencia del Namespace vsm.split

Funciones

def split_corpus
 
def mp_split_ls
 
def split_documents
 

Variables

list __all__ = ['split_corpus', 'mp_split_ls', 'split_documents']
 

Descripción detallada

Functions for splitting lists and arrays

Documentación de las funciones

def vsm.split.mp_split_ls (   ls,
  n 
)
Split list into an `n`-length list of arrays.

:param ls: List to be split.
:type ls: list

:param n: Number of splits.
:type n: int

:returns: List of arrays whose length is 'n'.

**Examples**
>>> ls = [1,5,6,8,2,8]
>>> mp_split_ls(ls, 4)
[array([1, 5]), array([6, 8]), array([2]), array([8])]
def vsm.split.split_corpus (   arr,
  indices 
)
Splits the given array by the indices into list of sub-arrays.

:param arr: An array to be split.
:type arr: array
:param indices: 1-dimensional array of integers that indicates 
    where the array is split.
:type indices: array
   
:returns: A list of sub-arrays split at the indices.
   
**Examples**

>>> arr = np.arange(8)
>>> indices = np.array([2,4,7])
>>> split_corpus(arr, indices)
[array([0,1]), array([2,3]), array([4,5,6]), array([7])]
def vsm.split.split_documents (   corpus,
  indices,
  n_partitions 
)