<commit_before>package viscel.narration.narrators

import viscel.narration.NarratorADT
import viscel.narration.Queries._
import viscel.narration.Templates.{SimpleForward, archivePage}
import viscel.selektiv.Narration._
import viscel.selektiv.ReportTools._
import viscel.selektiv.Selection
import viscel.shared.Vid
import viscel.store.v4.DataRow

import scala.collection.immutable.Set

object Individual {


  val Inverloch = NarratorADT(
    Vid.from("NX_Inverloch"), "Inverloch",
    Range.inclusive(1, 5)
      .map(i => DataRow.Link(s"http://inverloch.seraph-inn.com/volume$i.html",
                     "archive" :: Nil)).toList,
    Condition(ContextW.map(_.context.exists("archive" == _)), {
      Selection.many("#main p:containsOwn(Chapter)").focus {
        Append(
          ElementW.map(chap => DataRow.Chapter(chap.ownText()) :: Nil),
          Selection.many("a").wrapEach(extractMore))
      }
    }, {
      Condition(ContextW.map {_.location.endsWith("summaries.html")},
                Constant(Nil),
                queryImageNext("#main > p:nth-child(1) > img",
                               "#main a:containsOwn(Next)"))
    }))

  val UnlikeMinerva = NarratorADT(
    Vid.from("NX_UnlikeMinerva"),
    "Unlike Minerva",
    Range.inclusive(1, 25).map(i => DataRow.Link(s"http://www.unlikeminerva.com/archive/phase1.php?week=$i")).toList :::
    Range.inclusive(26, 130).map(i => DataRow.Link(s"http://www.unlikeminerva.com/archive/index.php?week=$i")).toList,

    Selection.many("center > img[src~=/archive/]")
    .wrapEach { img =>
      val article = extractArticle(img)
      val txt = extract(img.parent().nextElementSibling().text())
      article.copy(data = article.data ::: List("title", txt))
    })


  val inlineCores = Set[NarratorADT](
    archivePage("NX_StandStillStaySilent", "Stand Still Stay Silent", "http://www.sssscomic.com/?id=archive",
      Focus(
        Selection.many("div[id~=adv\\d+Div]").wrap{advs => advs.reverse },
        queryMixedArchive("div.archivediv h2, div.archivediv a")
        ),
      queryImage("img.comicnormal")),
    SimpleForward("NX_xkcd", "xkcd", "http://xkcd.com/1/", {
      // xkcd requires to sometimes ignore images, which is why all is used here<commit_msg>remove Inverloch Individual<commit_after>package viscel.narration.narrators

import viscel.narration.NarratorADT
import viscel.narration.Queries._
import viscel.narration.Templates.{SimpleForward, archivePage}
import viscel.selektiv.Narration._
import viscel.selektiv.ReportTools._
import viscel.selektiv.Selection
import viscel.shared.Vid
import viscel.store.v4.DataRow

import scala.collection.immutable.Set

object Individual {

  val UnlikeMinerva = NarratorADT(
    Vid.from("NX_UnlikeMinerva"),
    "Unlike Minerva",
    Range.inclusive(1, 25).map(i => DataRow.Link(s"http://www.unlikeminerva.com/archive/phase1.php?week=$i")).toList :::
    Range.inclusive(26, 130).map(i => DataRow.Link(s"http://www.unlikeminerva.com/archive/index.php?week=$i")).toList,

    Selection.many("center > img[src~=/archive/]")
    .wrapEach { img =>
      val article = extractArticle(img)
      val txt = extract(img.parent().nextElementSibling().text())
      article.copy(data = article.data ::: List("title", txt))
    })


  val inlineCores = Set[NarratorADT](
    archivePage("NX_StandStillStaySilent", "Stand Still Stay Silent", "http://www.sssscomic.com/?id=archive",
      Focus(
        Selection.many("div[id~=adv\\d+Div]").wrap{advs => advs.reverse },
        queryMixedArchive("div.archivediv h2, div.archivediv a")
        ),
      queryImage("img.comicnormal")),
    SimpleForward("NX_xkcd", "xkcd", "http://xkcd.com/1/", {
      // xkcd requires to sometimes ignore images, which is why all is used here
{'fraction_non_alphanumeric': 0.15460614152202937, 'fraction_numerical': 0.007209612817089452, 'mean_word_length': 3.6708229426433916, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '529315', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1275, 'n_words': 192}