<commit_before>package guava.string;

import com.google.common.base.Joiner;
import org.junit.Test;
import org.testng.collections.Sets;

import java.util.Set;

/**
 * Created by Linuxea on 2017/8/18.
 */
public class StringTest {

	@Test
	public void test(){
		Set<String> stringSet = Sets.newHashSet();
		stringSet.add("a");
		stringSet.add("b");
		stringSet.add("c");
		stringSet.add("d");
		stringSet.add("e");
		stringSet.add(null);
		String joinerResult = Joiner.on(",").skipNulls().join(stringSet);
		System.out.println(joinerResult);
	}

}<commit_msg>字符集的东东<commit_after>package guava.string;

import com.google.common.base.CharMatcher;
import com.google.common.base.Charsets;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import org.junit.Test;
import org.testng.collections.Sets;

import java.util.Arrays;
import java.util.Iterator;
import java.util.Set;

/**
 * Created by Linuxea on 2017/8/18.
 */
public class StringTest {

	@Test
	public void test(){
		Set<String> stringSet = Sets.newHashSet();
		stringSet.add("a");
		stringSet.add("b");
		stringSet.add("c");
		stringSet.add("d");
		stringSet.add("e");
		stringSet.add(null);
		String joinerResult = Joiner.on(",").skipNulls().join(stringSet);
		System.out.println(joinerResult);
	}

	@Test
	public void splitterTest(){
		String str = "a,b,c,d,e";
		Iterable<String> iterable = Splitter.on(",").limit(3).split(str);
		for(Iterator<String> iterator = iterable.iterator();iterator.hasNext();){
			System.out.println(iterator.next());
		}

//		iterable.forEach(System.out::println);
	}

	@Test
	public void charMatcherTest(){
		String str = "11";
		String newStr = CharMatcher.digit().and(CharMatcher.javaLowerCase()).removeFrom(str);
		System.out.println(newStr);
	}

	@Test
	public void StringByteTest(){
		String str = "I love kimboo";
		byte[] bytes = str.getBytes(Charsets.UTF_8);
		System.out.println(Arrays.toString(bytes));
	}

}
{'fraction_non_alphanumeric': 0.1693423096841015, 'fraction_numerical': 0.009321595028482652, 'mean_word_length': 4.75, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7482002', 'n_tokens_mistral': 734, 'n_tokens_neox': 693, 'n_words': 119}