<commit_before>'use strict';

var isString = require('lodash/isString');
var isArray = require('lodash/isArray');
var last = require('lodash/last');
var DOMImporter = require('substance/model/DOMImporter');
var XMLImporter = require('substance/model/XMLImporter');
var DefaultDOMElement = require('substance/ui/DefaultDOMElement');
var UnsupportedNodeJATSConverter = require('../unsupported/UnsupportedNodeJATSConverter');
var inBrowser = require('substance/util/inBrowser');

function JATSImporter(config) {
  JATSImporter.super.call(this, config);
  this.state = new JATSImporter.State();
}

JATSImporter.Prototype = function() {

  this.importDocument = function(xmlString) {
    this.reset();
    var xmlDoc = DefaultDOMElement.parseXML(xmlString, 'fullDoc');
    // HACK: server side impl gives an array
    var articleEl;
    if (inBrowser) {
      articleEl = xmlDoc.find('article');
    } else {
      // HACK: this should be more convenient
      for (var idx = 0; idx < xmlDoc.length; idx++) {
        if (xmlDoc[idx].tagName === 'article') {
          articleEl = xmlDoc[idx];
        }
      }
    }
    this.convertDocument(articleEl);
    var doc = this.generateDocument();
    return doc;
  };

  this.convertDocument = function(articleElement) {
    this.convertElement(articleElement);
  };

  this.convertElements = function(elements, startIdx, endIdx) {<commit_msg>Enable InlineWrappers.<commit_after>'use strict';

var isString = require('lodash/isString');
var isArray = require('lodash/isArray');
var last = require('lodash/last');
var DOMImporter = require('substance/model/DOMImporter');
var XMLImporter = require('substance/model/XMLImporter');
var DefaultDOMElement = require('substance/ui/DefaultDOMElement');
var UnsupportedNodeJATSConverter = require('../unsupported/UnsupportedNodeJATSConverter');
var inBrowser = require('substance/util/inBrowser');

function JATSImporter(config) {
  config.enableInlineWrapper = true;
  JATSImporter.super.call(this, config);
  this.state = new JATSImporter.State();
}

JATSImporter.Prototype = function() {

  this.importDocument = function(xmlString) {
    this.reset();
    var xmlDoc = DefaultDOMElement.parseXML(xmlString, 'fullDoc');
    // HACK: server side impl gives an array
    var articleEl;
    if (inBrowser) {
      articleEl = xmlDoc.find('article');
    } else {
      // HACK: this should be more convenient
      for (var idx = 0; idx < xmlDoc.length; idx++) {
        if (xmlDoc[idx].tagName === 'article') {
          articleEl = xmlDoc[idx];
        }
      }
    }
    this.convertDocument(articleEl);
    var doc = this.generateDocument();
    return doc;
  };

  this.convertDocument = function(articleElement) {
    this.convertElement(articleElement);
  };

  this.convertElements = function(elements, startIdx, endIdx) {
{'fraction_non_alphanumeric': 0.13219616204690832, 'fraction_numerical': 0.0007107320540156361, 'mean_word_length': 4.072072072072072, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, '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': '228351', 'n_tokens_mistral': 865, 'n_tokens_neox': 840, 'n_words': 177}