[
    {
        "name": "ElmTextSearch",
        "comment": " A full text indexer written in Elm language inspired by lunr.js.\n\nA useful article about lunr.js\nhttps://www.new-bamboo.co.uk/blog/2013/02/26/full-text-search-in-your-browser/\n\n## Create Index\n@docs new\n@docs newWith\n\n## Modify Index\n@docs add\n@docs remove\n@docs update\n\n## Query Index\n@docs search\n\n## Types\n@docs Index\n@docs Config\n@docs SimpleConfig\n\n## Save and Load a Lunerlm Index\n\n* You can save an index using [`ElmTextSearch.Json.Encoder.encoder`](ElmTextSearch.Json.Encoder#encoder)\n* You can load a saved index using\n  [`ElmTextSearch.Json.Decoder.decoder`](ElmTextSearch.Json.Decoder#decoder)\n  to produce a [`IndexModel.CodecIndexRecord`](IndexModel#CodecIndexRecord).\n* You can save a [`IndexModel.CodecIndexRecord`](IndexModel#CodecIndexRecord)\n  using [`ElmTextSearch.Json.Encoder.codecIndexRecordEncoder`](ElmTextSearch.Json.Encoder#codecIndexRecordEncoder)\n* ** Modifying an index outside of ElmTextSearch using the Decoder and Encoder directly\nmay cause it to not work correctly loaded into ElmTextSearch. **\n\n@docs storeToValue\n@docs storeToString\n@docs fromString\n@docs fromValue\n@docs fromStringWith\n@docs fromValueWith\n\nCopyright (c) 2016 Robin Luiten\n",
        "unions": [],
        "aliases": [
            {
                "name": "Config",
                "comment": " A Config is used to create an Index. ",
                "args": [
                    "doc"
                ],
                "type": "Config doc"
            },
            {
                "name": "Index",
                "comment": " An Index holds the data to be able search for added documents.\n",
                "args": [
                    "doc"
                ],
                "type": "Index doc"
            },
            {
                "name": "SimpleConfig",
                "comment": " A SimpleConfig is the least amount of\nconfiguration data required to create an Index.\n",
                "args": [
                    "doc"
                ],
                "type": "{ ref : doc -> String, fields : List ( doc -> String, Float ) }"
            }
        ],
        "values": [
            {
                "name": "add",
                "comment": " Add a document to an index.\n\nStarting with the ElmTextSearch.new example above this adds a document.\n```\naddDocToIndexExample =\n    ElmTextSearch.add\n      { cid = \"id1\"\n      , title = \"First Title\"\n      , author = \"Some Author\"\n      , body = \"Words in this example document with explanations.\"\n      }\n      createNewWithIndexExample\n```\n\nConditions that cause a result Err with message.\n* Error document ref is empty.\n* Error after tokenisation there are no terms to index.\n* Error adding document that allready exists.\n",
                "type": "doc -> Index doc -> Result String (Index doc)"
            },
            {
                "name": "fromString",
                "comment": " Create an Index from a String which has a stored Index in it and the\nsupplied basic configurations.\n\nSee [`ElmTextSearch.fromStringWith`](ElmTextSearch#fromStringWith) for possible Err results.\n",
                "type": "SimpleConfig doc -> String -> Result String (Index doc)"
            },
            {
                "name": "fromStringWith",
                "comment": " Create an Index from a String which has a stored Index in it.\n\nIf none of the indexVersion in the list of Config match the index\ntype being loaded it will return an Err.\n\nThe list of configurations wil be searched for a matching indexType\nso you should provide configs for all types you may be trying to load.\nNo more than the config that matches is required though.\n\nIf the none of the supplied Config match the loaded Index then it\nwill try if the index being loaded matches the default version if so\nit will still load the index.\n\nThe following Err results may be returned.\n* \"Error cannot load Index. Tried to load index of type \\\"__IndexTest Type -\\\". It is not in supported index configurations.\"\n * It contains the loaded version index type which comes from input.\n* \"Error cannot load Index. Version supported is 1.0.0. Version tried to load is 1.0.1.\"\n * It includes both expected and loaded versions which may vary.\n\n",
                "type": "List (Config doc) -> String -> Result String (Index doc)"
            },
            {
                "name": "fromValue",
                "comment": " Create an Index from a Value which has a stored Index in it.\n\nSee [`ElmTextSearch.fromStringWith`](ElmTextSearch#fromStringWith) for possible Err results.\n",
                "type": "SimpleConfig doc -> Value -> Result String (Index doc)"
            },
            {
                "name": "fromValueWith",
                "comment": " Create an Index from a String which has a stored Index in it.\n\nIf none of the indexVersion in the list of SimpleConfig match the index\nbeing decoded it will return an Err.\n\nSee [`ElmTextSearch.fromStringWith`](ElmTextSearch#fromStringWith) for possible Err results.\n",
                "type": "List (Config doc) -> Value -> Result String (Index doc)"
            },
            {
                "name": "new",
                "comment": " Create new index.\n\nExample\n```\nimport ElmTextSearch\n\ntype alias ExampleDocType =\n    { cid : String\n    , title : String\n    , author : String\n    , body : String\n    }\n\n\ncreateNewIndexExample : ElmTextSearch.Index ExampleDocType\ncreateNewIndexExample =\n  ElmTextSearch.new\n    { ref = .cid\n    , fields =\n        [ ( .title, 5.0 )\n        , ( .body, 1.0 )\n        ]\n    }\n```\n\nThe `SimpleConfig` parameter to new is\n* ref\n * The unique document reference will be extracted from each\n   document using `.cid`.\n* fields\n * The following fields will be indexed from each document\n  * `.title`\n  * `.body`\n * When searching the index any word matches found in the\n   `.title` field (boost value 5.0) raise the document match score\n   more than if found in the `.body` field (boost value 1.0).\n  * The document match score determines the order of the list\n    of matching documents returned.\n\n",
                "type": "SimpleConfig doc -> Index doc"
            },
            {
                "name": "newWith",
                "comment": " Create new index with additional configuration.\n\nExample.\n```\nimport ElmTextSearch\nimport IndexDefaults\nimport StopWordFilter\n\n\ntype alias ExampleDocType =\n    { cid : String\n    , title : String\n    , author : String\n    , body : String\n    }\n\n\ncreateMyStopWordFilter =\n    StopWordFilter.createFilterFuncWith\n      [ \"explanations\" ]\n\n\ncreateNewWithIndexExample : ElmTextSearch.Index ExampleDocType\ncreateNewWithIndexExample =\n  ElmTextSearch.newWith\n    { indexType = \"ElmTextSearch - Customized Stop Words v1\"\n    , ref = .cid\n    , fields =\n        [ ( .title, 5.0 )\n        , ( .body, 1.0 )\n        ]\n    , transformFactories = IndexDefaults.defaultTransformFactories\n    , filterFactories = [ createMyStopWordFilter ]\n    }\n```\n\n",
                "type": "Config doc -> Index doc"
            },
            {
                "name": "remove",
                "comment": " Remove a document from an index.\n\nStarting with the ElmTextSearch.new example above this removes a document.\n```\nremoveDocFromIndexExample =\n    ElmTextSearch.remove\n      { cid = \"123\"\n      , title = \"Examples of a Banana\"\n      , author = \"Sally Apples\"\n      , body = \"Sally writes words about a banana.\"\n      }\n      createNewIndexExample\n```\n\nConditions that cause a result Err with message.\n* Error document has an empty unique id (ref).\n* Error document is not in index.\n",
                "type": "doc -> Index doc -> Result String (Index doc)"
            },
            {
                "name": "search",
                "comment": " Search an index with query.\n\nTokens are extracted from the query string and passed through the\nsame processing used when indexing documents.\n\nEach token is expanded, so that the term \"he\" might be expanded to \"hello\"\nand \"help\" if those terms were already included in the document index.\n\nMultiple tokens are allowed and will lead to an AND based query.\n\nThe following example runs a search for documents containing both \"apple\" and \"banana\".\n\n```\nsearchResult =\n    Index.search \"Apple banana\" createNewIndexExample\n```\n\nResults are a list of matching document reference identifiers with\nthere similarity to query score, ordered by score descending, so the\nbest matches are earliest in the list.\n\nAn index is returned from search as well. This is because the data model may\nbe updated to improve performance for later searches.\n\nAdding or removing a new document will cause some of the internal caching\nto be reset.\n\nConditions that cause a result Err with message.\n* Error there are no documents in index to search.\n* Error query is empty.\n* Error after tokenisation there are no terms to search for.\n\n",
                "type": "String -> Index doc -> Result String ( Index doc, List ( String, Float ) )"
            },
            {
                "name": "storeToString",
                "comment": " Store an index to a String.\n\nYou can also use [`ElmTextSearch.Json.Encoder`](ElmTextSearch.Json.Encoder).\n",
                "type": "Index doc -> String"
            },
            {
                "name": "storeToValue",
                "comment": " Store an index to a Value.\n\nYou can also use [`ElmTextSearch.Json.Encoder`](ElmTextSearch.Json.Encoder).\n",
                "type": "Index doc -> Value"
            },
            {
                "name": "update",
                "comment": " Update a document in an index.\n\nStarting with the ElmTextSearch.new example above this updates a document.\n```\n    updatedIndex =\n      ElmTextSearch.update\n        { cid = \"123\"\n        , title = \"Examples of a Bananas in every day life.\"\n        , author = \"Sally Apples\"\n        , body = \"Sally writes more words about a banana.\"\n        }\n        createNewIndexExample\n```\n\nConditions that cause an error result are those for\n[`ElmTextSearch.remove`](ElmTextSearch#remove) and\n[`ElmTextSearch.add`](ElmTextSearch#add).\n\n",
                "type": "doc -> Index doc -> Result String (Index doc)"
            }
        ],
        "binops": []
    },
    {
        "name": "ElmTextSearch.Json.Encoder",
        "comment": " Encoder for Index.\n\n@docs encoder\n@docs codecIndexRecordEncoder\n\nCopyright (c) 2016 Robin Luiten\n",
        "unions": [],
        "aliases": [],
        "values": [
            {
                "name": "codecIndexRecordEncoder",
                "comment": " Encode CodecIndexRecord. ",
                "type": "CodecIndexRecord -> Value"
            },
            {
                "name": "encoder",
                "comment": " Encoder for Index a.\n\nOnly encoding fields required to recreate a working index.\n\nThe following fields are not saved as they are restored via\nthe provided Config on fromString.\n* ref\n* fields\n* transformFactories\n* filterFactories\n\nThe following fields are not saved because they are an\nacceleration model, decoder needs to set it on fromString.\n* corpusTokensIndex\n\nThe following fields are not saved because they are caches\nand are cached as operationg requires\n* transforms\n* filters\n* idfCache\n\nDo not need an (a -> Encode.Value) because a is a document\ntype and that is never encoded from an Index.\n",
                "type": "Index doc -> Value"
            }
        ],
        "binops": []
    },
    {
        "name": "IndexDefaults",
        "comment": " Defaults for indexes and configurations.\n\n## Index Storage Engine Version and Type\n@docs indexVersion\n@docs elmTextSearchIndexType\n\n\n## Built in Transforms and Filters\n@docs defaultTransformFactories\n@docs defaultFilterFactories\n@docs defaultTokenTrimmerFuncCreator\n@docs defaultStemmerFuncCreator\n@docs defaultStopWordFilterFuncCreator\n\n\n## Config type adapters\n@docs getDefaultIndexConfig\n\nCopyright (c) 2016 Robin Luiten\n",
        "unions": [],
        "aliases": [],
        "values": [
            {
                "name": "defaultFilterFactories",
                "comment": " Index default filter factories. ",
                "type": "List (FilterFactory doc)"
            },
            {
                "name": "defaultStemmerFuncCreator",
                "comment": " The default token stemmer transform function creator. ",
                "type": "TransformFactory doc"
            },
            {
                "name": "defaultStopWordFilterFuncCreator",
                "comment": " The default stop word filter function creator. ",
                "type": "FilterFactory doc"
            },
            {
                "name": "defaultTokenTrimmerFuncCreator",
                "comment": " The default token trimmer transform function creator.\nNormally applied first in transform functions.\n",
                "type": "TransformFactory doc"
            },
            {
                "name": "defaultTransformFactories",
                "comment": " Index default transform factories. ",
                "type": "List (TransformFactory doc)"
            },
            {
                "name": "elmTextSearchIndexType",
                "comment": " The type of index defaults to using.\n\nIt defines the default token transforms and filters.\n",
                "type": "String"
            },
            {
                "name": "getDefaultIndexConfig",
                "comment": " Convert IndexModel.SimpleConfig to IndexModel.Config\n\nFilling in default values for fields not in SimpleConfig\n\nThis is the definition of the default index configuration.\n",
                "type": "SimpleConfig doc -> Config doc"
            },
            {
                "name": "indexVersion",
                "comment": " The version of index, for loading a saved index.\n\nThis is not the same as package version.\n\nThis needs to change if the encoded format changes. Be careful of updates to\nTrie package, if Trie encoding format changes this version needs to change as\nwell.\n",
                "type": "String"
            }
        ],
        "binops": []
    },
    {
        "name": "ElmTextSearch.Json.Decoder",
        "comment": " Decoder for Index.\n\nIt decodes to a CodecIndexRecord.\n\n@docs decoder\n\nCopyright (c) 2016 Robin Luiten\n",
        "unions": [],
        "aliases": [],
        "values": [
            {
                "name": "decoder",
                "comment": " CodecIndexRecord decoder. ",
                "type": "Decoder CodecIndexRecord"
            }
        ],
        "binops": []
    },
    {
        "name": "StopWordFilter",
        "comment": " StopWordFilter is an English language stop word list filter, any words\ncontained in the list are not stored in the index.\n\nThis is intended to be used in the ElmTextSearch token processing pipeline.\n\n### Things to know about stop word lists.\n* Input tokens to create stop word filters should be full words, if you\ndont know the transform steps for index or if you use the list with different\nsets of transforms.\n* If you know the exact transform process of your Index you can prerun the\ntransform process to generate your word list, which in theory might\nmake it a little more efficient.\n* It is more efficient to merge all your stop words into a single\nstop word filter.\n\n## create default stop word filter func\n@docs createDefaultFilterFunc\n\n## A default stop word english filter list\n@docs stopEnglishWordList\n\n## Create a custom stop word filter list\n@docs createFilterFuncWith\n@docs createFilterFunc\n\nCopyright (c) 2016 Robin Luiten\n",
        "unions": [],
        "aliases": [],
        "values": [
            {
                "name": "createDefaultFilterFunc",
                "comment": " Default english stop word filter suitable for ElmTextSearch.\n",
                "type": "FilterFactory doc"
            },
            {
                "name": "createFilterFunc",
                "comment": " Create stop word filter for provided list of tokens suitable for ElmTextSearch.\n\n** This creates a stop world filter purely from your own word list, understand\nwhat you are doing and consequences if you use this. **\n\nThe FilterFunc created returns True to allow words into index.\nSo words found in the stopWordList return False\n",
                "type": "List String -> FilterFactory doc"
            },
            {
                "name": "createFilterFuncWith",
                "comment": " Create stop word list filter suitable for ElmTextSearch, this versions\nextends the default word list with the extra words provided.\n",
                "type": "List String -> FilterFactory doc"
            },
            {
                "name": "stopEnglishWordList",
                "comment": " Default english stop word list to create filter.\n",
                "type": "List String"
            }
        ],
        "binops": []
    }
]