GtrTranslationMemory

## GtrTranslationMemory GtrTranslationMemory |

## Synopsis

    struct              GtrTranslationMemoryIface;
    struct              GtrTranslationMemoryMatch;
    gboolean            gtr_translation_memory_store        (GtrTranslationMemory *obj,
                                                             GtrMsg *msg);
    gboolean            gtr_translation_memory_store_list   (GtrTranslationMemory *obj,
                                                             GList *msg);
    void                gtr_translation_memory_remove       (GtrTranslationMemory *obj,
                                                             const gchar *original,
                                                             const gchar *translation);
    GList *             gtr_translation_memory_lookup       (GtrTranslationMemory *obj,
                                                             const gchar *phrase);
    void                gtr_translation_memory_set_max_omits
                                                            (GtrTranslationMemory *obj,
                                                             gsize omits);
    void                gtr_translation_memory_set_max_delta
                                                            (GtrTranslationMemory *obj,
                                                             gsize delta);
    void                gtr_translation_memory_set_max_items
                                                            (GtrTranslationMemory *obj,
                                                             gint items);

## Description

## Details

### struct GtrTranslationMemoryIface

    struct GtrTranslationMemoryIface {
      GTypeInterface g_iface;

      gboolean (*store) (GtrTranslationMemory * obj, GtrMsg * msg);
      gboolean (*store_list) (GtrTranslationMemory * obj, GList * msgs);
      void (*remove) (GtrTranslationMemory * obj,
    		  const gchar * original,
    		  const gchar *translation);

      GList *(*lookup) (GtrTranslationMemory * obj, const gchar * phrase);
      void (*set_max_omits) (GtrTranslationMemory * obj, gsize omits);
      void (*set_max_delta) (GtrTranslationMemory * obj, gsize delta);
      void (*set_max_items) (GtrTranslationMemory * obj, gint items);
    };

### struct GtrTranslationMemoryMatch

    struct GtrTranslationMemoryMatch {
      gchar *match;
      gint level;
    };

### gtr_translation_memory_store ()

    gboolean            gtr_translation_memory_store        (GtrTranslationMemory *obj,
                                                             GtrMsg *msg);

Stores the `msg` in the database.

`obj` : | a GtrTranslationMemory
`msg` : | message

### gtr_translation_memory_store_list ()

    gboolean            gtr_translation_memory_store_list   (GtrTranslationMemory *obj,
                                                             GList *msg);

Stores the messages from `msgs` in the database.

`obj` : | a GtrTranslationMemory

### gtr_translation_memory_remove ()

    void                gtr_translation_memory_remove       (GtrTranslationMemory *obj,
                                                             const gchar *original,
                                                             const gchar *translation);

Removes `translation` of `original` from translation memory.

`obj` : | a GtrTranslationMemory
`original` : | the original message.
`translation` : | the translation to remove.

### gtr_translation_memory_lookup ()

    GList *             gtr_translation_memory_lookup       (GtrTranslationMemory *obj,
                                                             const gchar *phrase);

Looks for the `phrase` in the database and gets a list of the GtrTranslationMemoryMatch.

`obj` : | a GtrTranslationMemory
`phrase` : | the unstranslated text to search for translations.
Returns : | a list of GtrTranslationMemoryMatch.

### gtr_translation_memory_set_max_omits ()

    void                gtr_translation_memory_set_max_omits
                                                            (GtrTranslationMemory *obj,
                                                             gsize omits);

Sets the number of omits used in the search.

`omits` : | the number of omits

### gtr_translation_memory_set_max_delta ()

    void                gtr_translation_memory_set_max_delta
                                                            (GtrTranslationMemory *obj,
                                                             gsize delta);

Sets the difference in the length of string for searching in the database.

`delta` : | the difference in the length of strings

### gtr_translation_memory_set_max_items ()

    void                gtr_translation_memory_set_max_items
                                                            (GtrTranslationMemory *obj,
                                                             gint items);

Sets the number of item to return in `gtr_translation_memory_lookup()`.

`items` : | the max item to return in lookup