Open topic with navigation

# Use Named Parameters

Some Lua functions have an argument that takes named parameters. This argument is a table in which you can specify values for various parameters that affect the operation of the function.

You can specify a value for every parameter, or just those that you need. If you do not specify a value for a parameter, the function uses a default value. You can also specify the name of a configuration section and the function will read settings from that section in the CFS configuration file.

For example, when you call the function `looks_like_language`, you can set only the `term_file` named parameter, and use default values for the other settings:

    looks_like_language(document, { term_file = "english.ocr" })

You might choose to set the `stop_list` parameter as well:

    looks_like_language(document, { term_file = "english.ocr",
                           stop_list = "englishstoplist.dat" })

Alternatively, you can specify the name of a section in the CFS configuration file:

    looks_like_language(document, { term_file = "english.ocr",
                           section = "LanguageSettings" })

In this example, the function uses the `english.ocr` term file. The settings for the remaining parameters are read from the `LanguageSettings` section of the CFS configuration file.

If you specify the name of a configuration section and use named parameters, the named parameters override any values set in the configuration file. In the following example, the `threshold` is set to 100, while other parameters (like `term_file`) are read from the `LanguageSettings` section:

    looks_like_language(document, { section = "LanguageSettings",
                           threshold=100 })

For information about individual named parameters and corresponding configuration parameters, refer to the Connector Framework Server Reference.

© Copyright 2019 Micro Focus or one of its affiliates | Send documentation feedback Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm