<commit_before>import {
  isFn
} from 'uni-shared'

import {
  invokeMethod,
  getCurrentPageVm
} from '../../platform'

import { CanvasContext } from '../context/canvas'
import { MapContext } from '../context/create-map-context'
import { VideoContext } from '../context/create-video-context'
import { EditorContext } from '../context/editor'

const ContextClasss = {
  canvas: CanvasContext,
  map: MapContext,
  video: VideoContext,
  editor: EditorContext
}

function convertContext (result) {
  if (result.context) {
    const { id, name, page } = result.context
    const ContextClass = ContextClasss[name]
    result.context = ContextClass && new ContextClass(id, page)
  }
}<commit_msg>fix: convertContext<commit_after>import {
  isFn
} from 'uni-shared'

import {
  invokeMethod,
  getCurrentPageVm
} from '../../platform'

import { CanvasContext } from '../context/canvas'
import { MapContext } from '../context/create-map-context'
import { VideoContext } from '../context/create-video-context'
import { EditorContext } from '../context/editor'

const ContextClasss = {
  canvas: CanvasContext,
  map: MapContext,
  video: VideoContext,
  editor: EditorContext
}

function convertContext (result) {
  if (result && result.context) {
    const { id, name, page } = result.context
    const ContextClass = ContextClasss[name]
    result.context = ContextClass && new ContextClass(id, page)
  }
}
{'fraction_non_alphanumeric': 0.13052781740370897, 'fraction_numerical': 0.0, 'mean_word_length': 3.9055944055944054, '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': '2487831', 'n_tokens_mistral': 418, 'n_tokens_neox': 418, 'n_words': 108}