0.0
Low commit activity in last 3 years
No release in over a year
Builds a Polyrex index (pxindex) XML document from a YAML document or an indented list
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.6, >= 0.6.8
~> 0.1, >= 0.1.7
~> 0.3, >= 0.3.0
~> 0.1, >= 0.1.1
 Project Readme

Introducing the pxindex-builder gem

require 'pxindex-builder'


s = "
How are you?
What's today's date?
Is it going to rain tomorrow?
Track my location
what's Tom's mobile number?
What's Sally's mobile number?
Open the door
How are you?
Switch the bedroom light on
Switch the bedroom light off
Switch the livingroom light on
How are you?
Switch the bedroom light on
Switch the bedroom light off
Switch the livingroom light off
Open the door
"
s = PhraseLookup.new(s.strip).master.to_h.to_yaml

xml = PxIndexBuilder.new(s, ignore: %w(is it the are you to)).to_xml
puts xml

The pxindex-builder gem is intended to create a Polyrex Index document for populating a dynamic tree list on a web page which can either be expanded or collapsed. On average it would take the user 3 clicks to select any of the above statements. To open the door the use would click on the letter o, followed by click on the word open and then click on the open the door statement.

Output (extract):

<?xml version='1.0' encoding='UTF-8'?>
<items>
  <summary>
    <recordx_type>polyrex</recordx_type>
    <schema>items/entry[title]/entry[title]/entry[title]</schema>
  </summary>
  <records>
    <entry>
      <summary>
        <title>a</title>
        <schema>entry[title]</schema>
      </summary>
      <records>
        <entry>
          <summary>
            <title>are</title>
            <schema>entry[title]</schema>
          </summary>
          <records>
            <entry>
              <summary>
                <title>how are you</title>
                <schema>entry[title]</schema>
              </summary>
            </entry>
          </records>
        </entry>
      </records>
    </entry>
    <entry>
      <summary>
        <title>b</title>
        <schema>entry[title]</schema>
      </summary>
      <records>
        <entry>
          <summary>
            <title>bedroom</title>
            <schema>entry[title]</schema>
          </summary>
          <records>
            <entry>
              <summary>
                <title>switch the bedroom light on</title>
                <schema>entry[title]</schema>
              </summary>
            </entry>
            <entry>
              <summary>
                <title>switch the bedroom light off</title>
                <schema>entry[title]</schema>
              </summary>
            </entry>
          </records>
        </entry>
      </records>
    </entry>
    <entry>
      <summary>
        <title>d</title>
        <schema>entry[title]</schema>
      </summary>
      <records>
        <entry>
          <summary>
            <title>door</title>
            <schema>entry[title]</schema>
          </summary>
          <records>
            <entry>
              <summary>
                <title>open the door</title>
                <schema>entry[title]</schema>
              </summary>
            </entry>
          </records>
        </entry>
        <entry>
          <summary>
            <title>date</title>
            <schema>entry[title]</schema>
          </summary>
          <records>
            <entry>
              <summary>
                <title>what's today's date</title>
                <schema>entry[title]</schema>
              </summary>
            </entry>
          </records>
        </entry>
      </records>
    </entry>
...

Notes:

  • This gem is suited for a mobile phone user interface where the user finds it more convenient than speech recognition or by manually inputting the text (even with autocompletion)
  • The gem is intended to store a relatively large list of user-defined statements.

Resource

gem pxindex build builder query bot pxindexbuilder