<commit_before># XML Schema

`XmlSchema` gem is a simple convertor utility for XML Schema (literal) datatypes to/from native Ruby objects.

# Usage

    $ require "xml_schema"

    $ XmlSchema.datatype_of(true)  # => #<URI::HTTP:0x00000000dcff78 URL:http://www.w3.org/2001/XMLSchema#boolean>
    $ XmlSchema.datatype_of(Time.now)  # => #<URI::HTTP:0x00000000dcff78 URL:http://www.w3.org/2001/XMLSchema#time>

    $ XmlSchema.instantiate("55^^<http://www.w3.org/2001/XMLSchema#int>")  # => 55

XmlSchema also provides means to access and work with frequently used namespaces:

    $ NS::OWL.uri  # => #<URI::HTTP:0x00000000dcff78 URL:http://www.w3.org/2002/07/owl>
    $ NS::RDFS["hello"]  # => #<URI::HTTP:0x00000000dcff78 URL:http://www.w3.org/2000/01/rdf-schema#hello>

That's pretty much all there is to it.

# Authors

- [<NAME>](https://github.com/cordawyn)<commit_msg>added info on LocalizedString to README<commit_after># XML Schema

`XmlSchema` gem is a simple convertor utility for XML Schema (literal) datatypes to/from native Ruby objects.


# Usage

    $ require "xml_schema"

    $ XmlSchema.datatype_of(true)  # => #<URI::HTTP:0x00000000dcff78 URL:http://www.w3.org/2001/XMLSchema#boolean>
    $ XmlSchema.datatype_of(Time.now)  # => #<URI::HTTP:0x00000000dcff78 URL:http://www.w3.org/2001/XMLSchema#time>

    $ XmlSchema.instantiate("55^^<http://www.w3.org/2001/XMLSchema#int>")  # => 55

XmlSchema also provides means to access and work with frequently used namespaces:

    $ NS::OWL.uri  # => #<URI::HTTP:0x00000000dcff78 URL:http://www.w3.org/2002/07/owl>
    $ NS::RDFS["hello"]  # => #<URI::HTTP:0x00000000dcff78 URL:http://www.w3.org/2000/01/rdf-schema#hello>

That's pretty much all there is to it.


# Extras

This gem introduces LocalizedString to handle localized string literals.

    $ s = LocalizedString.new("hello", :en)
    $ s.lang  # => :en
    $ XMLSchema.instantiate("hello@en")  # => <LocalizedString: "hello">

When compared to a String object, language is ignored and only the string content is compared.
When compared to another LocalizedString, languages are also compared.

You can also initialize a LocalizedString as follows:

    $ "bonjour".with_lang(:fr)  # => "bonjour"


# Authors

- [<NAME>](https://github.com/cordawyn)
{'fraction_non_alphanumeric': 0.14920774647887325, 'fraction_numerical': 0.06778169014084508, 'mean_word_length': 4.3107476635514015, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 29, 'https://': 2, 'lorem ipsum': 0, 'www.': 10, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 8, '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': '2154745', 'n_tokens_mistral': 919, 'n_tokens_neox': 783, 'n_words': 173}