<commit_before># w3w-java-wrapper
Java wrapper for the [what3words](http://what3words.com/) [web-API](http://developer.what3words.com/api).

Use the what3words API in your Java applications.

## Methods

  ```java
  double[] wordsToPosition(String[] words)
  ```

  Converts a 3 words 'address' into a position (assumes words in the default language 'en')
  
  ```java
  double[] wordsToPosition(String[] words, String language)
  ```

  Converts a 3 words 'address' (in the given language) into a position

  ```java
  String[] positionToWords(double[] coords)
  ```

  Converts a position into a 3 words 'address' (language 'en')
  
  ```java
  String[] positionToWords(double[] coords, String language)
  ```

  Converts a position into a 3 words 'address' (in the given language)

## Code Samples

```java
String apiKey = "my-super-w3w-apikey";
What3Words w3w = new What3Words(apiKey);
String[] words = {"goldfish", "fuzzy", "aggregates"};
try {
    double[] coords = w3w.wordsToPosition(words);
    System.out.println(coords[0] +  " / " + coords[1]);
} catch (Exception e) {
    // do your error handling
}
```

```java
String apiKey = "my-super-w3w-apikey";
What3Words w3w = new What3Words(apiKey);
Double[] coords = {49.422636, 8.320833};
try {
    // optionally set a different language
    String[] words = w3w.positionToWords(coords, "de");
    System.out.println(words[0] +  "." + words[1] +  "." + words[2]);
} catch (Exception e) {
    // do your error handling<commit_msg>Add JavaDoc screeshot as method description<commit_after># w3w-java-wrapper
Java wrapper for the [what3words](http://what3words.com/) [web-API](http://developer.what3words.com/api).

Use the what3words API in your Java applications.

## Methods

![ScreenShot](https://cloud.githubusercontent.com/assets/1185547/11721162/c1375aa0-9f62-11e5-873f-d1103118d36f.png)

## Code Samples

```java
String apiKey = "my-super-w3w-apikey";
What3Words w3w = new What3Words(apiKey);
String[] words = {"goldfish", "fuzzy", "aggregates"};
try {
    double[] coords = w3w.wordsToPosition(words);
    System.out.println(coords[0] +  " / " + coords[1]);
} catch (Exception e) {
    // do your error handling
}
```

```java
String apiKey = "my-super-w3w-apikey";
What3Words w3w = new What3Words(apiKey);
Double[] coords = {49.422636, 8.320833};
try {
    // optionally set a different language
    String[] words = w3w.positionToWords(coords, "de");
    System.out.println(words[0] +  "." + words[1] +  "." + words[2]);
} catch (Exception e) {
    // do your error handling
{'fraction_non_alphanumeric': 0.15721040189125296, 'fraction_numerical': 0.04412923561859732, 'mean_word_length': 4.078, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1934299', 'n_tokens_mistral': 953, 'n_tokens_neox': 870, 'n_words': 228}