<commit_before>import { handleFootnotes } from './handleFootnotes'
import { DocumentNode } from '../SyntaxNodes/DocumentNode'
import { HeadingLeveler } from './Outline/HeadingLeveler'
import { getOutlineNodes } from './Outline/getOutlineNodes'
import { INPUT_LINE_BREAK } from './Strings'
import { UpConfig } from '../UpConfig'


export function parseDocument(text: string, config: UpConfig): DocumentNode {
  const lines = text.split(INPUT_LINE_BREAK)
  const outlineNodes = getOutlineNodes(lines, new HeadingLeveler(), config)

  const documentNode = new DocumentNode(outlineNodes)
  handleFootnotes(documentNode)

  return documentNode
}<commit_msg>Rename some local variables in parseDocument<commit_after>import { handleFootnotes } from './handleFootnotes'
import { DocumentNode } from '../SyntaxNodes/DocumentNode'
import { HeadingLeveler } from './Outline/HeadingLeveler'
import { getOutlineNodes } from './Outline/getOutlineNodes'
import { INPUT_LINE_BREAK } from './Strings'
import { UpConfig } from '../UpConfig'


export function parseDocument(text: string, config: UpConfig): DocumentNode {
  const documentLines = text.split(INPUT_LINE_BREAK)
  const documentChildren = getOutlineNodes(documentLines, new HeadingLeveler(), config)

  const documentNode = new DocumentNode(documentChildren)
  handleFootnotes(documentNode)

  return documentNode
}
{'fraction_non_alphanumeric': 0.10007358351729213, 'fraction_numerical': 0.0, 'mean_word_length': 5.938775510204081, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3685289', 'n_tokens_mistral': 383, 'n_tokens_neox': 371, 'n_words': 99}