{"id":2315,"date":"2021-02-14T09:11:39","date_gmt":"2021-02-14T03:41:39","guid":{"rendered":"https:\/\/www.rangakrish.com\/?p=2315"},"modified":"2021-02-14T09:23:51","modified_gmt":"2021-02-14T03:53:51","slug":"litedb-a-nosql-database-for-net","status":"publish","type":"post","link":"https:\/\/www.rangakrish.com\/index.php\/2021\/02\/14\/litedb-a-nosql-database-for-net\/","title":{"rendered":"LiteDB: A NoSQL Database for .NET"},"content":{"rendered":"<p>I have been looking around for a compact embedded <em><strong>NoSQL<\/strong><\/em> database library for <em><strong>.NET<\/strong><\/em>, to use as the back-end of my <em><strong>&#8220;iLexicon&#8221;<\/strong><\/em> system. <em><strong>&#8220;iLexicon&#8221;<\/strong><\/em> is written in <em><strong>Lisp<\/strong><\/em> and <em><strong>Prolog<\/strong><\/em> (I have written a few <a href=\"https:\/\/www.rangakrish.com\/index.php\/2019\/08\/04\/generating-poetry-in-prolog\/\" target=\"_blank\" rel=\"noopener\"><em><strong>articles<\/strong><\/em><\/a>\u00a0on it before). At present, the entire dictionary component (containing over 300,000 word entries) is resident in memory, and the idea is to move this to a reasonably fast persistent store.<\/p>\n<p>There are many <em><strong>NoSQL<\/strong><\/em> databases for <em><strong>.NET<\/strong><\/em>. I briefly explored <a href=\"https:\/\/www.siaqodb.com\" target=\"_blank\" rel=\"noopener\"><em><strong>SiaqODB<\/strong><\/em><\/a>, <a href=\"https:\/\/kellermansoftware.com\/products\/ninja-net-database-pro\" target=\"_blank\" rel=\"noopener\"><em><strong>Ninja Database Pro<\/strong><\/em><\/a>, <a href=\"https:\/\/unqlite.org\" target=\"_blank\" rel=\"noopener\"><em><strong>UnQLite<\/strong><\/em><\/a>, and <a href=\"https:\/\/www.litedb.org\" target=\"_blank\" rel=\"noopener\"><em><strong>LiteDB<\/strong><\/em><\/a> and finally chose <em><strong>LiteDB<\/strong><\/em>.<\/p>\n<h3>Installing LiteDB<\/h3>\n<p>Installation is straightforward. Create a project in <em><strong>Visual Studio<\/strong><\/em> (I used VS 2019 ver 16.8.5) and use <em><strong>NuGet<\/strong><\/em> Package Manager to install the package as described <a href=\"https:\/\/www.litedb.org\/docs\/getting-started\/\" target=\"_blank\" rel=\"noopener\"><em><strong>here<\/strong><\/em><\/a>.<\/p>\n<figure id=\"attachment_2316\" aria-describedby=\"caption-attachment-2316\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Package-Manager.jpg?ssl=1\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" data-attachment-id=\"2316\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/02\/14\/litedb-a-nosql-database-for-net\/package-manager\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Package-Manager.jpg\" data-orig-size=\"1531,499\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1613138409&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Using Package Manager to Install LiteDB\" data-image-description=\"&lt;p&gt;Using Package Manager to Install LiteDB&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Using Package Manager to Install LiteDB&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Package-Manager-1024x334.jpg\" class=\"wp-image-2316\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Package-Manager.jpg?resize=550%2C179&#038;ssl=1\" alt=\"Using Package Manager to Install LiteDB\" width=\"550\" height=\"179\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Package-Manager.jpg?resize=300%2C98&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Package-Manager.jpg?resize=1024%2C334&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Package-Manager.jpg?resize=768%2C250&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Package-Manager.jpg?w=1531&amp;ssl=1 1531w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2316\" class=\"wp-caption-text\"><strong>Using Package Manager to Install LiteDB<\/strong><\/figcaption><\/figure>\n<p>This creates a separate sub-directory under the project for the package, and adds the correct reference.<\/p>\n<h3>Working with the DB Engine<\/h3>\n<p>There are two ways to populate the database. One is to define appropriate classes to model the dictionary entries and use instances of these types to store in the DB. The other is to use <em><strong>\u201cBsonDocument<\/strong><\/em>\u201d directly and store the data as <em><strong>\u201cJSON\u201d<\/strong><\/em> entries. The latter is schema-less and can be convenient in some cases. I tried both.<\/p>\n<figure id=\"attachment_2317\" aria-describedby=\"caption-attachment-2317\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/classes.jpg?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"2317\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/02\/14\/litedb-a-nosql-database-for-net\/classes\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/classes.jpg\" data-orig-size=\"579,294\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1613138591&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Classes to Model Dictionary Entries\" data-image-description=\"&lt;p&gt;Classes to Model Dictionary Entries&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Classes to Model Dictionary Entries&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/classes.jpg\" class=\"wp-image-2317\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/classes.jpg?resize=500%2C254&#038;ssl=1\" alt=\"Classes to Model Dictionary Entries\" width=\"500\" height=\"254\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/classes.jpg?resize=300%2C152&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/classes.jpg?w=579&amp;ssl=1 579w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-2317\" class=\"wp-caption-text\"><strong>Classes to Model Dictionary Entries<\/strong><\/figcaption><\/figure>\n<p>Let us create some sample entries from the above:<\/p>\n<figure id=\"attachment_2318\" aria-describedby=\"caption-attachment-2318\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/creating-words.jpg?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"2318\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/02\/14\/litedb-a-nosql-database-for-net\/creating-words\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/creating-words.jpg\" data-orig-size=\"1073,312\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1613138635&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Instantiating Word Entries\" data-image-description=\"&lt;p&gt;Instantiating Word Entries &lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Instantiating Word Entries &lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/creating-words-1024x298.jpg\" class=\"wp-image-2318\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/creating-words.jpg?resize=550%2C160&#038;ssl=1\" alt=\"Instantiating Word Entries \" width=\"550\" height=\"160\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/creating-words.jpg?resize=300%2C87&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/creating-words.jpg?resize=1024%2C298&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/creating-words.jpg?resize=768%2C223&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/creating-words.jpg?w=1073&amp;ssl=1 1073w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2318\" class=\"wp-caption-text\"><strong>Instantiating Word Entries<\/strong><\/figcaption><\/figure>\n<p>We are now ready to insert the data into the database. For each type of entry (basic word, emotion word, pronoun, etc.), we need to create a <em><strong>&#8220;collection&#8221;<\/strong><\/em> first.<\/p>\n<figure id=\"attachment_2319\" aria-describedby=\"caption-attachment-2319\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/inserting-into-db.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2319\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/02\/14\/litedb-a-nosql-database-for-net\/inserting-into-db\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/inserting-into-db.jpg\" data-orig-size=\"964,1028\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1613138684&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Storing the Words\" data-image-description=\"&lt;p&gt;Storing the Words&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Storing the Words&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/inserting-into-db-960x1024.jpg\" class=\"wp-image-2319\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/inserting-into-db.jpg?resize=550%2C587&#038;ssl=1\" alt=\"Storing the Words\" width=\"550\" height=\"587\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/inserting-into-db.jpg?resize=281%2C300&amp;ssl=1 281w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/inserting-into-db.jpg?resize=960%2C1024&amp;ssl=1 960w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/inserting-into-db.jpg?resize=768%2C819&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/inserting-into-db.jpg?w=964&amp;ssl=1 964w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2319\" class=\"wp-caption-text\"><strong>Storing the Words<\/strong><\/figcaption><\/figure>\n<p>You can see that I am inserting three words in the category of <em><strong>&#8220;pronouns&#8221;<\/strong><\/em> directly using <em><strong>&#8220;BsonDocument&#8221;<\/strong><\/em> without creating a class, unlike <em><strong>WordDef<\/strong><\/em> and <em><strong>EmotionWord.<\/strong><\/em><\/p>\n<h3>LiteDB Studio<\/h3>\n<p>One additional benefit of using <em><strong>LiteDB<\/strong><\/em> is that there is also the <em><strong>&#8220;LiteDB Studio&#8221;<\/strong><\/em> that you can install (actually, build from the sources) separately. It allows you to connect to a local database and manage it using a nice UI.<\/p>\n<p>First we have to connect to the local data store:<\/p>\n<figure id=\"attachment_2321\" aria-describedby=\"caption-attachment-2321\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Studio-connection-manager.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2321\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/02\/14\/litedb-a-nosql-database-for-net\/studio-connection-manager\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Studio-connection-manager.jpg\" data-orig-size=\"896,702\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1613138828&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Connecting to the DB Using Studio\" data-image-description=\"&lt;p&gt;Connecting to the DB Using Studio&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Connecting to the DB Using Studio&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Studio-connection-manager.jpg\" class=\"wp-image-2321\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Studio-connection-manager.jpg?resize=550%2C431&#038;ssl=1\" alt=\"Connecting to the DB Using Studio\" width=\"550\" height=\"431\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Studio-connection-manager.jpg?resize=300%2C235&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Studio-connection-manager.jpg?resize=768%2C602&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Studio-connection-manager.jpg?w=896&amp;ssl=1 896w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2321\" class=\"wp-caption-text\"><strong>Connecting to the DB Using Studio<\/strong><\/figcaption><\/figure>\n<p>We can double click on the different collections and execute the default query to fetch the data in that collection.<\/p>\n<figure id=\"attachment_2322\" aria-describedby=\"caption-attachment-2322\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/words-db.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2322\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/02\/14\/litedb-a-nosql-database-for-net\/words-db\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/words-db.jpg\" data-orig-size=\"1408,822\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1613139037&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Showing WordDef Entries\" data-image-description=\"&lt;p&gt;Showing WordDef Entries&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Showing WordDef Entries&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/words-db-1024x598.jpg\" class=\"wp-image-2322\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/words-db.jpg?resize=550%2C321&#038;ssl=1\" alt=\"Showing WordDef Entries\" width=\"550\" height=\"321\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/words-db.jpg?resize=300%2C175&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/words-db.jpg?resize=1024%2C598&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/words-db.jpg?resize=768%2C448&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/words-db.jpg?w=1408&amp;ssl=1 1408w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2322\" class=\"wp-caption-text\"><strong>Showing WordDef Entries<\/strong><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_2323\" aria-describedby=\"caption-attachment-2323\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/emotions-db.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2323\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/02\/14\/litedb-a-nosql-database-for-net\/emotions-db\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/emotions-db.jpg\" data-orig-size=\"1408,822\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1613138983&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Emotion Words\" data-image-description=\"&lt;p&gt;Emotion Words&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Emotion Words&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/emotions-db-1024x598.jpg\" class=\"wp-image-2323\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/emotions-db.jpg?resize=550%2C321&#038;ssl=1\" alt=\"Emotion Words\" width=\"550\" height=\"321\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/emotions-db.jpg?resize=300%2C175&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/emotions-db.jpg?resize=1024%2C598&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/emotions-db.jpg?resize=768%2C448&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/emotions-db.jpg?w=1408&amp;ssl=1 1408w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2323\" class=\"wp-caption-text\"><strong>Emotion Words<\/strong><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_2324\" aria-describedby=\"caption-attachment-2324\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/pronouns-db.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2324\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/02\/14\/litedb-a-nosql-database-for-net\/pronouns-db\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/pronouns-db.jpg\" data-orig-size=\"1408,822\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1613139015&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Pronoun Entries\" data-image-description=\"&lt;p&gt;Pronoun Entries&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Pronoun Entries&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/pronouns-db-1024x598.jpg\" class=\"wp-image-2324\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/pronouns-db.jpg?resize=550%2C321&#038;ssl=1\" alt=\"Pronoun Entries\" width=\"550\" height=\"321\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/pronouns-db.jpg?resize=300%2C175&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/pronouns-db.jpg?resize=1024%2C598&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/pronouns-db.jpg?resize=768%2C448&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/pronouns-db.jpg?w=1408&amp;ssl=1 1408w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2324\" class=\"wp-caption-text\"><strong>Pronoun Entries<\/strong><\/figcaption><\/figure>\n<p>Overall, I am quite satisfied with <em><strong>LiteDB<\/strong><\/em>. It is easy to use, flexible and seems to have acceptable performance. I plan to try it out with the complete <em><strong>iLexicon<\/strong><\/em> data in the next couple of weeks, and see how it interfaces with my <em><strong>Prolog<\/strong> <strong>NLP<\/strong><\/em> parser.<\/p>\n<p>The sample <em><strong>C#<\/strong><\/em> source code is <a href=\"http:\/\/www.rangakrish.com\/downloads\/Program.cs\" target=\"_blank\" rel=\"noopener\"><em><strong>here<\/strong><\/em><\/a>.<\/p>\n<p>Have a nice weekend!<\/p>\n<p><span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been looking around for a compact embedded NoSQL database library for .NET, to use as the back-end of my &#8220;iLexicon&#8221; system. &#8220;iLexicon&#8221; is written in Lisp and Prolog (I have written a few articles\u00a0on it before). At present, the entire dictionary component (containing over 300,000 word entries) is resident in memory, and the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[17],"tags":[67,130,265,266],"class_list":["post-2315","post","type-post","status-publish","format-standard","hentry","category-programming","tag-c","tag-ilexicon","tag-litedb","tag-nosql"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9OLnF-Bl","jetpack-related-posts":[{"id":2366,"url":"https:\/\/www.rangakrish.com\/index.php\/2021\/03\/28\/implementing-ilexicon-using-litedb\/","url_meta":{"origin":2315,"position":0},"title":"Implementing iLexicon using LiteDB","author":"admin","date":"March 28, 2021","format":false,"excerpt":"iLexicon is an \"intelligent\" dictionary that can be used to build Natural Language applications. I have two implementations, one in Lisp and another in Prolog. Both implementations are memory-based, in order to speed up performance. I have written several articles referencing it, for example see this. \u00a0 LiteDB is a\u2026","rel":"","context":"In &quot;Natural Language Processing&quot;","block_context":{"text":"Natural Language Processing","link":"https:\/\/www.rangakrish.com\/index.php\/category\/natural-language-processing\/"},"img":{"alt_text":"Sample Commands","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Session1.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1349,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/12\/30\/natural-language-interaction-with-ilexicon-using-luis\/","url_meta":{"origin":2315,"position":1},"title":"Natural Language Interaction with iLexicon Using LUIS","author":"admin","date":"December 30, 2018","format":false,"excerpt":"Some time ago, I had written a series of articles on my iLexicon project. It is a Lisp package that supports many interesting queries on English words. When I was discussing this project with a client recently, she asked me if it was possible to query the system in natural\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"Talking to iLexicon","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/12\/Code2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/12\/Code2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/12\/Code2.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":863,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/03\/11\/kangaroo-words\/","url_meta":{"origin":2315,"position":2},"title":"Kangaroo Words","author":"admin","date":"March 11, 2018","format":false,"excerpt":"According to Wikipedia, \"A kangaroo word is a word that contains letters of another word, in order, with the same meaning. For example: the word 'masculine' contains the word 'male', which is a synonym of the first word; similarly, the word 'observe' contains its synonym 'see'.\" Interesting idea. The key\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1711,"url":"https:\/\/www.rangakrish.com\/index.php\/2019\/09\/01\/poetry-in-prolog-part-2\/","url_meta":{"origin":2315,"position":3},"title":"Poetry in Prolog: Part-2","author":"admin","date":"September 1, 2019","format":false,"excerpt":"In an earlier post, I showed how Prolog can be used to generate poetry, making use of my \"iLexicon\". I want to continue the discussion today by giving another example, this time based on the theme of sounds emitted by various animals and birds. As hinted in my previous articles,\u2026","rel":"","context":"In &quot;Natural Language Processing&quot;","block_context":{"text":"Natural Language Processing","link":"https:\/\/www.rangakrish.com\/index.php\/category\/natural-language-processing\/"},"img":{"alt_text":"The DCG Grammar","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/09\/code.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/09\/code.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/09\/code.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1659,"url":"https:\/\/www.rangakrish.com\/index.php\/2019\/08\/04\/generating-poetry-in-prolog\/","url_meta":{"origin":2315,"position":4},"title":"Generating Poetry in Prolog","author":"admin","date":"August 4, 2019","format":false,"excerpt":"In an earlier article, I showed how we can generate poetry (with limitations, of course!) using my iLangGen framework. That implementation (in Lisp) made use of iLexicon, a large dictionary of English words, which I have been building over the years. I subsequently ported iLexicon to Prolog and it now\u2026","rel":"","context":"In &quot;Natural Language Processing&quot;","block_context":{"text":"Natural Language Processing","link":"https:\/\/www.rangakrish.com\/index.php\/category\/natural-language-processing\/"},"img":{"alt_text":"Generation Logic","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/08\/Code3.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/08\/Code3.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/08\/Code3.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":846,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/02\/11\/onomatopoeia-palindrome-and-semordnilap\/","url_meta":{"origin":2315,"position":5},"title":"Onomatopoeia, Palindrome and Semordnilap","author":"admin","date":"February 11, 2018","format":false,"excerpt":"I had earlier\u00a0briefly talked about the Ilexicon project that I have been working on for some time now. The goal is to build an intelligent dictionary\u00a0that will come in handy while implementing NLP applications such as recognizers and generators. In today's post, I want to demonstrate some cool features available\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/2315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/comments?post=2315"}],"version-history":[{"count":0,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/2315\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/media?parent=2315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/categories?post=2315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/tags?post=2315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}