Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the translate-client Reference Manual, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 15:16:49 2020 GMT+0.
• Introduction | What translate-client is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
Translate Client is a library for interfacing with an http-protocol web-server that handles text translation between languages. List of Web Servers: Google Translate Website: https://cloud.google.com/translate/docs/translating-text Requirements: Google Cloud service API Key Status: Functioning Microsoft Translator Website: http://docs.microsofttranslator.com/text-translate.html Requirements: azure account and key Status: Future development This project depends on Alexandria (utilities), Dexador (http client), quri (uri generator), yason (json parsing) and assoc-utils. If you prefer to use a different http client, json library or uri generator, please open an issue. This project is under the MIT license. The goal of this project is to provide a common lisp client interface to web-server translation services while at the same time overcoming the limitations of these services. For example, Google Translate has a stated 2000 character limit for the entire HTTP Request (though the real limit seems somewhere above 5000). If the requested translation(s) surpass this limit, the software will seemlessly divide the translations into multiple requests. Exported symbols: Parameters: *uri-scheme* : the google translation api scheme *uri-host* : the google translation api host *uri-path* : the google translation api path *google-api-key* : the default google cloud api key. You need your own key and should be set in your own code. *uri-char-limit* : google states that the uri must not pass 2000 characters *source-language* : the default source language to be translated from. can be a string or keyword. must be an ISO-639-1 identifier *target-language* : the target language to be translated to. can be a string or keyword. must be an ISO-639-1 identifier *translation-format* : the translation format of the translated text. Must be :html for html or :text for plain-text Functions: translate : (strings &key source target api-key format) Translates the string(s) from one language to another. Returns a translated string if given a string or the list of translated strings if given a list. The parameter strings is either a string or a list of strings. Keys source and target are strings or keywords and must be ISO-639-1 language identifiers. Defaults to *source-language* and *target-language* Key api-key is a string and must be a valid google cloud api key. Defaults to *google-api-key* Key format needs to be either :html or :text Defaults to *translation-format* translate-to-alist : (strings &key source target api-key format) similar to translate but returns an association list of translation pairs.
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The translate-client system |
andy peterson
MIT
A client to online web-server translators, currently only google translate
translate-client.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The translate-client.asd file | ||
• The translate-client/package.lisp file | ||
• The translate-client/translate-client.lisp file |
Next: The translate-client/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
translate-client.asd
translate-client (system)
Next: The translate-client/translate-client․lisp file, Previous: The translate-client․asd file, Up: Lisp files [Contents][Index]
translate-client (system)
package.lisp
Previous: The translate-client/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
translate-client (system)
translate-client.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The translate-client package |
package.lisp (file)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported special variables | ||
• Exported functions |
Next: Exported functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
the default google cloud api key. You need your own key and should be set in your own code.
translate-client.lisp (file)
the default source language to be translated from. can be a string or keyword. must be an ISO-639-1 identifier
translate-client.lisp (file)
the target language to be translated to. can be a string or keyword. must be an ISO-639-1 identifier
translate-client.lisp (file)
the translation format of the translated text. Must be :html for html or :text for plain-text
translate-client.lisp (file)
google states that the uri must not pass 2000 characters
translate-client.lisp (file)
the google translation api host
translate-client.lisp (file)
the google translation api path
translate-client.lisp (file)
the google translation api scheme
translate-client.lisp (file)
Previous: Exported special variables, Up: Exported definitions [Contents][Index]
translates the string(s) from the source language to the target language.
The parameter strings is either a string or a list of strings to be translated.
Returns
Parameters source and target are strings or keywords and must be ISO-639-1 language identifiers.
Api-key is a string and must be a valid google cloud api key.
format needs to be either :html or :text
translate-client.lisp (file)
similar to translate but returns an association list of translation pairs.
translate-client.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal functions | ||
• Internal generic functions | ||
• Internal conditions |
Next: Internal generic functions, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
returns a list of lists. the inner lists must be one of two things:
A list of strings (only) for a single http-request to translate multiple string
or a list of a single list of strings when a single translation string must be
divided into parts
translate-client.lisp (file)
translate-client.lisp (file)
translate-client.lisp (file)
given the json response from google, return the list of translated strings
translate-client.lisp (file)
this returns a string with maximum length max-length.
If the given string is larger than max-length, this returns a string with ellipsis
in the middle at the cut-point.
If cut-point is nil, the ellipsis is in the middle.
If cut-point is zero, negative or :front, the ellipsis is at the beginning.
If cut-point is too large or :back, the ellipsis is at the end.
translate-client.lisp (file)
create google uri to translates string(s) from the source language to the target language
The parameter strings is either a string or a list of strings.
Parameters source and target are strings or keywords and must be ISO-639-1 language identifiers.
Api-key is a string and must be a valid google cloud api key.
format needs to be either :html or :text
translate-client.lisp (file)
translate-client.lisp (file)
Next: Internal conditions, Previous: Internal functions, Up: Internal definitions [Contents][Index]
translate-client.lisp (file)
Previous: Internal generic functions, Up: Internal definitions [Contents][Index]
translate-client.lisp (file)
error (condition)
google-uri-reader (method)
:google-uri
google-uri-reader (generic function)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L T |
---|
Jump to: | F L T |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | D E F G J M S T W |
---|
Jump to: | D E F G J M S T W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
G S |
---|
Jump to: | *
G S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C G P S T |
---|
Jump to: | C G P S T |
---|