<commit_before>package generator.model.shapecontainer.shape.geometrics

import generator.model.shapecontainer.shape.geometrics.Alignment.VAlign
import generator.model.shapecontainer.shape.geometrics.Alignment.HAlign
import generator.model.style.Style
import generator.parser.Cache
import generator.parser.CommonParserMethods
import parser.IDtoOptionStyle

/**
 * Created by julian on 03.11.15.
 * representation of a description
 */
sealed class Description private (
    override val id: String,
    val style: Option[Style],
    val hAlign: Option[HAlign],
    val vAlign: Option[VAlign])
  extends TextBody

/**
 * Description
 */
object Description extends CommonParserMethods {

  /**
   * @param attrs Attributes
   * @param parentStyle Style instance
   * @param hierarchyContainer Cache instance
   * @return Description instance
   */
  def parse(attrs: (String, String), parentStyle: Option[Style], hierarchyContainer: Cache): Option[Description] = {
    implicit val cache = hierarchyContainer
    // mapping
    var hali: Option[HAlign] = None
    var vali: Option[VAlign] = None
    var styl: Option[Style] = Style.generateChildStyle(hierarchyContainer, parentStyle, attrs._1)
    var id: String = ""

    val attributes = attrs._2.split("\n")
    attributes.foreach { x =>
      if (x.matches("align\\s*\\((horizontal=)?(center|left|right),\\s*(vertical=)?(top|middle|bottom)\\)")) {
        hali = Alignment.parseHAlign("(center|right|left)".r.findFirstIn(x).get)
        vali = Alignment.parseVAlign("(top|middle|bottom)".r.findFirstIn(x).get)
      } else if (x.matches("id.*")) {
        id = parse(idAsString, x).get
      } else if (cache.styleHierarchy.contains(x)) {
        styl = Style.generateChildStyle(cache, styl, x)
      }
    }

    if (id != "") {
      Some(new Description(id, styl, hali, vali))
    } else {
      None
    }<commit_msg>remove unnecessary implicit from Description.scala<commit_after>package generator.model.shapecontainer.shape.geometrics

import generator.model.shapecontainer.shape.geometrics.Alignment.VAlign
import generator.model.shapecontainer.shape.geometrics.Alignment.HAlign
import generator.model.style.Style
import generator.parser.Cache
import generator.parser.CommonParserMethods

/**
 * Created by julian on 03.11.15.
 * representation of a description
 */
sealed class Description private (
    override val id: String,
    val style: Option[Style],
    val hAlign: Option[HAlign],
    val vAlign: Option[VAlign])
  extends TextBody

/**
 * Description
 */
object Description extends CommonParserMethods {

  /**
   * @param attrs Attributes
   * @param parentStyle Style instance
   * @param cache Cache instance
   * @return Description instance
   */
  def parse(attrs: (String, String), parentStyle: Option[Style], cache: Cache): Option[Description] = {
    // mapping
    var hali: Option[HAlign] = None
    var vali: Option[VAlign] = None
    var styl: Option[Style] = Style.generateChildStyle(cache, parentStyle, _root_.parser.IDtoOptionStyle(attrs._1)(cache))
    var id: String = ""

    val attributes = attrs._2.split("\n")
    attributes.foreach { x =>
      if (x.matches("align\\s*\\((horizontal=)?(center|left|right),\\s*(vertical=)?(top|middle|bottom)\\)")) {
        hali = Alignment.parseHAlign("(center|right|left)".r.findFirstIn(x).get)
        vali = Alignment.parseVAlign("(top|middle|bottom)".r.findFirstIn(x).get)
      } else if (x.matches("id.*")) {
        id = parse(idAsString, x).get
      } else if (cache.styleHierarchy.contains(x)) {
        styl = Style.generateChildStyle(cache, styl, _root_.parser.IDtoOptionStyle(x)(cache))
      }
    }

    if (id != "") {
      Some(new Description(id, styl, hali, vali))
    } else {
      None
    }
{'fraction_non_alphanumeric': 0.13228220203099947, 'fraction_numerical': 0.00427578834847675, 'mean_word_length': 3.7379746835443037, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5566529', 'n_tokens_mistral': 1135, 'n_tokens_neox': 1112, 'n_words': 248}