Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions ift/config/auto_segmenter_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -834,29 +834,35 @@ static Quality AutoPickQuality(uint32_t codepoint_count) {
// complexity that feeds into the selection in addition to # of codepoints.

// These values were picked by looking at segmenter run times by quality level
// accross the font collection from https://github.com/google/fonts/.
// Roughly they aim to keep the number of segmentations that take >= 10 minutes
// for a particular count below 0.5%.
// across the font collection from https://github.com/google/fonts/.
// Roughly they aim to keep the number of segmentations that take >= 15 minutes
// for a particular bucket at or below 0.5%.
//
// Bin Quality % > 10 minutes
// [1, 300] 7 0.3
// (300, 1500] 6 0.3
// (1500, 3100] 4 0.0
// (3100, 30000] 2 0.0
// (30000, inf] 1 28.6
if (codepoint_count <= 300) {
// Generated by: `bazel run util:select_quality_thresholds -- <data directory> --step=100`
//
// Bin Quality % >= 15 minutes
// [1, 500] 7 0.5
// (500, 2500] 6 0.1
// (2500, 3100] 5 0.0
// (3100, 3500] 4 0.0
// (3500, 7500] 3 0.0
// (7500, inf] 2 0.0
if (codepoint_count <= 500) {
return SEVEN;
}
if (codepoint_count <= 1500) {
if (codepoint_count <= 2500) {
return SIX;
}
if (codepoint_count <= 3100) {
return FIVE;
}
if (codepoint_count <= 3500) {
return FOUR;
}
if (codepoint_count <= 30000) {
return TWO;
if (codepoint_count <= 7500) {
return THREE;
}
return ONE;
return TWO;
}

// Returns the codepoints in the font which are covered by the frequency data
Expand Down
8 changes: 8 additions & 0 deletions util/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_cc//cc:cc_test.bzl", "cc_test")
load("@rules_python//python:defs.bzl", "py_binary")

package(features = ["layering_check"])

Expand Down Expand Up @@ -203,6 +204,13 @@ cc_binary(
],
)

py_binary(
name = "select_quality_thresholds",
srcs = [
"select_quality_thresholds.py",
],
)

filegroup(
name = "testdata",
srcs = glob([
Expand Down
Loading
Loading