{"id":13730285,"url":"https://github.com/Hapaxia/Apris","last_synced_at":"2025-05-08T02:32:13.862Z","repository":{"id":82620178,"uuid":"225986175","full_name":"Hapaxia/Apris","owner":"Hapaxia","description":"String processor using banks and alternatives","archived":false,"fork":false,"pushed_at":"2024-01-22T20:36:18.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-14T21:37:54.853Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hapaxia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-05T00:59:20.000Z","updated_at":"2022-10-26T00:08:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"97233805-c661-4b8c-9926-5ae0f87581d9","html_url":"https://github.com/Hapaxia/Apris","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hapaxia%2FApris","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hapaxia%2FApris/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hapaxia%2FApris/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hapaxia%2FApris/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hapaxia","download_url":"https://codeload.github.com/Hapaxia/Apris/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252986931,"owners_count":21836259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T02:01:12.780Z","updated_at":"2025-05-08T02:32:13.622Z","avatar_url":"https://github.com/Hapaxia.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"\n# Apris\n\n## Information\n \nApris is a string processor.\n\nIt allows insertion of sub-strings within a string using control codes. Sets (banks) of sub-strings can stored and the string can be processed whichever bank is required at the time.\n\nControl codes are integer values but a string can also be mapped to those integers to allow more readable strings.\n\nControl sub-strings can also be capitalised automatically using coded values.\n\nIt also allows alternatives directly contained within the string itself. Which alternative to use can be set per bank or on a global level (and changed easily at any time as required).\n\n## Examples\n\n### A very basic example\n\n`\"You hit your enemy with your $1$.\"`\nIf there are three banks, each with just one string, this could have three different outputs.  \nIf bank 1 had `\"axe\"`, bank 2 had `\"sword\"`, bank 3 had `\"fist\"`, the results would be:  \n`\"You hit your enemy with your axe.\"`  \n`\"You hit your enemy with your sword.\"`  \n`\"You hit your enemy with your fist.\"`\n\n### A basic but more clear example\n\nAssume exactly the same banks as before in the very basic example but this time we have set up a string mapped to the control: `\"weapon\"` is mapped to 1.  \nInstead, the string we can use would be:  \n`\"You hit your enemy with your $weapon$.\" ` \nand the three results would again be:  \n`\"You hit your enemy with your axe.\"`  \n`\"You hit your enemy with your sword.\"`  \n`\"You hit your enemy with your fist.\"`\n\n### A useful example\n\nOne common time when replacement of certain parts of a string (words in this case) is required, especially in story text, is when gender is referenced.  \nUsing a bank per gender, we can simply choose which bank to use for the gender. That way, we can write only one string that covers all.  \nFor a 'cover most' example, we can use 3 banks: male, female and neutral. Obviously more can added if necessary.  \nWe need 4 words per bank to cover common pronouns:  \n`\"he\"`, `\"him\"`, `\"his\"`, `\"his\"`  \n`\"she\"`, `\"her\"`, `\"her\"`, `\"hers\"`  \n`\"they\"`, `\"them\"`, `\"their\"`, `\"theirs\"`  \nWe can then just the control values to write a sentence:  \n`\"Any time $1$ want^s^, $1$ can get $3$ thing back to $2$ from me.\"`  \nGives:  \nMALE: `\"Any time he wants, he can get his thing back to him from me.\"`  \nFEMALE: `\"Any time she wants, she can get her thing back to her from me.\"`  \nNEUTRAL: `\"Any time they want, they can get their thing back to them from me.\"`  \nIt's also possible to use control mapping to allow you to write the based on one gender and get the same results:  \n`\"Any time $he$ want^s^, $he$ can get $his$ thing back to $him$ from me.\\n\"`  \nYou can, of course, which gender you prefer to use as the basis; you can set up the control maps however you like.\n\n### A more thorough example\n\nSticking with the gender banks above, we can add in capitalisation processing that allows us to force one of the words to be capitalised using any locale.  \nWhen using values for the codes, you can simply make that value its negative equivalent to make it capitalise that string.  \nWhen using control-mapped strings, you can prefix (inside the control limiters) that string with the capital control character. This removes any capitalisation of the sub-string before processing and then forces capitalisation when adding the final string.\n\nHere's a more full (but still quite nonsensical) example:  \n`\"$_He$ told me that $he$ want^s^ the thing if you would allow $him$ to have it.\"`  \n`\"Any time $he$ want^s^, $he$ can get $his$ thing back to $him$ from me.\"`  \n`\"$_He$ ^is|are^ very happy because it is $his_$. $_He$ should get it back $him$self.\"`  \nGives:  \n**MALE**\n`\"He told me that he wants the thing if you would allow him to have it.\"`  \n`\"Any time he wants, he can get his thing back to him from me.\"`  \n`\"He is very happy because it is his. He should get it back himself.\"`  \n**FEMALE**\n`\"She told me that she wants the thing if you would allow her to have it.\"`  \n`\"Any time she wants, she can get her thing back to her from me.\"`  \n`\"She is very happy because it is hers. She should get it back herself.\"`  \n**NEUTRAL**\n`\"They told me that they want the thing if you would allow them to have it.\"`  \n`\"Any time they want, they can get their thing back to them from me.\"`  \n`\"They are very happy because it is theirs. They should get it back themself.\"`  \nNote that because there are two versions of \"his\", for the second control mapped version, we've added an underline to distinguish the difference.  \nThe underline at the beginning, however, is the capitalisation character.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHapaxia%2FApris","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHapaxia%2FApris","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHapaxia%2FApris/lists"}