<commit_before>/*
 * Copyright 1998-2009 Linux.org.ru
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package ru.org.linux.site.boxes;

import java.io.IOException;
import java.net.URLEncoder;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import ru.org.linux.boxlet.Boxlet;
import ru.org.linux.site.LorDataSource;
import ru.org.linux.util.ProfileHashtable;
import ru.org.linux.util.UtilException;

public final class tagcloud extends Boxlet {
  @Override
  public String getContentImpl(ProfileHashtable profile) throws IOException, SQLException {
    Connection db = null;
    try {
      db = LorDataSource.getConnection();

      Map<String,Double> ht = new TreeMap<String,Double>();
      StringBuilder out = new StringBuilder();
      int tags = profile.getInt("tags");

      out.append("<h2>Облако Меток</h2>");
      out.append("<div class=\"boxlet_content\">");
      out.append("<h3>Наиболее используемые метки</h3>");
      out.append("<div align=\"center\">");

      PreparedStatement st = db.prepareStatement("select value,counter from tags_values where counter>0 order by counter desc limit ?");
      st.setInt(1,tags);<commit_msg>убран заголовок "Наиболее используемые метки"<commit_after>/*
 * Copyright 1998-2009 Linux.org.ru
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package ru.org.linux.site.boxes;

import java.io.IOException;
import java.net.URLEncoder;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import ru.org.linux.boxlet.Boxlet;
import ru.org.linux.site.LorDataSource;
import ru.org.linux.util.ProfileHashtable;
import ru.org.linux.util.UtilException;

public final class tagcloud extends Boxlet {
  @Override
  public String getContentImpl(ProfileHashtable profile) throws IOException, SQLException {
    Connection db = null;
    try {
      db = LorDataSource.getConnection();

      Map<String,Double> ht = new TreeMap<String,Double>();
      StringBuilder out = new StringBuilder();
      int tags = profile.getInt("tags");

      out.append("<h2>Облако Меток</h2>");
      out.append("<div class=\"boxlet_content\">");
      out.append("<div align=\"center\">");

      PreparedStatement st = db.prepareStatement("select value,counter from tags_values where counter>0 order by counter desc limit ?");
      st.setInt(1,tags);
{'fraction_non_alphanumeric': 0.1053935057787562, 'fraction_numerical': 0.009356081452944413, 'mean_word_length': 3.8466666666666667, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1356874', 'n_tokens_mistral': 1052, 'n_tokens_neox': 1054, 'n_words': 328}