<commit_before>package pman.bg;

import tannus.io.*;
import tannus.ds.*;
import tannus.sys.*;
import tannus.async.*;
import tannus.sys.Path;
import tannus.http.Url;

import pman.PManError;
import pman.bg.media.*;
import pman.bg.media.MediaSource;
import pman.bg.media.MediaRow;

import Slambda.fn;

using StringTools;
using tannus.ds.StringUtils;
using Slambda;
using tannus.ds.ArrayTools;
using tannus.FunctionTools;
using pman.bg.URITools;

class MediaTools {
    //public static function toMedia
}

class MediaRowTools {
    /**
      * convert a MediaRow to a Media object
      */
    //public static inline function toMedia(row: MediaRow):Media {
        //return new Media(MediaSourceTools.toMediaSource( row.uri ), row);
    //}
}

class MediaSourceTools {
    public static function toUri(src: MediaSource):String {
        return (switch ( src ) {
            case MSLocalPath( path ): ('file://' + path.toString());
            case MSUrl( url ): url;
        });
    }

    public static inline function toMedia(src: MediaSource):Media {
        return new Media( src );
    }

/* === Variables === */
}

@:access( pman.bg.URITools )
class UriTools {
    /**
      * convert a URI String into a Media instance
      */
    public static function toMedia(uri: String):Null<Media> {
        uri = uri.toUri();
        if (uri != null) {<commit_msg>exposed the mixin classes into the global scope<commit_after>package pman.bg;

import tannus.io.*;
import tannus.ds.*;
import tannus.sys.*;
import tannus.async.*;
import tannus.sys.Path;
import tannus.http.Url;

import pman.PManError;
import pman.bg.media.*;
import pman.bg.media.MediaSource;
import pman.bg.media.MediaRow;

import Slambda.fn;

using StringTools;
using tannus.ds.StringUtils;
using Slambda;
using tannus.ds.ArrayTools;
using tannus.FunctionTools;
using pman.bg.URITools;

class MediaTools {
    //public static function toMedia
}

class MediaRowTools {
    /**
      * convert a MediaRow to a Media object
      */
    //public static inline function toMedia(row: MediaRow):Media {
        //return new Media(MediaSourceTools.toMediaSource( row.uri ), row);
    //}
}

@:expose('MediaSourceTools')
class MediaSourceTools {
    public static function toUri(src: MediaSource):String {
        return (switch ( src ) {
            case MSLocalPath( path ): ('file://' + path.toString());
            case MSUrl( url ): url;
        });
    }

    public static inline function toMedia(src: MediaSource):Media {
        return new Media( src );
    }

/* === Variables === */
}

@:access( pman.bg.URITools )
@:expose('UriTools2')
class UriTools {
    /**
      * convert a URI String into a Media instance
      */
    public static function toMedia(uri: String):Null<Media> {
        uri = uri.toUri();
        if (uri != null) {
{'fraction_non_alphanumeric': 0.1270974651910032, 'fraction_numerical': 0.0003570153516601214, 'mean_word_length': 2.957627118644068, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6855706', 'n_tokens_mistral': 894, 'n_tokens_neox': 888, 'n_words': 237}