File Keywords.lua

Functions

Keywords:getAllKeywordSet (options) Get set of all keywords.
Keywords:getAllKeywords (options) Get all keywords array.
Keywords:getKeywordComponents (keyword, reverse) Get component array given leaf keyword.
Keywords:getKeywordForPath (path, options) Refresh display of recently changed photo (externally changed).
Keywords:getKeywordFromPath (path, permitReinit) Refresh display of recently changed photo (externally changed).
Keywords:getKeywordPath (keyword, options) Get keyword as path.
Keywords:getKeywordPaths (keyword, options) Get array of keyword paths (includes synonyms).
Keywords:initCache () Init keyword cache.
Keywords:new (t) Constructor for new instance.
Keywords:newClass (t) Constructor for extending class.
Keywords:parseKeywordString (kwString, options) Parse keyword string info into parallel arrays of resolved keywords and corresponding names/subpaths (having unique counterpart existing in catalog).
Keywords:startInit (ival) This is generally called once upon init, then continues to re-init forever, or until stopped or shutdown.
Keywords:stopInit () Call this when exiting dialog box that uses initializing keyword object.


Functions

Keywords:getAllKeywordSet (options)
Get set of all keywords.

Parameters:

  • options:
Keywords:getAllKeywords (options)
Get all keywords array.

Parameters:

  • options:
Keywords:getKeywordComponents (keyword, reverse)
Get component array given leaf keyword.

Parameters:

  • keyword: (LrKeyword, required) the keyword to be expressed as component array.
  • reverse: (boolean, default: false) whether components should be reversed so root is first.

Usage:

    it is expected that leaf keyword will be pure/true leaf, but such is not required - it could also be parental keyword. 

Return value:

    comp (array) will always have at least one keyword - never empty, never nil. leaf will be first component, root will be last - reverse order if desired.
Keywords:getKeywordForPath (path, options)
Refresh display of recently changed photo (externally changed).

Parameters:

  • path:
  • options:
Keywords:getKeywordFromPath (path, permitReinit)
Refresh display of recently changed photo (externally changed).

Parameters:

  • path:
  • permitReinit:
Keywords:getKeywordPath (keyword, options)
Get keyword as path.

Parameters:

  • keyword: (LrKeyword, required) the keyword to be expressed as path.
  • options: (table, optional) include format = 'slash', 'Lr5', or 'legacy', as desired - default is 'slash' notation.

Usage:

    it is expected that leaf keyword will be pure/true leaf, but such is not required - it could also be parental keyword. 

Return value:

    path string and comp (array).
Keywords:getKeywordPaths (keyword, options)
Get array of keyword paths (includes synonyms).

Parameters:

  • keyword:
  • options:
Keywords:initCache ()
Init keyword cache.
Keywords:new (t)
Constructor for new instance.

Parameters:

  • t: (table) object initialization table, options:
    initInterval ( number, default: 1 ) set to zero to not re-initialized, else seconds for keyword re-init interval.
Keywords:newClass (t)
Constructor for extending class.

Parameters:

  • t:
Keywords:parseKeywordString (kwString, options)
Parse keyword string info into parallel arrays of resolved keywords and corresponding names/subpaths (having unique counterpart existing in catalog).

Parameters:

  • kwString:
  • options:

Usage:

    implementation @19/Dec/2013 6:47 does not return parsed keywords which aren't in the catalog, but maybe should, so they can be created, at least as on option. 

Return values:

  1. keywords (array of LrKeyword objects) - resolved.
  2. names (parallael array of strings) - resolved.
  3. message (qualifying message) - will accompany partially keywords/names, but won't accompany if all are resolved.
  4. other ( table, only if qualifying message ) - members: 'missing', 'ambiguous' (arrays of strings).
Keywords:startInit (ival)
This is generally called once upon init, then continues to re-init forever, or until stopped or shutdown.

Parameters:

  • ival:

Usage:

    another option is to start initialization task, and stop it, as desired. 
Keywords:stopInit ()
Call this when exiting dialog box that uses initializing keyword object.

Valid XHTML 1.0!