<commit_before>package de.geeksfactory.opacclient.apis;

import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONException;
import org.json.JSONObject;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import de.geeksfactory.opacclient.Base64;
import de.geeksfactory.opacclient.NotReachableException;
import de.geeksfactory.opacclient.objects.Account;
import de.geeksfactory.opacclient.objects.AccountData;
import de.geeksfactory.opacclient.objects.Detail;
import de.geeksfactory.opacclient.objects.DetailledItem;
import de.geeksfactory.opacclient.objects.Filter;
import de.geeksfactory.opacclient.objects.Filter.Option;
import de.geeksfactory.opacclient.objects.Library;
import de.geeksfactory.opacclient.objects.SearchRequestResult;
import de.geeksfactory.opacclient.objects.SearchResult;
import de.geeksfactory.opacclient.objects.SearchResult.Status;
import de.geeksfactory.opacclient.storage.MetaDataSource;

/**
 * 
 * @author <NAME>, 11.08.2014
 * 
 *         WinBIAP, Version 4.1.0 gestartet mit Bibliothek Unterföhring
 * 
 *         Unterstützt bisher nur Katalogsuche
 * 
 *         Example for a search query (parameter "data" in the URL, everything
 *         before the hyphen, base64 decoded, added formatting) as seen in
 *         Unterföhring:
 * 
 *         cmd=5&amp; perform a search sC= c_0=1%% unknown m_0=1%% unknown
 *         f_0=2%% free search o_0=8%% contains v_0=schule "schule" ++ c_1=1%%
 *         unknown m_1=1%% unknown f_1=3%% author o_1=8%% contains v_1=rowling
 *         "rowling" ++ c_2=1%% unknown m_2=1%% unknown f_2=12%% title o_2=8%%
 *         contains v_2=potter "potter" ++ c_3=1%% unknown m_3=1%% unknown
 *         f_3=34%% year o_3=6%% newer or equal to v_3=2000 "2000" ++ c_4=1%%
 *         unknown m_4=1%% unknown f_4=34%% year o_4=4%% older or equal to
 *         v_4=2014 "2014" ++ c_5=1%% unknown m_5=1%% unknown f_5=42%% media
 *         category o_5=1%% is equal to v_5=3 "Kinder- und Jugendbücher" ++
 *         c_6=1%% unknown m_6=1%% unknown f_6=48%% location o_6=1%% is equal to
 *         v_6=1 "Bibliothek Unterföhring" ++ c_7=3%% unknown (now changed to 3)
 *         - m_7=1%% unknown | This group has no f_7=45%% unknown |--- effect on
 *         the result o_7=1%% unknown | and can be left out v_7=5|4|101|102
 *         unknown -
 * 
 *         &amp;Sort=Autor Sort by Author (default)
 * <commit_msg>Eclipse auto-formatting messed up WinBiap's documentation comment<commit_after>package de.geeksfactory.opacclient.apis;

import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONException;
import org.json.JSONObject;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import de.geeksfactory.opacclient.Base64;
import de.geeksfactory.opacclient.NotReachableException;
import de.geeksfactory.opacclient.objects.Account;
import de.geeksfactory.opacclient.objects.AccountData;
import de.geeksfactory.opacclient.objects.Detail;
import de.geeksfactory.opacclient.objects.DetailledItem;
import de.geeksfactory.opacclient.objects.Filter;
import de.geeksfactory.opacclient.objects.Filter.Option;
import de.geeksfactory.opacclient.objects.Library;
import de.geeksfactory.opacclient.objects.SearchRequestResult;
import de.geeksfactory.opacclient.objects.SearchResult;
import de.geeksfactory.opacclient.objects.SearchResult.Status;
import de.geeksfactory.opacclient.storage.MetaDataSource;

/**
 * 
 * @author <NAME>, 11.08.2014
 * 
 *         WinBIAP, Version 4.1.0 gestartet mit Bibliothek Unterföhring
 * 
 *         Unterstützt bisher nur Katalogsuche
 * 
 *         Example for a search query (parameter "data" in the URL, everything
 *         before the hyphen, base64 decoded, added formatting) as seen in
 *         Unterföhring:
 * 
 *        cmd=5&amp;				perform a search
 *         sC=
 *         		c_0=1%%				unknown
 *         		m_0=1%%				unknown
 *         		f_0=2%%				free search
 *         		o_0=8%%				contains
 *         		v_0=schule			"schule"
 *         ++
 *         		c_1=1%%				unknown
 *         		m_1=1%%				unknown
 *         		f_1=3%%				author
 *         		o_1=8%%				contains
 *         		v_1=rowling			"rowling"
 *         ++
 *         		c_2=1%%				unknown
 *         		m_2=1%%				unknown
 *         		f_2=12%%			title
 *         		o_2=8%%				contains
 *         		v_2=potter			"potter"
 *         ++
 *         		c_3=1%%				unknown
 *         		m_3=1%%				unknown
 *         		f_3=34%%			year
 *         		o_3=6%%				newer or equal to
 *         		v_3=2000			"2000"
 *         ++
 *         		c_4=1%%				unknown
 *         		m_4=1%%				unknown
 *         		f_4=34%%			year
 *         		o_4=4%%				older or equal to
 *         		v_4=2014			"2014"
 *         ++
 *         		c_5=1%%				unknown
 *         		m_5=1%%				unknown
 *         		f_5=42%%			media category
 *         		o_5=1%%				is equal to
 *         		v_5=3				"Kinder- und Jugendbücher"
 *         ++
 *         		c_6=1%%				unknown
 *         		m_6=1%%				unknown
 *         		f_6=48%%			location
 *         		o_6=1%%				is equal to
 *         		v_6=1				"Bibliothek Unterföhring"
 *         ++
 *         		c_7=3%%				unknown (now changed to 3)	-
 *         		m_7=1%%				unknown						|	  This group has no
 *         		f_7=45%%			unknown						|---  effect on the result
 *         		o_7=1%%				unknown						|	  and can be left out
 *         		v_7=5|4|101|102		unknown						-
 *         
 *     &amp;Sort=Autor				Sort by Author (default)
 * 
{'fraction_non_alphanumeric': 0.11477832512315271, 'fraction_numerical': 0.03973727422003284, 'mean_word_length': 2.5724340175953078, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '7551129', 'n_tokens_mistral': 2381, 'n_tokens_neox': 2203, 'n_words': 442}