original_docstring: 
  	Separates the text contained in a _novel.json file into sub-paragraphs of desired length in a _preproc.json file.
  	It will try to preserve consistency by avoiding to merge different parts of the book and to cut sentences in the middle.
  	:param parser: The paragraph parser instance to use.
  	:param d_id: prefix to the _novel.json and _preproc.json files.
  	:param skip_begin: percent of the paragraphs to skip at the beginning of the book, to avoid non-relevant content
  	:param skip_end: percent of the paragraphs to skip at the end of the book, to avoid non-relevant content
  	:param verbose: 0 for silent execution, 1 for statistics and 2 for statistics and histogram of paragraphs sizes.
  	
docstring: Separates the text contained in a _novel.json file into sub-paragraphs of desired length in a _preproc.json file.
  It will try to preserve consistency by avoiding to merge different parts of the book and to cut sentences in the middle.
docstring_tokens: Separates the text contained in a _novel . json file into sub - paragraphs of desired length in a _preproc . json file . It will try to preserve consistency by avoiding to merge different parts of the book and to cut sentences in the middle .
code: def separate_in_paragraphs(parser: ParagraphParser, d_id: str = None, skip_begin=0.0, skip_end=0.0, verbose: int = 2):
  	"""
  	Separates the text contained in a _novel.json file into sub-paragraphs of desired length in a _preproc.json file.
  	It will try to preserve consistency by avoiding to merge different parts of the book and to cut sentences in the middle.
  	:param parser: The paragraph parser instance to use.
  	:param d_id: prefix to the _novel.json and _preproc.json files.
  	:param skip_begin: percent of the paragraphs to skip at the beginning of the book, to avoid non-relevant content
  	:param skip_end: percent of the paragraphs to skip at the end of the book, to avoid non-relevant content
  	:param verbose: 0 for silent execution, 1 for statistics and 2 for statistics and histogram of paragraphs sizes.
  	"""
  	# Input of file ID
  	if d_id is None:
  		while True:
  			d_id = input("Select a novel id: ")
  			if os.path.exists(NOVEL_PATH + d_id + NOVEL_SUFFIX):
  				break
  			print("ERROR - Id", d_id, "not found.")
  
  	# Reading JSON file
  	try:
  		data = json.load(open(NOVEL_PATH + d_id + NOVEL_SUFFIX, 'r'))
  	except UnicodeDecodeError:
  		data = json.load(open(NOVEL_PATH + d_id + NOVEL_SUFFIX, 'r', encoding='utf-8'))
  	# novel_data = data['novel']
  	novel_data = data
  	full_text = novel_data['text']
  
  	if verbose >= 1:
  		print("\n--- NOVEL DATA ---")
  		print("Title:\t", novel_data['title'])
  		print("Author:\t", novel_data['author'])
  		print("Theme:\t", novel_data['theme'])
  	paragraphs = parser(full_text, novel_data['persons'], novel_data['organisations'], novel_data['locations'],
  						novel_data['misc'], verbose)
  
  	len_par = len(paragraphs)
  	if skip_begin > 0:
  		n_skip_begin = int(len_par * skip_begin)
  		paragraphs = paragraphs[n_skip_begin:]
  	if skip_end > 0:
  		n_skip_end = int(len_par * skip_end)
  		paragraphs = paragraphs[:-n_skip_end]
  
  	if verbose >= 1:
  		print("Skipped", len_par - len(paragraphs), "paragraphs.")
  
  	# Saving JSON file
  	novel_data.pop('text')
  	novel_data.pop('persons')
  	novel_data.pop('organisations')
  	novel_data.pop('locations')
  	novel_data.pop('misc')
  	novel_data['paragraphs'] = paragraphs
  	json.dump(data, open(PREPROC_PATH + d_id + PREPROC_SUFFIX, 'w', encoding='utf-8'), ensure_ascii=False, indent=1)
code_tokens: def separate_in_paragraphs ( parser : ParagraphParser , d_id : str = None , skip_begin = 0.0 , skip_end = 0.0 , verbose : int = 2 ) : if d_id is None : while True : d_id = input ( "Select a novel id: " ) if os . path . exists ( NOVEL_PATH + d_id + NOVEL_SUFFIX ) : break print ( "ERROR - Id" , d_id , "not found." ) try : data = json . load ( open ( NOVEL_PATH + d_id + NOVEL_SUFFIX , 'r' ) ) except UnicodeDecodeError : data = json . load ( open ( NOVEL_PATH + d_id + NOVEL_SUFFIX , 'r' , encoding = 'utf-8' ) ) novel_data = data full_text = novel_data [ 'text' ] if verbose >= 1 : print ( "\n--- NOVEL DATA ---" ) print ( "Title:\t" , novel_data [ 'title' ] ) print ( "Author:\t" , novel_data [ 'author' ] ) print ( "Theme:\t" , novel_data [ 'theme' ] ) paragraphs = parser ( full_text , novel_data [ 'persons' ] , novel_data [ 'organisations' ] , novel_data [ 'locations' ] , novel_data [ 'misc' ] , verbose ) len_par = len ( paragraphs ) if skip_begin > 0 : n_skip_begin = int ( len_par * skip_begin ) paragraphs = paragraphs [ n_skip_begin : ] if skip_end > 0 : n_skip_end = int ( len_par * skip_end ) paragraphs = paragraphs [ : - n_skip_end ] if verbose >= 1 : print ( "Skipped" , len_par - len ( paragraphs ) , "paragraphs." ) novel_data . pop ( 'text' ) novel_data . pop ( 'persons' ) novel_data . pop ( 'organisations' ) novel_data . pop ( 'locations' ) novel_data . pop ( 'misc' ) novel_data [ 'paragraphs' ] = paragraphs json . dump ( data , open ( PREPROC_PATH + d_id + PREPROC_SUFFIX , 'w' , encoding = 'utf-8' ) , ensure_ascii = False , indent = 1 )
short_docstring: Separates the text contained in a _novel.json file into sub-paragraphs of desired length in a _preproc.json file.
short_docstring_tokens: Separates the text contained in a _novel . json file into sub - paragraphs of desired length in a _preproc . json file .
comment: """
  	Separates the text contained in a _novel.json file into sub-paragraphs of desired length in a _preproc.json file.
  	It will try to preserve consistency by avoiding to merge different parts of the book and to cut sentences in the middle.
  	:param parser: The paragraph parser instance to use.
  	:param d_id: prefix to the _novel.json and _preproc.json files.
  	:param skip_begin: percent of the paragraphs to skip at the beginning of the book, to avoid non-relevant content
  	:param skip_end: percent of the paragraphs to skip at the end of the book, to avoid non-relevant content
  	:param verbose: 0 for silent execution, 1 for statistics and 2 for statistics and histogram of paragraphs sizes.
  	"""$SEP$# Input of file ID$SEP$# Reading JSON file$SEP$# novel_data = data['novel']$SEP$# Saving JSON file